From 78828252004c0a50ceb12f74469a19b7b5fb0e1a Mon Sep 17 00:00:00 2001 From: jm Date: Tue, 7 Nov 2023 17:14:27 +0100 Subject: [PATCH] [devOps] import/erase workflows --- .github/workflows/deploy.yml | 11 ++++++----- .github/workflows/erase_db.yml | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 56d07cb20fa..be5091a6b8e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,9 +6,10 @@ on: inputs: INSTANCE: required: true - default: '' + default: '*' type: choice options: + - '*' - '5' - '8' IMPORT: @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/erase_db.yml b/.github/workflows/erase_db.yml index bbccb18b324..492c90d3fc5 100644 --- a/.github/workflows/erase_db.yml +++ b/.github/workflows/erase_db.yml @@ -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