-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
50 lines (41 loc) · 1.03 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
variables:
REF_NAME: $CI_COMMIT_REF_NAME
IMAGE_VERSION: $CI_COMMIT_REF_NAME-$CI_COMMIT_SHA
stages:
- build
- test
- deploy
- cleanup
### Builds ###
build:web:
stage: build
script:
- docker login -u $CI_JOB_USER -p $CI_JOB_TOKEN registry.hub.docker.com
- make build-web push-web
tags: [ io, docker-engine-v17.05 ]
build:app:
stage: build
script:
- docker login -u $CI_JOB_USER -p $CI_JOB_TOKEN registry.hub.docker.com
- make build-app push-app
tags: [ io, docker-engine-v17.05 ]
build:latest:
stage: build
only: [ master ]
script:
- docker login -u $CI_JOB_USER -p $CI_JOB_TOKEN registry.hub.docker.com
- IMAGE_VERSION=latest make build push
tags: [ io, docker-engine-v17.05 ]
### Tests
.test_job: &test_template
stage: test
variables:
COMPOSE_PROJECT_NAME: test-$CI_JOB_ID-$CI_COMMIT_SHA
before_script:
- make up
after_script:
- make down &> /dev/null
tags: [ io, docker-engine-v17.05 ]
except: [ /^.*-perf$/, tags ]
# ================= Deploy =================
### Cleanup