-
Notifications
You must be signed in to change notification settings - Fork 20
/
.travis.yml
47 lines (40 loc) · 1.23 KB
/
.travis.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
---
language: python
branches:
only:
- master
env:
global:
# Software versions
- TERRAFORM_VERSION=0.15.3
- TF_VAR_cluster_name=$(uuidgen -t)
- TF_VAR_public_net_name="public"
- TF_VAR_image_name="ubuntu-18.04-docker-x86_64"
- TF_VAR_master_flavor_name="m1.small"
- TF_VAR_worker_flavor_name="m1.small"
jobs:
- TF_VAR_master_count=1
TF_VAR_worker_count=1
install:
- travis_retry curl -L
"https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
-o /tmp/terraform.zip
- sudo unzip /tmp/terraform.zip -d /usr/local/bin
- sudo chmod +x /usr/local/bin/terraform
- mkdir -p "$HOME/.terraform.d/plugins/"
- ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add
before_script:
- terraform init
- terraform validate
- terraform fmt -check=true -diff
script:
- set -o pipefail
- terraform apply -auto-approve | grep -v remote-exec
- export TF_VAR_worker_count=$((TF_VAR_worker_count+1))
- terraform apply -auto-approve | grep -v remote-exec
- export TF_VAR_worker_count=$((TF_VAR_worker_count-1))
- terraform apply -auto-approve | grep -v remote-exec
after_script:
- terraform destroy -auto-approve