forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (91 loc) · 3.1 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
99
100
101
102
103
104
# 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
workflow_dispatch:
inputs:
INSTANCE:
required: true
default: '2'
type: choice
options:
- '*'
- '2'
- '5'
- '8'
IMPORT:
required: true
default: true
type: boolean
jobs:
deploy:
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '2'
runs-on: dspace-dep-1
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: deploy to dev-5
run: |
cd $GITHUB_WORKSPACE/build-scripts/run/
pwd
touch .env.dev-5 || true
echo INSTANCE=2 >> .env.dev-5
echo DSPACE_HOST=dev-5.pc >> .env.dev-5
echo DSPACE_VER=customer-uk >> .env.dev-5
echo DSPACE_SSL=false >> .env.dev-5
echo DOCKER_OWNER=dataquest >> .env.dev-5
echo DSPACE_UI_IMAGE=\${DOCKER_OWNER}/dspace-angular:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_IMAGE=\${DOCKER_OWNER}/dspace:\$DSPACE_VER >> .env.dev-5
echo DSPACE_REST_PORT=8\$INSTANCE >> .env.dev-5
echo REST_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT}/server >> .env.dev-5
echo UI_URL=http://\${DSPACE_HOST}:\${DSPACE_REST_PORT} >> .env.dev-5
echo S3_STORAGE=1 >> .env.dev-5
echo S3_ENABLED=true >> .env.dev-5
echo S3_RELATIVE_PATH=true >> .env.dev-5
echo S3_BUCKET=testbucket >> .env.dev-5
echo S3_SUBFOLDER=dtq-test >> .env.dev-5
echo S3_ACCESS=${{ secrets.AMAZON_ACCESS }} >> .env.dev-5
echo S3_SECRET=${{ secrets.AMAZON_SECRET }} >> .env.dev-5
echo S3_REGION_NAME=us-east-1 >> .env.dev-5
echo S3_ENDPOINT=https://s3.cl4.du.cesnet.cz >> .env.dev-5
export ENVFILE=$(pwd)/.env.dev-5
./start.sh dspace-${{ env.INSTANCE }}
deploy-2:
if: github.event.inputs.INSTANCE == '*' || github.event.inputs.INSTANCE == '8'
runs-on: dspace-dep-1
timeout-minutes: 120
env:
INSTANCE: '2'
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-2:
runs-on: dspace-dep-1
if: github.event.inputs.IMPORT == 'true'
needs: deploy-2
env:
INSTANCE: '2'
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/