-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
47 lines (43 loc) · 967 Bytes
/
.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
stages:
- test
- build
- deploy
eslint:
stage: test
image: node:latest
before_script:
- npm install
script:
- npm run lint
build_master:
stage: build
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --cache-from "$CI_REGISTRY_IMAGE:latest" --pull -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- master
environment:
name: production
url: https://bouncer.amiv.ethz.ch
# On branches except master: verify that build works, do not push to registry
build:
stage: build
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
script:
- docker build --cache-from "$CI_REGISTRY_IMAGE:latest" --pull .
except:
- master
deploy:
stage: deploy
image: amiveth/service-update-helper
script:
- /update.py
only:
- master