-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
67 lines (61 loc) · 1.3 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.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
unit_tests:
stage: unit_tests
except:
- schedules
only:
- gitlab
- master
- integration
- staging
script:
- make test
functional_tests:
stage: functional_tests
only:
- gitlab
- master
- integration
- staging
script:
- source config/environment
- make functional-tests
terraform:
stage: terraform
only:
- gitlab
- master
- integration
- staging
script:
- cd terraform/envs/$DEPLOYMENT_STAGE
- make init
- make plan
deploy:
except:
- schedules
stage: deploy
only:
- gitlab
- master
- integration
- staging
script:
- ./scripts/deploy.sh $DEPLOYMENT_STAGE