Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
07919b95
Commit
07919b95
authored
3 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
chore: add remove deploy
chore: lint
parent
9c5de9b0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/on_branch_del.yml
+44
-0
44 additions, 0 deletions
.github/workflows/on_branch_del.yml
src/util/regDereg.base.ts
+2
-2
2 additions, 2 deletions
src/util/regDereg.base.ts
with
46 additions
and
2 deletions
.github/workflows/on_branch_del.yml
0 → 100644
+
44
−
0
View file @
07919b95
name
:
'
[undeploy
from
OKD]'
# only trigger on delete non master/staging branch
on
:
delete
:
branches
:
-
'
!master'
-
'
!staging'
jobs
:
remove-deploy
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
action/checkout@v2
-
name
:
'
Set
env
var'
run
:
|
echo "Using github.ref: $GITHUB_REF"
BRANCH_NAME=${GITHUB_REF#refs/heads/}
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo "OKD_URL=https://okd-dev.hbp.eu:443" >> $GITHUB_ENV
echo "OKD_SECRET=${{ secrets.OKD_DEV_SECRET }}" >> $GITHUB_ENV
echo "OKD_PROJECT=interactive-atlas-viewer" >> $GITHUB_ENV
echo "Remove deploy from dev cluster..."
-
name
:
'
Login
via
oc
cli'
run
:
|
oc login $OKD_URL --token=$OKD_SECRET
oc project $OKD_PROJECT
# sanitized branchname == remove _ / and lowercase everything
SANITIZED_BRANCH_NAME=$(echo ${BRANCH_NAME//[_\/]/} | awk '{ print tolower($0) }')
echo "SANITIZED_BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV
echo "Working branch name: $BRANCH_NAME, sanitized branch name: $SANITIZED_BRANCH_NAME"
-
name
:
'
List
and
delete
all
labelled
resoures'
run
:
|
oc get all \
-l template=siibra-explorer-branch-deploy-template \
-l app=siibra-explorer-branch-deploy-$SANITIZED_BRANCH_NAME
oc delete all \
-l template=siibra-explorer-branch-deploy-template \
-l app=siibra-explorer-branch-deploy-$SANITIZED_BRANCH_NAME
This diff is collapsed.
Click to expand it.
src/util/regDereg.base.ts
+
2
−
2
View file @
07919b95
...
...
@@ -7,9 +7,9 @@ type TRegDeregConfig = {
* a pattern which is observed very frequently
*/
export
class
RegDereg
<
T
,
Y
=
void
>
{
constructor
(){
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
constructor
(){}
public
allowDuplicate
=
false
protected
callbacks
:
((
allArg
:
T
)
=>
Y
)[]
=
[]
register
(
fn
:
(
allArg
:
T
)
=>
Y
,
config
?:
TRegDeregConfig
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment