forked from bitsensor/elastalert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
99 lines (92 loc) · 2.2 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
stages:
- build
- test
- deploy
- mirror
build:
image: node
stage: build
script:
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- npm install
- npm run build
artifacts:
paths:
- lib/
- node_modules/
test:
image: node
stage: test
script:
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- npm install
- npm test
artifacts:
paths:
- lib/
- node_modules/
lint:
image: node
stage: test
script:
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- npm install
- ./node_modules/.bin/eslint .
allow_failure: true
deploy:npm:
image: node
stage: deploy
script:
- npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- npm install
- scripts/update-authors.sh
- npm publish --access public
only:
- tags
artifacts:
paths:
- lib/
deploy:docker:
tags:
- docker
stage: deploy
script:
- docker info
- docker login -u $BITSENSOR_USERNAME -p $BITSENSOR_PASSWORD docker.bitsensor.io
- docker build -t elastalert .
- docker tag elastalert docker.bitsensor.io/elastalert:latest
- docker tag elastalert docker.bitsensor.io/elastalert:$(git describe --abbrev=0)
- docker push docker.bitsensor.io/elastalert:latest
- docker push docker.bitsensor.io/elastalert:$(git describe --abbrev=0)
artifacts:
paths:
- lib/
- node_modules/
only:
- tags
deploy:docker:snapshot:
tags:
- docker
stage: deploy
script:
- docker info
- docker login -u $BITSENSOR_USERNAME -p $BITSENSOR_PASSWORD docker.bitsensor.io
- docker build -t elastalert .
- docker tag elastalert docker.bitsensor.io/elastalert:snapshot
- docker push docker.bitsensor.io/elastalert:snapshot
artifacts:
paths:
- lib/
- node_modules/
only:
- develop
mirror:github:
image: debian
stage: mirror
script:
- apt-get update && apt-get install -y git
- git clone --mirror https://git.bitsensor.io/back-end/elastalert.git mirror-github
- cd mirror-github
- git remote add github https://$MIRROR_GITHUB_USER:$MIRROR_GITHUB_PASSWORD@$MIRROR_GITHUB_URL
- git push -u github -q --mirror
when: always