-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
95 lines (87 loc) · 2.65 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
image: docker:19.03.1
variables:
STG_APP_NAME: telesoft-psad-dashboard
STG_URL: https://dashboard.telesoftmobile.com
RELEASE_APP_NAME: telesoft-psad-dashboard-release
RELEASE_URL: https://dashboard-stable.telesoftmobile.com
PROD_URL: https://dashboard.eastonmd.gov
PROD_APP_1_NAME: telesoft-psad-dashboard-1
PROD_APP_2_NAME: telesoft-psad-dashboard-2
before_script:
- docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
stg_image_build:
environment:
name: staging
url: ${STG_URL}
stage: build
script: |-
apk add git curl
git -C /tmp clone https://${token_username}:${deployed_token}@gitlab.telesoftmobile.com/devops/psad.git
cp /tmp/psad/dashboard/conf/stg/.env.js ./src
docker build -t telesoftdevops/devops:telesoft-psad-dashboard-stg .
docker push telesoftdevops/devops:telesoft-psad-dashboard-stg
only:
- stg
stg_image_deploy:
environment:
name: staging
url: ${STG_URL}
stage: deploy
script:
- apk add curl
- echo "Deploy Image"
- curl -X PUT "http:/172.26.16.220:8088/deployments/amount/psad_dashboard/stg"
- sh ci/stg-deploy.sh ${STG_APP_NAME}
only:
- stg
release_image_build:
environment:
name: release
url: ${RELEASE_URL}
stage: build
script: |-
apk add git curl
git -C /tmp clone https://${token_username}:${deployed_token}@gitlab.telesoftmobile.com/devops/psad.git
cp /tmp/psad/dashboard/conf/release/.env.js ./src
docker build -t telesoftdevops/devops:telesoft-psad-dashboard-release .
docker push telesoftdevops/devops:telesoft-psad-dashboard-release
only:
- release
release_image_deploy:
environment:
name: release
url: ${RELEASE_URL}
stage: deploy
script:
- apk add curl
- echo "Deploy Image"
- curl -X PUT "http:/172.26.16.220:8088/deployments/amount/psad_dashboard/release"
- sh ci/release-deploy.sh ${RELEASE_APP_NAME}
only:
- release
prod_image_build:
environment:
name: prod
url: ${PROD_URL}
stage: build
script:
apk add git curl
git -C /tmp clone https://${token_username}:${deployed_token}@gitlab.telesoftmobile.com/devops/psad.git
cp /tmp/psad/dashboard/conf/prod/.env.js ./src
docker build -t telesoftdevops/devops:telesoft-psad-dashboard-prod .
docker push telesoftdevops/devops:telesoft-psad-dashboard-prod
only:
- master
prod_image_deploy:
environment:
name: prod
url: ${PROD_URL}
stage: deploy
script:
- echo "Deploy iamge to PROD"
- curl -X PUT "http:/146.177.0.220:8088/deployments/amount/psad_dashboard/master"
- sudo ci/prod-deploy.sh ${PROD_APP_1_NAME} ${PROD_APP_2_NAME}
only:
- master
tags:
- prod-shell