-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
148 lines (128 loc) · 2.43 KB
/
.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
include:
- local: /.gitlab/ci-tools.yml
- local: /.gitlab/ci-rules.yml
stages:
- status-pre
- build
- image
- publish
- status-post
# build jobs
build-node:
stage: build
extends:
- .build-node
script:
- make ci-full
artifacts:
when: always
expire_in: 1 day
paths:
- out/
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull-push
paths:
- node_modules/
- out/api
- out/cache
- out/tmp
build-image-alpine-branch:
extends:
- .build-docker
stage: image
except:
- tags
script:
- ./scripts/docker-build.sh --push --default
variables:
IMAGE_ARCH: alpine
build-image-alpine-tag:
extends:
- .build-docker
stage: image
only:
- tags
script:
- ./scripts/docker-build.sh --push --default
variables:
IMAGE_ARCH: alpine
build-image-stretch-branch:
stage: image
extends: [.build-docker]
except:
- tags
script:
- ./scripts/docker-build.sh --push
variables:
IMAGE_ARCH: stretch
build-image-stretch-tag:
stage: image
extends:
- .build-docker
only:
- tags
script:
- ./scripts/docker-build.sh --push
variables:
IMAGE_ARCH: stretch
# publish jobs
publish-npm:
stage: publish
extends:
- .build-node
- .deploy-tags
dependencies:
- build-node
script:
- npm publish
# commit status
climate-pending:
stage: status-pre
extends:
- .build-climate
script:
- cc-test-reporter before-build
climate-success:
stage: status-post
extends:
- .build-climate
dependencies:
- build-node
script:
- make upload-climate
github-pending:
stage: status-pre
extends:
- .build-curl
script:
- ./scripts/github-status.sh pending
github-failure:
stage: status-post
extends:
- .build-curl
when: on_failure
script:
- ./scripts/github-status.sh failure
github-success:
stage: status-post
extends:
- .build-curl
when: on_success
script:
- ./scripts/github-status.sh success
sonar-success:
stage: status-post
extends:
- .build-sonar
when: on_success
script:
- make node_modules
- sonar-scanner
-Dsonar.projectKey=ssube_salty-dog
-Dsonar.projectVersion=${CI_COMMIT_REF_SLUG}
-Dsonar.organization=ssube-github
-Dsonar.sources=src/,test/
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=${SONAR_SECRET}
-Dsonar.typescript.lcov.reportPaths=out/coverage/lcov.info