-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
62 lines (57 loc) · 1.73 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
stages:
- test
- build
- deploy
Docker build stage:
stage: build
image: docker:stable
services:
- docker:dind
script:
- cp ${ENV_STAGE} ./configs/.env
- cp ${CHROME_SETTINGS} ./configs/chrome/chrome.json
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- echo "Build widgets"
- docker build -t ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}-registration:stage -f ./build/package/production/Dockerfile .
- echo "Push widgets"
- docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}-registration:stage
tags:
- invest-docker
only:
- stage
Deploy to stage:
stage: deploy
script:
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- cd ~/investments-stage
- docker-compose pull
- docker-compose up -d --force-recreat
tags:
- invest-stage-shell
only:
- stage
Docker build prod:
stage: build
image: docker:stable
services:
- docker:dind
script:
- cp ${ENV_PROD} .env
- cp ${CHROME_SETTINGS} ./configs/chrome/chrome.json
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- echo "Build widgets"
- docker build -t ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}-registration:prod -f ./build/package/production/Dockerfile .
- echo "Push widgets"
- docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}-registration:prod
tags:
- invest-docker
only:
- master
Deploy to prod:
stage: deploy
script:
- ssh prod "docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY} && cd /home/gitlab-runner/investments-prod && docker-compose pull && docker-compose up -d --force-recreat"
tags:
- invest-stage-shell
only:
- master