-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
55 lines (50 loc) · 1.37 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
include:
- local: "/sovryn-token-bridge/.gitlab-ci.yml"
stages:
- package
- deploy
# https://docs.gitlab.com/ee/ci/yaml/#yaml-anchors-for-script
.deploy: &deploy
stage: deploy
image: docker.atixlabs.com/docker:19.03.1-compose
when: manual
services:
- docker:19.03.1-dind
only:
refs:
# Only run on develop, release/x.y.x and hotfix/xxxx
- develop
- /^release.*$/
- /^hotfix.*$/
except:
- schedules
# https://docs.gitlab.com/ee/ci/yaml/#yaml-anchors-for-script
.deploy-script: &deploy-script
# Setup ssh
- apk add --update curl openssh bash
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Deploy
- docker login -u gitlabci -p $CI_JOB_TOKEN $CI_REGISTRY
deploy-staging:
<<: *deploy
environment:
name: staging
url: https://federation.staging.sovryn.atixlabs.xyz
script:
- *deploy-script
- ssh-keyscan federation.staging.sovryn.atixlabs.xyz >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- cd ./ops && bash ./ops.sh --deploy "staging"
deploy-uat:
<<: *deploy
environment:
name: uat
url: https://federation.uat.sovryn.atixlabs.xyz
script:
- *deploy-script
- ssh-keyscan federation.uat.sovryn.atixlabs.xyz >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- cd ./ops && bash ./ops.sh --deploy "uat"