forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (83 loc) · 2.52 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# DSpace Docker deploy on dataquest servers
name: Deploy DSpace
on:
workflow_call:
inputs:
INSTANCE:
required: false
type: string
default: '5'
IMPORT:
required: false
default: true
type: boolean
workflow_dispatch:
inputs:
INSTANCE:
required: true
default: '5'
type: choice
options:
- '*'
- '5'
- '8'
IMPORT:
required: true
default: true
type: boolean
jobs:
deploy:
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '5'
runs-on: dspace-dep-1
timeout-minutes: 5
env:
INSTANCE: '5'
ENVFILE: /opt/dspace-envs/.env.dspace.dev-5
steps:
- uses: actions/checkout@v4
- name: deploy to dev-5
working-directory: build-scripts/run/
run: |
./start.sh dspace-$INSTANCE
deploy-8:
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8'
runs-on: dspace-dep-1
timeout-minutes: 120
env:
INSTANCE: '8'
ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/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: github.event.inputs.IMPORT == 'true'
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"