Skip to content

Commit 538011b

Browse files
author
Khanh Nguyen
committed
Updated gitlabci
1 parent a315cf1 commit 538011b

File tree

2 files changed

+24
-38
lines changed

2 files changed

+24
-38
lines changed

.gitlab-ci.yml

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,49 @@ stages:
44
- deploy
55
- mirror
66

7+
cache:
8+
key: elastalert
9+
paths:
10+
- node_modules/
11+
policy: pull
12+
713
build:
8-
image: node
14+
image: node:slim
915
stage: build
10-
script:
11-
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
12-
- npm install
13-
- npm run build
14-
artifacts:
16+
cache:
17+
key: elastalert
1518
paths:
16-
- lib/
1719
- node_modules/
20+
policy: push
21+
script:
22+
- npm i -q
23+
- npm run build
1824

1925
test:
20-
image: node
26+
image: node:slim
2127
stage: test
2228
script:
23-
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
24-
- npm install
29+
- npm i -q
2530
- npm test
26-
artifacts:
27-
paths:
28-
- lib/
29-
- node_modules/
3031

3132
lint:
32-
image: node
33+
image: node:slim
34+
allow_failure: true
3335
stage: test
3436
script:
35-
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
36-
- npm install
37+
- npm i -q
3738
- ./node_modules/.bin/eslint .
38-
allow_failure: true
3939

4040
deploy:npm:
41-
image: node
41+
image: node:slim
4242
stage: deploy
4343
script:
44-
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
45-
- npm install
4644
- scripts/update-authors.sh
4745
- npm publish --access public
4846
only:
4947
- tags
50-
artifacts:
51-
paths:
52-
- lib/
5348

5449
deploy:docker:
55-
tags:
56-
- docker
5750
stage: deploy
5851
script:
5952
- docker info
@@ -63,35 +56,27 @@ deploy:docker:
6356
- docker tag elastalert artifacts.bitsensor.io:1443/elastalert:$(git describe --abbrev=0)
6457
- docker push artifacts.bitsensor.io:1443/elastalert:latest
6558
- docker push artifacts.bitsensor.io:1443/elastalert:$(git describe --abbrev=0)
66-
artifacts:
67-
paths:
68-
- lib/
69-
- node_modules/
7059
only:
7160
- tags
72-
73-
deploy:docker:snapshot:
7461
tags:
7562
- docker
63+
64+
deploy:docker:snapshot:
7665
stage: deploy
7766
script:
7867
- docker info
7968
- docker login -u $BITSENSOR_USERNAME -p $BITSENSOR_PASSWORD artifacts.bitsensor.io:1443
8069
- docker build -t elastalert .
8170
- docker tag elastalert artifacts.bitsensor.io:1443/elastalert:snapshot
8271
- docker push artifacts.bitsensor.io:1443/elastalert:snapshot
83-
artifacts:
84-
paths:
85-
- lib/
86-
- node_modules/
8772
only:
8873
- develop
74+
tags:
75+
- docker
8976

9077
mirror:github:
91-
image: debian
9278
stage: mirror
9379
script:
94-
- apt-get update && apt-get install -y git
9580
- git clone --mirror https://git.bitsensor.io/back-end/elastalert.git mirror-github
9681
- cd mirror-github
9782
- git remote add github https://$MIRROR_GITHUB_USER:$MIRROR_GITHUB_PASSWORD@$MIRROR_GITHUB_URL

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=$NPM_TOKEN

0 commit comments

Comments
 (0)