forked from thoughtworks/build-your-own-radar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
47 lines (42 loc) · 1.07 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
variables:
WORKSPACE_DEV: /w/techradar
WORKSPACE_PROD: /w/techradar-prod
stages:
- update
- deploy
update_local_repo_dev:
stage: update
only:
- master
script:
- ssh-agent bash -c 'ssh-add $WORKSPACE_DEV/deploy.key; cd $WORKSPACE_DEV/website; git pull'
tags:
- dip-shell-runner
update_local_repo_prod:
stage: update
only:
- tags
script:
- ssh-agent bash -c 'ssh-add $WORKSPACE_PROD/deploy.key; cd $WORKSPACE_PROD/website; git pull; git checkout $CI_COMMIT_TAG'
tags:
- dip-shell-runner
deploy_dev:
stage: deploy
only:
- master
tags:
- dip-shell-runner
script:
- cd $WORKSPACE_DEV
- docker-compose build --build-arg CLIENT_ID=$CLIENT_ID --build-arg CLIENT_SECRET=$CLIENT_SECRET --build-arg TOKEN=$TOKEN --no-cache
- docker-compose up -d
deploy_prod:
stage: deploy
only:
- tags
tags:
- dip-shell-runner
script:
- cd $WORKSPACE_PROD
- docker-compose build --build-arg CLIENT_ID=$CLIENT_ID --build-arg CLIENT_SECRET=$CLIENT_SECRET --build-arg TOKEN=$TOKEN --no-cache
- docker-compose up -d