-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
92 lines (87 loc) · 2.37 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
stages:
- publish builder
- publish to gitlab registry normal
- publish to gitlab registry dev
variables:
REGISTRY: "registry.gitlab.com/cyberos/infrastructure"
.docker-login: &docker-login
variables:
GIT_STRATEGY: clone
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
image: docker:stable
except:
- schedules
services:
- docker:dind
before_script:
- echo "${GITLAB_PASS}" | docker login registry.gitlab.com -u "${GITLAB_USER}" --password-stdin
publish-nomral:
stage: publish to gitlab registry normal
image: docker:stable
variables:
GIT_STRATEGY: clone
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
only:
refs:
- master
- develop
services:
- docker:dind
except:
- schedules
<<: *docker-login
script:
- docker build -f Docker/Dockerfile -t haya --build-arg registry=${REGISTRY} .
- docker tag haya ${REGISTRY}/haya:${CI_COMMIT_SHA:0:8}
- docker tag haya ${REGISTRY}/haya:${CI_COMMIT_REF_NAME}-latest
- docker tag haya ${REGISTRY}/haya:latest
- docker push ${REGISTRY}/haya
publish-dev:
stage: publish to gitlab registry dev
image: docker:stable
variables:
GIT_STRATEGY: clone
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
only:
refs:
- master
- develop
services:
- docker:dind
except:
- schedules
<<: *docker-login
script:
- docker build -f Docker/dev/Dockerfile -t haya-dev --build-arg registry=${REGISTRY} .
- docker tag haya-dev ${REGISTRY}/haya-dev:${CI_COMMIT_SHA:0:8}
- docker tag haya-dev ${REGISTRY}/haya-dev:${CI_COMMIT_REF_NAME}-latest
- docker tag haya-dev ${REGISTRY}/haya-dev:latest
- docker push ${REGISTRY}/haya-dev
publish-builder:
stage: publish builder
image: docker:stable
variables:
GIT_STRATEGY: clone
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
only:
refs:
- develop
- master
changes:
- Docker/builder/Dockerfile
services:
- docker:dind
except:
- schedules
<<: *docker-login
script:
- cd Docker/builder
- docker build -t haya-builder .
- docker tag haya-builder ${REGISTRY}/haya-builder:${CI_COMMIT_SHA:0:8}
- docker tag haya-builder ${REGISTRY}/haya-builder:${CI_COMMIT_REF_NAME}-latest
- docker tag haya-builder ${REGISTRY}/haya-builder:latest
- docker push ${REGISTRY}/haya-builder