forked from dbfun/docker.mailbrocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
51 lines (45 loc) · 1.34 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
stages:
- build
- deploy
build dns:
stage: build
tags:
- docker-image-builder
script:
- docker build . -f ./docker/dns/Dockerfile -t mailbroker_dns:${CI_COMMIT_SHA} -t mailbroker_dns:latest
build exim:
stage: build
tags:
- docker-image-builder
script:
- docker build . -f ./docker/exim/Dockerfile -t mailbroker_exim:${CI_COMMIT_SHA} -t mailbroker_exim:latest
build spamassassin:
stage: build
tags:
- docker-image-builder
script:
- docker build . -f ./docker/spamassassin/Dockerfile -t mailbroker_spamassassin:${CI_COMMIT_SHA} -t mailbroker_spamassassin:latest
build api:
stage: build
tags:
- docker-image-builder
script:
- docker build . -f ./docker/api/Dockerfile --target production -t mailbroker_api:${CI_COMMIT_SHA} -t mailbroker_api:latest
deploy from docker-compose.deploy.yml:
stage: deploy
tags:
- deploy
script:
- DEPLOY_DIR=~/deploy-from-dc/mailbroker
- DEPLOY_FILE=${DEPLOY_DIR}/docker-compose.yml
- mkdir -p ${DEPLOY_DIR}
- cp docker-compose.deploy.yml ${DEPLOY_FILE}
- docker-compose -f ${DEPLOY_FILE} up -d dns exim spamassassin mongo api rabbitmq
reload Caddy:
stage: deploy
when: manual
tags:
- deploy
script:
- echo -e "$API_DOMAIN {\n reverse_proxy :$API_PORT\n}" | sudo tee /etc/caddy/sites-enabled/mailbroker.ru
- sudo service caddy reload