Skip to content

Commit

Permalink
Create create_bitstreams.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MajoBerger authored Mar 7, 2024
1 parent 8b4974f commit cfebfeb
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/create_bitstreams.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: create_bitstreams - import test files

on:
workflow_dispatch:
inputs:
INSTANCE:
required: true
default: '8'
type: choice
options:
- '2'
- '5'
- '8'

jobs:
import-5:
if: inputs.INSTANCE == '5'
runs-on: dspace-dep-1
env:
DSPACE_REST_API: http://dev-5.pc:85/server/api/
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
deploy-8:
if: inputs.INSTANCE == '*' || inputs.INSTANCE == '8'
runs-on: dspace-dep-1
timeout-minutes: 120
env:
INSTANCE: '8'
# 2024/02: this .env replaces ENTRYPOINT to angular
# !!!!WARNING!!!!
# disable TSL checks = allowing to cooperate with https backend with invalid
# certificate
ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/erase-db
if: inputs.ERASE_DB
with:
INSTANCE: ${{ env.INSTANCE }}
NAME: dspace-${{ env.INSTANCE }}

- name: deploy dspace-import on dev-5
working-directory: build-scripts/run/
run: |
./start.sh dspace-$INSTANCE
/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'
import-8:
runs-on: dspace-dep-1
if: inputs.IMPORT
needs: deploy-8
env:
INSTANCE: '8'
ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5
steps:
- uses: ./.github/actions/import-db
with:
INSTANCE: ${{ env.INSTANCE }}
DATADIR: /opt/dspace-data/clarin-dspace/

- name: dspace command
run: |
export DNAME=dspace$INSTANCE
docker logs -n 50 $DNAME
echo "dspace version:"
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace version"
echo "dspace cleanup:"
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace cleanup -v"
echo "dspace checker:"
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace checker -v -l"
echo "dspace healthcheck:"
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace healthcheck -v"

0 comments on commit cfebfeb

Please sign in to comment.