forked from Cimpress-MCP/gitlab-continuous-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
belt-node12-service.gitlab-ci.yml
77 lines (70 loc) · 2.09 KB
/
belt-node12-service.gitlab-ci.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
image: node:12
before_script:
- echo "@cimpress-technology:registry=https://artifactory.cimpress.io/artifactory/api/npm/npm-release-local/" > ~/.npmrc
- echo "//artifactory.cimpress.io/artifactory/api/npm/npm-release-local/:_authToken=${CT_ARTIFACTORY_NPM_TOKEN}" >> ~/.npmrc
- npm i -g grunt
- npm ci
- export VERSION=${CI_COMMIT_SHA:0:7}
stages:
- build
- publish
- deploy
build:
stage: build
script:
- npm test
coverage: '/All files\s*\|\s*[.?\d]+\s*\|\s*([0-9.]+)/'
artifacts:
paths:
- coverage/
dependency_scanning:
image: cimpressorders/docker-node:12
stage: build
allow_failure: true
variables:
# NOTE: Breaking change introduced in v11.11 of the runner, using this
# feature flag makes newest versions behave like versions prior v11.11
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4306#note_177127898
# Orders' runner use v12.3.0 whereas FI' runner use v11.0.0
FF_USE_LEGACY_VOLUMES_MOUNTING_ORDER: "true"
services:
- docker:18.09.7-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
artifacts:
paths: [gl-dependency-scanning-report.json]
publish:
image: cimpressorders/docker-node:12
stage: publish
script:
- grunt bundle --packageVersion=$VERSION --packageName=$CI_PROJECT_NAME
only:
- master
except:
- schedules
deploy-int:
stage: deploy
environment:
name: integration
script:
- grunt deploy --environment=int --packageVersion=$VERSION --packageName=$CI_PROJECT_NAME
only:
- master
except:
- schedules
deploy-prd:
stage: deploy
environment:
name: production
script:
- grunt deploy --environment=prd --packageVersion=$VERSION --packageName=$CI_PROJECT_NAME
when: manual
only:
- master
except:
- schedules