-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (52 loc) · 1.31 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
image: docker:19.03.12
services:
- docker:19.03.12-dind
stages:
- build
- test
- release
variables:
CONTAINER_CLIENT_IMAGE: ${CI_REGISTRY_IMAGE}/client:latest
CONTAINER_SERVER_IMAGE: ${CI_REGISTRY_IMAGE}/server:latest
CONTAINER_CLIENT_RELEASE_IMAGE: ${CI_REGISTRY_IMAGE}/client:$VERSION
CONTAINER_SERVER_RELEASE_IMAGE: ${CI_REGISTRY_IMAGE}/server:$VERSION
before_script:
- docker login -u $CI_REGISTRY_USER -p $TOKEN $CI_REGISTRY
build_client:
stage: build
script:
- docker build --pull -t $CONTAINER_CLIENT_IMAGE ./client
- docker push $CONTAINER_CLIENT_IMAGE
only:
- master
build_server:
stage: build
script:
- docker build --pull -t $CONTAINER_SERVER_IMAGE ./server
- docker push $CONTAINER_SERVER_IMAGE
only:
- master
test:
stage: test
script:
- echo "Test ok!"
only:
- master
release_client:
stage: release
script:
- docker pull $CONTAINER_CLIENT_IMAGE
- docker tag $CONTAINER_CLIENT_IMAGE $CONTAINER_CLIENT_RELEASE_IMAGE
- docker push $CONTAINER_CLIENT_RELEASE_IMAGE
only:
- master
when: manual
release_server:
stage: release
script:
- docker pull $CONTAINER_SERVER_IMAGE
- docker tag $CONTAINER_SERVER_IMAGE $CONTAINER_SERVER_RELEASE_IMAGE
- docker push $CONTAINER_SERVER_RELEASE_IMAGE
only:
- master
when: manual