-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
67 lines (61 loc) · 1.36 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
image: python:3.6
stages:
- unit_tests
- 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.12.19/terraform_0.12.19_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
- elif [[ "$DEPLOYMENT_STAGE" != "integration" && "$DEPLOYMENT_STAGE" != "staging" ]]; then
- export DEPLOYMENT_STAGE=predev
- fi
- source config/environment
unit_tests:
stage: unit_tests
except:
- schedules
only:
- master
- integration
- staging
script:
- make test
functional_tests:
stage: functional_tests
only:
- master
- integration
- staging
script:
- source config/environment
- make functional-tests
terraform:
stage: terraform
only:
- master
- integration
- staging
script:
- cd terraform/envs/$DEPLOYMENT_STAGE
- make init
- make plan
deploy:
except:
- schedules
stage: deploy
only:
- master
- integration
- staging
script:
- make deploy