Skip to content

Commit

Permalink
[devOps] import/erase workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jm committed Nov 7, 2023
1 parent 20837f3 commit 7882825
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
inputs:
INSTANCE:
required: true
default: ''
default: '*'
type: choice
options:
- '*'
- '5'
- '8'
IMPORT:
Expand All @@ -18,7 +19,7 @@ on:

jobs:
deploy:
if: github.event.inputs.INSTANCE == '' || github.event.inputs.INSTANCE == '5'
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '5'
runs-on: dspace-dep-1
timeout-minutes: 5
steps:
Expand Down Expand Up @@ -54,13 +55,13 @@ jobs:
./start.sh dspace-5
pre-deploy-import:
if: github.event.inputs.INSTANCE == '' || github.event.inputs.INSTANCE == '8'
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8'
uses: dataquest-dev/dspace-angular/.github/workflows/erase_db.yml@dtq-dev
with:
INSTANCE: '8'

deploy-import:
if: github.event.inputs.INSTANCE == '' || github.event.inputs.INSTANCE == '8'
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8'
needs: pre-deploy-import
runs-on: dspace-dep-1
timeout-minutes: 5
Expand All @@ -76,7 +77,7 @@ jobs:
/bin/bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://dev-5.pc:8$INSTANCE/server/api)" != "200" ]]; do sleep 5; done'
post-deploy-import:
if: (github.event.inputs.INSTANCE == '' || github.event.inputs.INSTANCE == '8') && github.event.inputs.IMPORT == true
if: (github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8') && github.event.inputs.IMPORT == true
needs: deploy-import
uses: dataquest-dev/dspace-angular/.github/workflows/import.yml@dtq-dev
secrets: inherit
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/erase_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:

- name: stop and remove containers
run: |
docker stop dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE
docker rm dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE
docker stop dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE || true
docker rm dspacedb$INSTANCE dspace$INSTANCE dspace-angular$INSTANCE || true
- name: remove volumes
if: '!cancelled()'
run: |
docker volume rm $NAME_pgdata $NAME_assetstore
docker volume rm $NAME_pgdata $NAME_assetstore || true

0 comments on commit 7882825

Please sign in to comment.