-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci-prod.yml
45 lines (40 loc) · 1 KB
/
.gitlab-ci-prod.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
image: python:3.6
stages:
- terraform
- deploy
- functional_tests
before_script:
- apt-get -y update
- apt-get -y install jq moreutils gettext unzip zip
- pip install -r requirements-dev.txt
- mkdir ./external_binaries
- curl https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip -o /tmp/terraform.zip
- unzip /tmp/terraform.zip -d ./external_binaries/
- rm /tmp/terraform.zip
- export PATH=$PATH:`pwd`/external_binaries/
- export DEPLOYMENT_STAGE=$CI_COMMIT_REF_NAME
- if [ "$DEPLOYMENT_STAGE" == "master" ]; then export DEPLOYMENT_STAGE=dev; fi
- source config/environment
functional_tests:
stage: functional_tests
only:
- prod
script:
- source config/environment
- make functional-tests
terraform:
stage: terraform
only:
- prod
script:
- cd terraform/envs/$DEPLOYMENT_STAGE
- make init
- make plan
deploy:
except:
- schedules
stage: deploy
only:
- prod
script:
- ./scripts/deploy.sh $DEPLOYMENT_STAGE