2020-05-19 13:13:30 +00:00
|
|
|
# workflow
|
2020-01-14 20:36:26 +00:00
|
|
|
stages:
|
2020-05-19 13:13:30 +00:00
|
|
|
- build
|
|
|
|
- test
|
2020-03-15 16:11:16 +00:00
|
|
|
- integration
|
|
|
|
- acceptance
|
2020-04-03 18:02:49 +00:00
|
|
|
- release
|
2020-03-15 16:11:16 +00:00
|
|
|
- deployment
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-05-19 13:13:30 +00:00
|
|
|
# default image for jobs
|
|
|
|
default:
|
|
|
|
image: node:11
|
|
|
|
|
|
|
|
# cache modules between jobs
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- .npm/
|
|
|
|
|
|
|
|
## BUILD ##
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-07-14 14:11:54 +00:00
|
|
|
- npm i cypress-localstorage-commands
|
2020-05-19 13:13:30 +00:00
|
|
|
script:
|
|
|
|
- cp config.sample.json config.json
|
|
|
|
- npm run build
|
|
|
|
artifacts:
|
|
|
|
when: on_success
|
|
|
|
expire_in: 1 day
|
|
|
|
paths:
|
|
|
|
- dist/
|
|
|
|
tags:
|
|
|
|
- test
|
|
|
|
|
2020-01-14 20:36:26 +00:00
|
|
|
## TESTING ##
|
|
|
|
|
2020-05-19 13:13:30 +00:00
|
|
|
test:e2e:
|
|
|
|
stage: test
|
|
|
|
image: cypress/included:4.5.0
|
|
|
|
services:
|
|
|
|
- name: ${CI_REGISTRY_IMAGE}/server:0.1
|
|
|
|
before_script:
|
|
|
|
# install missing dependencies
|
|
|
|
- npm install -g sirv-cli
|
|
|
|
# making sure the process is orphan
|
|
|
|
- sirv dist --port 3000 > /dev/null 2>&1 &
|
|
|
|
script:
|
|
|
|
- cypress run -e CYPRESS_baseUrl=http://localhost:3000
|
|
|
|
tags:
|
|
|
|
- test
|
|
|
|
|
2020-01-14 20:36:26 +00:00
|
|
|
## VALIDATION ##
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
test1:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: integration
|
2020-01-14 20:36:26 +00:00
|
|
|
environment:
|
2020-03-15 16:11:16 +00:00
|
|
|
name: test1
|
|
|
|
url: https://test1.startinblox.com
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-01-14 20:36:26 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_TEST1" > config.json
|
2020-03-19 12:15:49 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
2020-03-15 16:11:16 +00:00
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test1@astral.startinblox.com:~/front/
|
2020-01-14 20:36:26 +00:00
|
|
|
only:
|
2020-03-16 09:50:07 +00:00
|
|
|
- /^feature\/.*/
|
2020-01-14 20:36:26 +00:00
|
|
|
when: manual
|
|
|
|
tags:
|
2020-03-15 16:11:16 +00:00
|
|
|
- deploy
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
test2:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: integration
|
2020-01-14 20:36:26 +00:00
|
|
|
environment:
|
2020-03-15 16:11:16 +00:00
|
|
|
name: test2
|
|
|
|
url: https://test2.startinblox.com
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-01-14 20:36:26 +00:00
|
|
|
script:
|
2020-03-15 16:11:16 +00:00
|
|
|
- echo "$APP_CONFIG_TEST2" > config.json
|
2020-03-19 12:15:49 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
2020-01-14 20:36:26 +00:00
|
|
|
- npm run build
|
2020-03-15 16:11:16 +00:00
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test2@astral.startinblox.com:~/front/
|
2020-01-14 20:36:26 +00:00
|
|
|
only:
|
2020-03-16 09:51:57 +00:00
|
|
|
- /^feature\/.*/
|
2020-01-14 20:36:26 +00:00
|
|
|
when: manual
|
|
|
|
tags:
|
2020-03-15 16:11:16 +00:00
|
|
|
- deploy
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
test3:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: integration
|
|
|
|
environment:
|
|
|
|
name: test3
|
|
|
|
url: https://test3.startinblox.com
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-03-15 16:11:16 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_TEST3" > config.json
|
2020-03-19 12:15:49 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
2020-03-15 16:11:16 +00:00
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test3@astral.startinblox.com:~/front/
|
|
|
|
only:
|
2020-03-16 09:51:57 +00:00
|
|
|
- /^feature\/.*/
|
2020-03-15 16:11:16 +00:00
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
stg1:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: acceptance
|
|
|
|
environment:
|
|
|
|
name: stg1
|
|
|
|
url: https://stg1.startinblox.com
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-03-15 16:11:16 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_STG1" > config.json
|
2020-03-19 12:15:49 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
2020-03-15 16:11:16 +00:00
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* stg1@astral.startinblox.com:~/front/
|
|
|
|
only:
|
2020-03-16 15:12:58 +00:00
|
|
|
- /^release\/.*/
|
|
|
|
when: manual
|
2020-03-15 16:11:16 +00:00
|
|
|
tags:
|
|
|
|
- deploy
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
stg2:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: acceptance
|
2020-01-14 20:36:26 +00:00
|
|
|
environment:
|
2020-03-15 16:11:16 +00:00
|
|
|
name: stg2
|
|
|
|
url: https://stg2.startinblox.com
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-01-14 20:36:26 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_STG2" > config.json
|
2020-03-19 12:15:49 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
2020-03-15 16:11:16 +00:00
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* stg2@astral.startinblox.com:~/front/
|
2020-01-14 20:36:26 +00:00
|
|
|
only:
|
2020-03-16 15:12:58 +00:00
|
|
|
- /^release\/.*/
|
|
|
|
when: manual
|
2020-01-14 20:36:26 +00:00
|
|
|
tags:
|
2020-03-15 16:11:16 +00:00
|
|
|
- deploy
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-04-03 18:02:49 +00:00
|
|
|
## RELEASE TAGGING ##
|
|
|
|
|
|
|
|
publish:
|
|
|
|
stage: release
|
|
|
|
script:
|
|
|
|
- npm install -g semantic-release@v17 @semantic-release/gitlab
|
|
|
|
- semantic-release
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
2020-03-15 16:11:16 +00:00
|
|
|
## LIVE DEPLOYMENTS ##
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-04-01 16:08:27 +00:00
|
|
|
community:
|
|
|
|
stage: deployment
|
|
|
|
environment:
|
|
|
|
name: community
|
|
|
|
url: https://community.startinblox.com
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-04-01 16:08:27 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_COMMUNITY" > config.json
|
2020-04-01 16:08:27 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* community@astral.startinblox.com:~/front/
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
2020-03-19 13:05:24 +00:00
|
|
|
etuc:
|
|
|
|
stage: deployment
|
|
|
|
environment:
|
|
|
|
name: etuc
|
|
|
|
url: https://app.digitalplatformobservatory.org
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-03-19 13:05:24 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_DIGITALPLATFORMOBSERVATORY" > config.json
|
2020-03-19 13:05:24 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* etuc@ssh-etuc.happy-dev.fr:~/sib/www/
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
nantes:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: deployment
|
2020-01-14 20:36:26 +00:00
|
|
|
environment:
|
|
|
|
name: nantes
|
2020-03-19 12:44:10 +00:00
|
|
|
url: https://app.nantes.happy-dev.fr
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-01-14 20:36:26 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_NANTESHD" > config.json
|
2020-03-19 12:15:49 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* nantes@ssh-nantes.happy-dev.fr:~/sib/www/
|
2020-01-14 20:36:26 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
2020-03-15 16:11:16 +00:00
|
|
|
- deploy
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
paris:
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: deployment
|
2020-01-14 20:36:26 +00:00
|
|
|
environment:
|
|
|
|
name: paris
|
2020-03-19 12:44:10 +00:00
|
|
|
url: https://app.paris.happy-dev.fr
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-03-19 12:44:10 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_PARIS" > config.json
|
2020-03-19 12:44:10 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* paris@ssh-paris.happy-dev.fr:~/sib/www/
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
toulouse:
|
|
|
|
stage: deployment
|
|
|
|
environment:
|
|
|
|
name: toulouse
|
|
|
|
url: https://smart-toulouse.happy-dev.fr
|
2020-05-19 18:12:41 +00:00
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
2020-01-14 20:36:26 +00:00
|
|
|
script:
|
2020-05-19 18:15:30 +00:00
|
|
|
- echo "$APP_CONFIG_TOULOUSE" > config.json
|
2020-03-19 12:44:10 +00:00
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
2020-03-19 12:47:07 +00:00
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* smart-toulouse@ssh-smart-toulouse.happy-dev.fr:~/www/
|
2020-01-14 20:36:26 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
2020-03-15 16:11:16 +00:00
|
|
|
- deploy
|
2020-05-22 16:50:30 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
stage: deployment
|
|
|
|
environment:
|
|
|
|
name: volumes
|
|
|
|
url: https://volumes.hubl.world
|
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
|
|
|
script:
|
|
|
|
- echo "$APP_CONFIG_VOLUMES" > config.json
|
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* volumes-sib@astral.startinblox.com:~/front/
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|
2020-06-11 18:26:43 +00:00
|
|
|
|
2020-06-11 18:35:29 +00:00
|
|
|
communityhubl:
|
2020-06-11 18:26:43 +00:00
|
|
|
stage: deployment
|
|
|
|
environment:
|
2020-06-11 18:29:10 +00:00
|
|
|
name: communityhubl
|
2020-06-11 18:26:43 +00:00
|
|
|
url: https://community.hubl.world
|
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
|
|
|
script:
|
|
|
|
- echo "$APP_CONFIG_HUBL_COMMUNITY" > config.json
|
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* community-hubl@astral.startinblox.com:~/front/
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|
2020-06-29 17:59:23 +00:00
|
|
|
|
|
|
|
playground:
|
|
|
|
stage: deployment
|
|
|
|
environment:
|
|
|
|
name: playground
|
|
|
|
url: https://playground.hubl.world
|
|
|
|
before_script:
|
|
|
|
- npm ci --cache .npm --prefer-offline --only=production
|
|
|
|
script:
|
|
|
|
- echo "$APP_CONFIG_PLAYGROUND" > config.json
|
|
|
|
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
|
|
|
|
- npm run build
|
|
|
|
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* playground@astral.startinblox.com:~/front/
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
when: manual
|
|
|
|
tags:
|
|
|
|
- deploy
|