-
Notifications
You must be signed in to change notification settings - Fork 14
258 lines (234 loc) · 7.79 KB
/
release-deploy-all.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
name: Release - Deploy All
run-name: Release - Deploy all from ${{ inputs.gitRef }} to ${{ inputs.environment }}
on:
workflow_dispatch:
inputs:
gitRef:
description: "Git Ref (e.g. v1.0.0 or v1.0.0-prerelease.1)"
required: true
default: ""
environment:
description: "Environment"
required: true
type: environment
deployCamundaDefinitions:
description: "Deploy Camunda BPMN/DMN from main"
type: boolean
default: true
deployFormioDefinitions:
description: "Deploy Form.io forms from main"
type: boolean
default: true
workflow_call:
inputs:
gitRef:
required: true
type: string
environment:
required: true
type: string
deployCamundaDefinitions:
required: true
type: boolean
deployFormioDefinitions:
required: true
type: boolean
secrets:
SA_TOKEN:
required: true
OPENSHIFT_ENV_NAMESPACE:
required: true
HOST_PREFIX:
required: true
KEYCLOAK_AUTH_URL:
required: true
BCeID_WEB_SERVICE_WSDL:
required: true
SITE_MINDER_LOGOUT_URL:
required: true
ATBC_LOGIN_ENDPOINT:
required: true
ATBC_ENDPOINT:
required: true
BYPASS_APPLICATION_SUBMIT_VALIDATIONS:
required: true
BYPASS_CRA_INCOME_VERIFICATION:
required: true
OPENSHIFT_SIMS_CREDS_NAME:
required: true
FORMS_SECRET_NAME:
required: true
QUEUE_PREFIX:
required: true
API_PORT:
required: true
WEB_PORT:
required: true
env:
NAMESPACE: ${{ secrets.OPENSHIFT_ENV_NAMESPACE }}
BUILD_REF: ${{ inputs.gitRef }}
HOST_PREFIX: ${{ secrets.HOST_PREFIX }}
DOMAIN_PREFIX: ${{ vars.DOMAIN_PREFIX }}
BUILD_NAMESPACE: ${{ vars.BUILD_NAMESPACE }}
KEYCLOAK_REALM: ${{ vars.KEYCLOAK_REALM }}
IS_FULLTIME_ALLOWED: ${{ vars.IS_FULLTIME_ALLOWED }}
KEYCLOAK_AUTH_URL: ${{ secrets.KEYCLOAK_AUTH_URL }}
BCeID_WEB_SERVICE_WSDL: ${{ secrets.BCeID_WEB_SERVICE_WSDL }}
SITE_MINDER_LOGOUT_URL: ${{ secrets.SITE_MINDER_LOGOUT_URL }}
ATBC_LOGIN_ENDPOINT: ${{ secrets.ATBC_LOGIN_ENDPOINT }}
ATBC_ENDPOINT: ${{ secrets.ATBC_ENDPOINT }}
SWAGGER_ENABLED: true
APPLICATION_ARCHIVE_DAYS: 43
BYPASS_APPLICATION_SUBMIT_VALIDATIONS: ${{ secrets.BYPASS_APPLICATION_SUBMIT_VALIDATIONS }}
BYPASS_CRA_INCOME_VERIFICATION: ${{ secrets.BYPASS_CRA_INCOME_VERIFICATION }}
API_SECRET_NAME: ${{ secrets.OPENSHIFT_SIMS_CREDS_NAME }}
WORKERS_SECRET_NAME: ${{ secrets.OPENSHIFT_SIMS_CREDS_NAME }}
QUEUE_CONSUMERS_SECRET_NAME: ${{ secrets.OPENSHIFT_SIMS_CREDS_NAME }}
FORMS_SECRET_NAME: ${{ secrets.FORMS_SECRET_NAME }}
QUEUE_PREFIX: ${{ secrets.QUEUE_PREFIX }}
API_PORT: ${{ secrets.API_PORT }}
WEB_PORT: ${{ secrets.WEB_PORT }}
MAXIMUM_IDLE_TIME_FOR_WARNING_STUDENT: ${{ vars.MAXIMUM_IDLE_TIME_FOR_WARNING_STUDENT }}
MAXIMUM_IDLE_TIME_FOR_WARNING_SUPPORTING_USER: ${{ vars.MAXIMUM_IDLE_TIME_FOR_WARNING_SUPPORTING_USER }}
MAXIMUM_IDLE_TIME_FOR_WARNING_INSTITUTION: ${{ vars.MAXIMUM_IDLE_TIME_FOR_WARNING_INSTITUTION }}
MAXIMUM_IDLE_TIME_FOR_WARNING_AEST: ${{ vars.MAXIMUM_IDLE_TIME_FOR_WARNING_AEST }}
TLS_CERTIFICATE: ${{ secrets.TLS_CERTIFICATE }}
TLS_KEY: ${{ secrets.TLS_KEY }}
TLS_CA_CERTIFICATE: ${{ secrets.TLS_CA_CERTIFICATE }}
ALLOW_BETA_USERS_ONLY: ${{ vars.ALLOW_BETA_USERS_ONLY }}
jobs:
# Run DB migrations.
run-db-migrations:
name: Run db-migrations
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- name: Print env
run: |
echo Deploy Environment: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Run db-migrations
working-directory: "./devops/"
run: |
make oc-run-db-migrations
# Deploy SIMS API.
deploy-sims-api:
name: Deploy SIMS-API
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo Deploy ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy SIMS-API
working-directory: "./devops/"
run: |
make oc-deploy-api
# Deploy workers.
deploy-workers:
name: Deploy Workers
environment: ${{ inputs.environment }}
env:
DISABLE_ORM_CACHE: true
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo BUILD ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
- name: Checkout Target Branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy Workers
working-directory: "./devops/"
run: |
make oc-deploy-workers
# Deploy queue consumers.
deploy-queue-consumers:
name: Deploy Queue Consumers
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo Deploy ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy Queue Consumers
working-directory: "./devops/"
run: |
make oc-deploy-queue-consumers
# Deploy Web/Frontend.
deploy-web-frontend:
name: Deploy Web/Frontend
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
needs: run-db-migrations
steps:
- name: Print env
run: |
echo Deploy ENVIRONMENT: ${{ inputs.environment }}
echo GIT REF: ${{ inputs.gitRef }}
echo BUILD NAMESPACE: $BUILD_NAMESPACE
- name: Checkout Target Branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
- name: Log in to OpenShift
run: |
oc login --token=${{ secrets.SA_TOKEN }} --server=${{ vars.OPENSHIFT_CLUSTER_URL }}
- name: Deploy Web/Frontend
working-directory: "./devops/"
run: |
make oc-deploy-web
# Deploy Camunda Definitions
deployCamundaDefinitions:
if: ${{ inputs.deployCamundaDefinitions }}
name: Deploy BPMNs and DMNs to Camunda
needs: deploy-sims-api
uses: ./.github/workflows/release-deploy-camunda-definitions.yml
with:
environment: ${{ inputs.environment }}
gitRef: ${{ inputs.gitRef }}
secrets: inherit
# Deploy Formio Definitions
deployFormioDefinitions:
if: ${{ inputs.deployFormioDefinitions }}
name: Deploy Form.io definitions
needs: deploy-sims-api
uses: ./.github/workflows/release-deploy-formio-definitions.yml
with:
environment: ${{ inputs.environment }}
gitRef: ${{ inputs.gitRef }}
secrets: inherit