-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.gitlab-ci.yml
157 lines (143 loc) · 4.04 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
image: docker:1.12
services:
- docker:1.12-dind
stages:
- test
- release
- deploy
variables:
IMAGE_NAME: nib0r/docker-flow-proxy-letsencrypt
GITLAB_IMAGE_NAME: docker.nibor.me/robin/docker-flow-proxy-letsencrypt
functional_tests_manual:
stage: test
variables:
DOCKER_CERT_PATH: ${_DOCKER_CERT_PATH}
DOCKER_HOST: ${_DOCKER_HOST}
DOCKER_MACHINE_NAME: ${_DOCKER_MACHINE_NAME}
DOCKER_TLS_VERIFY: ${_DOCKER_TLS_VERIFY}
script:
- pip install -r requirements-test.txt --upgrade
- pytest tests.py
tags:
- shell
- ks2.nibor.me
when: manual
only:
- /^feature-.*$/
functional_tests:
stage: test
variables:
DOCKER_CERT_PATH: ${_DOCKER_CERT_PATH}
DOCKER_HOST: ${_DOCKER_HOST}
DOCKER_MACHINE_NAME: ${_DOCKER_MACHINE_NAME}
DOCKER_TLS_VERIFY: ${_DOCKER_TLS_VERIFY}
script:
- pip install -r requirements-test.txt --upgrade
- pytest tests.py
tags:
- shell
- ks2.nibor.me
only:
- develop
- master
- tags
test:
stage: test
script:
- pip install -r requirements-test.txt --upgrade
- pytest app/client_dfple_tests.py
- pytest app/client_certbot_tests.py
tags:
- shell
- ks2.nibor.me
only:
- develop
- /^feature-.*$/
- /^release-.*$/
- master
- tags
release:
stage: release
script:
- docker build -t $IMAGE_NAME:latest .
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker push $IMAGE_NAME:latest
tags:
- docker
- ks2.nibor.me
only:
- master
release_gitlab:
stage: release
script:
- docker build -t $GITLAB_IMAGE_NAME:${CI_BUILD_REF_NAME} .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.nibor.me
- docker push $GITLAB_IMAGE_NAME:${CI_BUILD_REF_NAME}
tags:
- docker
- ks2.nibor.me
release_develop:
stage: release
script:
- docker build -t $IMAGE_NAME:${CI_BUILD_REF_NAME} .
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker push $IMAGE_NAME:${CI_BUILD_REF_NAME}
tags:
- docker
- ks2.nibor.me
only:
- develop
release_tags:
stage: release
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker build -t ${IMAGE_NAME}:${CI_BUILD_TAG} .
- docker push ${IMAGE_NAME}:$CI_BUILD_TAG
only:
- tags
tags:
- ks2.nibor.me
release_docs:
stage: release
script:
- docker build -f Dockerfile.docs -t nib0r/docker-flow-proxy-letsencrypt-docs:${CI_BUILD_REF_NAME} .
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker push nib0r/docker-flow-proxy-letsencrypt-docs:${CI_BUILD_REF_NAME}
tags:
- shell
- ks2.nibor.me
only:
- develop
release_docs_master:
stage: release
script:
- docker build -f Dockerfile.docs -t nib0r/docker-flow-proxy-letsencrypt-docs:${CI_BUILD_REF_NAME} .
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker push nib0r/docker-flow-proxy-letsencrypt-docs:${CI_BUILD_REF_NAME}
- curl -X POST "https://jenkins.dockerflow.com/job/n1b0r/job/docker-flow-proxy-letsencrypt/buildWithParameters?token=n1b0r&tag=${CI_BUILD_REF_NAME}"
tags:
- shell
- ks2.nibor.me
only:
- master
docs_tags:
stage: release
script:
- docker build -f Dockerfile.docs -t nib0r/docker-flow-proxy-letsencrypt-docs:${CI_BUILD_TAG} .
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker push nib0r/docker-flow-proxy-letsencrypt-docs:${CI_BUILD_TAG}
tags:
- shell
- ks2.nibor.me
only:
- tags
docs:
stage: deploy
script:
- docker service rm docker-flow-proxy-letsencrypt-docs || true
- docker service create --name docker-flow-proxy-letsencrypt-docs --network proxy --label com.df.notify=true --label com.df.distribute=true --label com.df.serviceDomain=dfple-docs.ks2.nibor.me --label com.df.servicePath=/ --label com.df.srcPort=443 --label com.df.port=80 --label com.df.letsencrypt.host=dfple-docs.ks2.nibor.me --label [email protected] nib0r/docker-flow-proxy-letsencrypt-docs:master
tags:
- shell
- ks2.nibor.me
only:
- master