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
|
|
|
|
script:
|
|
|
|
- cp config.sample.json config.json
|
|
|
|
- npm run build
|
|
|
|
artifacts:
|
|
|
|
when: on_success
|
|
|
|
expire_in: 1 day
|
|
|
|
paths:
|
|
|
|
- dist/
|
2021-01-29 15:04:20 +00:00
|
|
|
except:
|
|
|
|
- tags
|
2020-05-19 13:13:30 +00:00
|
|
|
tags:
|
|
|
|
- test
|
|
|
|
|
2020-01-14 20:36:26 +00:00
|
|
|
## TESTING ##
|
|
|
|
|
2020-05-19 13:13:30 +00:00
|
|
|
test:e2e:
|
|
|
|
stage: test
|
2020-11-26 22:33:47 +00:00
|
|
|
image: cypress/included:5.6.0
|
2020-05-19 13:13:30 +00:00
|
|
|
services:
|
|
|
|
- name: ${CI_REGISTRY_IMAGE}/server:0.1
|
|
|
|
before_script:
|
|
|
|
# install missing dependencies
|
|
|
|
- npm install -g sirv-cli
|
2020-07-16 14:07:25 +00:00
|
|
|
- npm install cypress-localstorage-commands
|
2020-05-19 13:13:30 +00:00
|
|
|
# making sure the process is orphan
|
|
|
|
- sirv dist --port 3000 > /dev/null 2>&1 &
|
|
|
|
script:
|
|
|
|
- cypress run -e CYPRESS_baseUrl=http://localhost:3000
|
2021-01-29 15:04:20 +00:00
|
|
|
except:
|
|
|
|
- tags
|
2020-05-19 13:13:30 +00:00
|
|
|
tags:
|
|
|
|
- test
|
|
|
|
|
2020-01-14 20:36:26 +00:00
|
|
|
## VALIDATION ##
|
|
|
|
|
2021-01-14 12:34:33 +00:00
|
|
|
include:
|
|
|
|
project: infra/gitlab
|
|
|
|
ref: master
|
|
|
|
file: templates/deploy.ci.yml
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
test1:
|
2021-01-14 12:34:33 +00:00
|
|
|
extends: .ansible
|
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-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
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
test2:
|
2021-01-14 14:29:40 +00:00
|
|
|
extends: .ansible
|
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-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
|
2020-03-15 16:11:16 +00:00
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
test3:
|
2021-01-14 14:29:40 +00:00
|
|
|
extends: .ansible
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: integration
|
|
|
|
environment:
|
|
|
|
name: test3
|
|
|
|
url: https://test3.startinblox.com
|
|
|
|
only:
|
2020-03-16 09:51:57 +00:00
|
|
|
- /^feature\/.*/
|
2020-03-15 16:11:16 +00:00
|
|
|
when: manual
|
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
stg1:
|
2021-01-14 14:29:40 +00:00
|
|
|
extends: .ansible
|
2020-03-15 16:11:16 +00:00
|
|
|
stage: acceptance
|
|
|
|
environment:
|
|
|
|
name: stg1
|
|
|
|
url: https://stg1.startinblox.com
|
|
|
|
only:
|
2020-03-16 15:12:58 +00:00
|
|
|
- /^release\/.*/
|
|
|
|
when: manual
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2020-03-19 12:44:10 +00:00
|
|
|
stg2:
|
2021-01-14 14:29:40 +00:00
|
|
|
extends: .ansible
|
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-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
|
|
|
|
2020-04-03 18:02:49 +00:00
|
|
|
## RELEASE TAGGING ##
|
|
|
|
|
|
|
|
publish:
|
|
|
|
stage: release
|
|
|
|
script:
|
2020-12-09 12:55:57 +00:00
|
|
|
- npm install -g semantic-release@v17 @semantic-release/gitlab@v6.0.5
|
2020-04-03 18:02:49 +00:00
|
|
|
- semantic-release
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- deploy
|
|
|
|
|
2020-03-15 16:11:16 +00:00
|
|
|
## LIVE DEPLOYMENTS ##
|
2020-01-14 20:36:26 +00:00
|
|
|
|
2021-01-29 14:12:55 +00:00
|
|
|
hublworld:
|
2021-01-24 13:56:15 +00:00
|
|
|
extends: .ansible
|
2020-09-08 10:11:55 +00:00
|
|
|
when: manual
|
|
|
|
|
2021-01-29 14:12:55 +00:00
|
|
|
happydev:
|
2021-01-24 13:56:15 +00:00
|
|
|
extends: .ansible
|
2020-12-07 19:13:13 +00:00
|
|
|
when: manual
|