-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
177 lines (157 loc) · 2.81 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
include:
- local: /config/gitlab/ci-tools.yml
- local: /config/gitlab/ci-rules.yml
stages:
- build
- image
- publish
- status-post
# build jobs
build-cli:
stage: build
extends:
- .build-node
script:
- make ci
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-bundle:
stage: build
extends:
- .build-node
script:
- make bundle
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-cli-branch:
stage: image
extends: [.build-docker]
needs:
- build-cli
except:
- tags
script:
- ./scripts/docker-build.sh --push
variables:
IMAGE_ARCH: cli
build-image-cli-tag:
stage: image
extends:
- .build-docker
needs:
- build-cli
only:
- tags
script:
- ./scripts/docker-build.sh --push
variables:
IMAGE_ARCH: cli
build-image-server-branch:
stage: image
extends: [.build-docker]
needs:
- build-bundle
except:
- tags
script:
- ./scripts/docker-build.sh --push
variables:
IMAGE_ARCH: server
build-image-server-tag:
stage: image
extends:
- .build-docker
needs:
- build-bundle
only:
- tags
script:
- ./scripts/docker-build.sh --push
variables:
IMAGE_ARCH: server
# publish jobs
publish-npm:
stage: publish
extends:
- .build-node
- .deploy-tags
needs:
- build-cli
script:
- npm publish
# commit status
climate-success:
stage: status-post
extends:
- .build-climate
needs:
- build-bundle
- build-cli
script:
- make upload-climate
github-pending:
stage: build
extends:
- .build-curl
script:
- ./scripts/github-status.sh pending
github-failure:
stage: status-post
extends:
- .build-curl
needs:
- build-bundle
- build-cli
when: on_failure
script:
- ./scripts/github-status.sh failure
github-success:
stage: status-post
extends:
- .build-curl
needs:
- build-bundle
- build-cli
when: on_success
script:
- ./scripts/github-status.sh success
sonar-success:
stage: status-post
extends:
- .build-sonar
needs:
- build-bundle
- build-cli
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