Deploy DSpace #2339
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DSpace Docker deploy on dataquest servers | |
| name: Deploy DSpace | |
| on: | |
| workflow_call: | |
| inputs: | |
| INSTANCE: | |
| required: false | |
| type: string | |
| default: '2' | |
| IMPORT: | |
| required: false | |
| default: true | |
| type: boolean | |
| ERASE_DB: | |
| required: false | |
| default: false | |
| type: boolean | |
| workflow_dispatch: | |
| inputs: | |
| INSTANCE: | |
| required: true | |
| default: '2' | |
| type: choice | |
| options: | |
| - '*' | |
| - '2' | |
| - '5' | |
| - '8' | |
| IMPORT: | |
| required: true | |
| default: true | |
| type: boolean | |
| ERASE_DB: | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| deploy-2: | |
| if: inputs.INSTANCE == '*' || inputs.INSTANCE == '2' | |
| runs-on: dspace-dep-1 | |
| timeout-minutes: 10 | |
| env: | |
| INSTANCE: '2' | |
| ENVFILE: /opt/dspace-envs/.env.dspace.dev-5.uk | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/erase-db | |
| if: inputs.ERASE_DB | |
| with: | |
| INSTANCE: ${{ env.INSTANCE }} | |
| NAME: dspace-${{ env.INSTANCE }} | |
| - name: deploy to dev-5 | |
| working-directory: build-scripts/run/ | |
| run: | | |
| ./start.sh dspace-$INSTANCE | |
| playwright-after-deploy2: | |
| needs: deploy-2 | |
| if: '!inputs.IMPORT' | |
| uses: ./.github/workflows/playwright-tests.yml | |
| secrets: inherit | |
| rest-tests-after-deploy2: | |
| runs-on: ubuntu-latest | |
| needs: playwright-after-deploy2 | |
| timeout-minutes: 120 | |
| env: | |
| GH_TOKEN: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} | |
| REPO: dataquest-dev/dspace-rest-test | |
| WORKFLOW: run_unittests.yml | |
| steps: | |
| - name: run rest-tests | |
| run: | | |
| OUTPUT=$(gh workflow run "$WORKFLOW" \ | |
| --repo "$REPO" \ | |
| --ref master \ | |
| -f CUSTOMER="${{ github.ref_name }}" \ | |
| -f URL="http://dev-5.pc:82/server/api" 2>&1) | |
| RUN_ID=$(echo "$OUTPUT" | grep -oE '/runs/[0-9]+' | grep -oE '[0-9]+') | |
| echo "Watching run: https://github.com/$REPO/actions/runs/$RUN_ID" | |
| gh run watch "$RUN_ID" --repo "$REPO" --interval 30 --exit-status |