Skip to content

Commit 6674178

Browse files
author
Khanh Nguyen
committed
Updated gitlab ci
1 parent c508e94 commit 6674178

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

.gitlab-ci.yml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# Cache template
2+
.default-cache: &default-cache
3+
key: elastalert
4+
paths:
5+
- node_modules
6+
7+
.push-cache: &push-cache
8+
cache:
9+
<<: *default-cache
10+
policy: push
11+
12+
.pull-cache: &pull-cache
13+
cache:
14+
<<: *default-cache
15+
policy: pull
16+
17+
.node_test: &node-test
18+
<<: *pull-cache
19+
image: node:slim
20+
stage: test
21+
122
stages:
223
- build
324
- test
@@ -11,36 +32,30 @@ cache:
1132
policy: pull
1233

1334
build:
35+
<<: *push-cache
1436
image: node:slim
1537
stage: build
16-
cache:
17-
key: elastalert
18-
paths:
19-
- node_modules/
20-
policy: push
2138
script:
22-
- npm i -q
39+
- npm install --quiet
2340
- npm run build
2441

2542
test:
26-
image: node:slim
27-
stage: test
43+
<<: *node-test
2844
script:
29-
- npm i -q
45+
- npm install --quiet
3046
- npm test
3147

3248
lint:
33-
image: node:slim
34-
allow_failure: true
35-
stage: test
49+
<<: *node-test
3650
script:
37-
- npm i -q
51+
- npm install --quiet
3852
- ./node_modules/.bin/eslint .
3953

4054
deploy:npm:
4155
image: node:slim
4256
stage: deploy
4357
script:
58+
- npm install --quiet
4459
- scripts/update-authors.sh
4560
- npm publish --access public
4661
only:
@@ -82,3 +97,6 @@ mirror:github:
8297
- git remote add github https://$MIRROR_GITHUB_USER:$MIRROR_GITHUB_PASSWORD@$MIRROR_GITHUB_URL
8398
- git push -u github -q --mirror
8499
when: always
100+
only:
101+
- tags
102+
- develop

0 commit comments

Comments
 (0)