Files
hubl/.gitlab-ci.yml

157 lines
2.6 KiB
YAML
Raw Normal View History

2020-05-19 13:13:30 +00:00
# workflow
stages:
2020-05-19 13:13:30 +00:00
- build
- test
- integration
- acceptance
2020-04-03 20:02:49 +02:00
- release
2021-04-13 18:52:27 +02:00
- deploy
2020-05-19 13:13:30 +00:00
# default image for jobs
default:
2021-02-23 22:05:20 +01:00
image: node:14
2020-05-19 13:13:30 +00:00
# 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 16:04:20 +01:00
except:
- tags
2021-04-13 18:41:29 +02:00
- feature/ansible
2020-05-19 13:13:30 +00:00
tags:
- test
## TESTING ##
2020-05-19 13:13:30 +00:00
test:e2e:
stage: test
2021-07-05 18:56:14 +02:00
image: cypress/included:7.6.0
2020-05-19 13:13:30 +00:00
services:
2021-02-24 11:36:41 +01:00
- name: ${CI_REGISTRY_IMAGE}/djangoldp:latest
2020-05-19 13:13:30 +00:00
before_script:
# install missing dependencies
- npm install -g sirv-cli
- 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 16:04:20 +01:00
except:
- tags
2021-04-13 18:41:29 +02:00
- feature/ansible
2020-05-19 13:13:30 +00:00
tags:
- test
## VALIDATION ##
2021-01-14 13:34:33 +01:00
include:
project: infra/gitlab
ref: master
file: templates/deploy.ci.yml
2020-03-19 13:44:10 +01:00
test1:
2021-01-14 13:34:33 +01:00
extends: .ansible
stage: integration
environment:
2021-04-13 18:41:29 +02:00
name: dev/test1
url: https://test1.startinblox.com
2021-04-13 18:41:29 +02:00
variables:
ANSIBLE_INVENTORY: inventory/dev/
only:
2020-03-16 10:50:07 +01:00
- /^feature\/.*/
when: manual
2020-03-19 13:44:10 +01:00
test2:
extends: .ansible
stage: integration
environment:
2021-04-13 18:41:29 +02:00
name: dev/test2
url: https://test2.startinblox.com
2021-04-13 18:41:29 +02:00
variables:
ANSIBLE_INVENTORY: inventory/dev
only:
2020-03-16 10:51:57 +01:00
- /^feature\/.*/
when: manual
2020-03-19 13:44:10 +01:00
test3:
extends: .ansible
stage: integration
environment:
2021-04-13 18:41:29 +02:00
name: dev/test3
url: https://test3.startinblox.com
2021-04-13 18:41:29 +02:00
variables:
ANSIBLE_INVENTORY: inventory/dev
only:
2020-03-16 10:51:57 +01:00
- /^feature\/.*/
when: manual
2020-03-19 13:44:10 +01:00
stg1:
extends: .ansible
stage: acceptance
environment:
2021-04-13 18:41:29 +02:00
name: review/stg1
url: https://stg1.startinblox.com
2021-04-13 18:41:29 +02:00
variables:
ANSIBLE_INVENTORY: inventory/stg
only:
- /^release\/.*/
when: manual
2020-03-19 13:44:10 +01:00
stg2:
extends: .ansible
stage: acceptance
environment:
2021-04-13 18:41:29 +02:00
name: review/stg2
url: https://stg2.startinblox.com
2021-04-13 18:41:29 +02:00
variables:
ANSIBLE_INVENTORY: inventory/stg
only:
- /^release\/.*/
when: manual
2020-04-03 20:02:49 +02:00
## RELEASE TAGGING ##
publish:
stage: release
2021-02-21 16:31:46 +01:00
image: ${CI_REGISTRY}/infra/docker/jsrelease:latest
2020-04-03 20:02:49 +02:00
script:
- semantic-release
only:
- master
tags:
- deploy
## LIVE DEPLOYMENTS ##
2021-01-29 15:12:55 +01:00
hublworld:
extends: .ansible
2021-04-13 18:52:27 +02:00
variables:
ANSIBLE_INVENTORY: inventory/prd
only:
- master
when: manual
hublunderworld:
extends: .ansible
2021-04-13 18:41:29 +02:00
variables:
ANSIBLE_INVENTORY: inventory/prd
2021-02-21 17:28:17 +01:00
only:
- master
2020-09-08 10:11:55 +00:00
when: manual