1919# the private key needs to be set in the environment variable:
2020# DOCS_SSH_KEY
2121
22+ include :
23+ - project : ' labs/salt-automation'
24+ ref : ' master'
25+ file :
26+ - ' /gitlab-ci-templates/common/rules.v1.yml'
27+ - ' /gitlab-ci-templates/common/config-updater-meta.v1.yml'
28+ - ' /gitlab-ci-templates/common/saltbert.v1.yml'
29+
2230stages :
2331 - lint
2432 # build stage is not blocked by lint stage, as we have a DAG:
@@ -49,7 +57,7 @@ variables:
4957.lint-default : &lint-default
5058 stage : lint
5159 needs : []
52- image : python:3.7
60+ image : python:3.10
5361 tags :
5462 - docker
5563
@@ -88,13 +96,12 @@ Lint Dockerfiles:
8896Build docs :
8997 stage : build
9098 needs : []
91- image : python:3.7
99+ image : python:3.10
92100 tags :
93101 - docker
94102 before_script :
95103 - pip3 install -r backend/requirements-test.txt
96104 - pip3 install -r backend/requirements.txt
97- -
apt-get update && apt-get install npm -y && npm install -g [email protected] 98105 script :
99106 - sphinx-build docs/source doc-build
100107 artifacts :
@@ -170,7 +177,9 @@ FrontendTest:
170177 SIMPLESAMLPHP_BASEURLPATH : http://idp:8080/simplesaml
171178 SIMPLESAMLPHP_SP_ENTITY_ID : http://bev:5000
172179 SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE : http://bev:5000/api/saml2_auth/acs/
173- image : magentalabs/frontend-test:v0.2 # includes npm, chrome, firefox and ffmpeg
180+ image :
181+ name : testcafe/testcafe:latest
182+ entrypoint : ["/bin/sh", "-c"]
174183 tags :
175184 - docker
176185 - high-mem
@@ -182,14 +191,18 @@ FrontendTest:
182191 - name : magentalabs/os2bos-idp-test:2.0.1
183192 alias : idp
184193 before_script :
194+ - npm --version
185195 - cd frontend-tests
186196 - npm install
187197 script :
188- - ./node_modules/.bin/ testcafe chrome :headless tests/*.js --baseurl http://bev:5000 --screenshot $CI_PROJECT_DIR/artifacts --video $CI_PROJECT_DIR/artifacts --assertion-timeout 15000 --selector-timeout 15000
198+ - /opt/testcafe/docker/ testcafe-docker.sh chromium :headless tests/*.js --baseurl http://bev:5000 --cache --cs node_modules/axe-core/axe.min.js --screenshots $CI_PROJECT_DIR/artifacts --video $CI_PROJECT_DIR/artifacts --video-options pathPattern='${DATE}_${TIME}/${FIXTURE} - ${TEST}.mp4' -- assertion-timeout 10000 --selector-timeout 10000 --pageRequestTimeout 10000 --reporter spec,xunit:$CI_PROJECT_DIR/testcafe.xml
189199 artifacts :
190200 when : always
191201 paths :
192202 - $CI_PROJECT_DIR/artifacts
203+ reports :
204+ junit : $CI_PROJECT_DIR/testcafe.xml
205+
193206
194207# Release stage
195208# ##############
@@ -291,7 +304,6 @@ Publish database docs:
291304
292305.deploy-default : &deploy-default
293306 stage : deploy
294- image : magentalabs/pepper:latest
295307 services : []
296308 dependencies : []
297309 tags :
@@ -340,44 +352,53 @@ Deploy dev:
340352 url : https://cburdev.magenta.dk
341353
342354
355+ Update staging salt config :
356+ extends :
357+ - .rules:semver-all
358+ - .config:endpoint-with-tag
359+ needs : ["Release rc"]
360+ when : manual
361+ variables :
362+ ENDPOINT : os2bos/salt/ballerup/update-staging
363+ CONFIG_UPDATER_USERNAME : os2bos
364+
343365Deploy tag to staging :
344366 << : *deploy-default
345- needs : ["Release rc"]
367+ extends :
368+ - .rules:semver-all
369+ - .saltbert
370+ needs : ["Update staging salt config"]
346371 when : manual
347- only :
348- variables :
349- # Matches all of SemVer 2.0.0
350- - $CI_COMMIT_TAG =~ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
351372 variables :
352- DEPLOYMENT_NAMESPACE : cbur.ballerup.staging
353- SALTAPI_URL : https://ctrl1.magenta-aps.dk/api/
354- SALTAPI_EAUTH : file
355- GIT_STRATEGY : none
356- PILLAR_OVERRIDE : " {\" OS2BOS_APPLICATION_DOCKER_IMAGE\" :\" ${IMAGE}:${CI_COMMIT_TAG}\" }"
357- script :
358- - echo Deploying ${IMAGE_TAG} to https://test-bevilling.balk.dk
359- - pepper --client runner --fail-any state.orchestrate ${DEPLOYMENT_NAMESPACE} pillar=$(echo $PILLAR_OVERRIDE)
373+ SALTBERT_ORCHESTRATION : cbur.ballerup.staging
374+ SALTBERT_URL : https://ctrl1.magenta-aps.dk
375+ SALTBERT_PASSWORD : $SALTBERT_STAGING_PASSWORD
360376 environment :
361377 name : ballerup-staging
362378 url : https://test-bevilling.balk.dk
363379
380+ Update production salt config :
381+ extends :
382+ - .rules:semver-core
383+ - .config:endpoint-with-tag
384+ needs : ["Release master"]
385+ when : manual
386+ variables :
387+ ENDPOINT : os2bos/salt/ballerup/update-production
388+ CONFIG_UPDATER_USERNAME : os2bos
389+
364390
365- Deploy master :
391+ Deploy tag to production :
366392 << : *deploy-default
367- needs : ["Release master"]
393+ extends :
394+ - .rules:semver-core
395+ - .saltbert
396+ needs : ["Update production salt config"]
368397 when : manual
369- only :
370- variables :
371- # Matches <version core> from SemVer 2.0.0 BNF grammar. Ex. 2.3.4, but not 2.3.4-rc
372- - $CI_COMMIT_TAG =~ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/
373398 variables :
374- DEPLOYMENT_NAMESPACE : cbur.ballerup.production
375- SALTAPI_URL : https://ctrl1.magenta-aps.dk/api/
376- SALTAPI_EAUTH : file
377- GIT_STRATEGY : none
378- script :
379- - echo Deploying ${IMAGE_TAG} to https://bevilling.balk.dk
380- - pepper --client runner --fail-any state.orchestrate ${DEPLOYMENT_NAMESPACE}
399+ SALTBERT_ORCHESTRATION : cbur.ballerup.production
400+ SALTBERT_URL : https://ctrl1.magenta-aps.dk
401+ SALTBERT_PASSWORD : $SALTBERT_PROD_PASSWORD
381402 environment :
382403 name : ballerup-production
383404 url : https://bevilling.balk.dk
0 commit comments