forked from kubenow/KubeNow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
89 lines (81 loc) · 2.38 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
language: python # (Ansible)
sudo: required
branches:
except:
- /^experimental\/.*$/
- /^exp\/.*$/
- /^development\/.*$/
- /^dev\/.*$/
- /^testing\/.*$/
- /^test\/.*$/
- /^doc\/.*$/
- /^docs\/.*$/
- /^documentation\/.*$/
env:
- HOST_CLOUD=openstack
- HOST_CLOUD=gce
- HOST_CLOUD=aws
before_install:
# Decrypt secrets
- >
openssl aes-256-cbc
-K $encrypted_92d825aa39d7_key
-iv $encrypted_92d825aa39d7_iv
-in test/secret.enc
-out test/secret.tgz
-d
# Extract secrets
- tar xzvf test/secret.tgz -C test
# Add the keypair to the agent
- eval "$(ssh-agent -s)"
- ssh-add test/secret/kubenow-ci
# Get secrets
- git clone [email protected]:mcapuccini/secrets-kubenow.git test/secrets-kubenow
install:
# INSTALL DEPS
# Install deps by HashiCorp
- >
curl
https://releases.hashicorp.com/packer/0.11.0/packer_0.11.0_linux_amd64.zip
> /tmp/packer.zip
- >
curl
https://releases.hashicorp.com/terraform/0.7.8/terraform_0.7.8_linux_amd64.zip
> /tmp/terraform.zip
- sudo unzip /tmp/packer.zip -d /usr/bin
- sudo unzip /tmp/terraform.zip -d /usr/bin
- sudo chmod +x /usr/bin/packer
- sudo chmod +x /usr/bin/terraform
# Install Ansible
- sudo pip install --upgrade pip
- sudo pip install ansible==2.2.0.0
# Install other deps
- sudo pip install dnspython
# Install OpenStack deps
- pip install python-glanceclient
# Install GCE deps
- export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
- >
echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" |
sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
- >
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg |
sudo apt-key add -
- sudo apt-get update && sudo apt-get install google-cloud-sdk
# Install AWS deps
- sudo pip install awscli
# TEST ENV LOGIN
# Source CityCloud RC file
- source test/secrets-kubenow/host_cloud/CityCloud.sh
# GCE login
- >
gcloud auth activate-service-account
--key-file=test/secrets-kubenow/host_cloud/gce-key.json
- >
gcloud auth login [email protected]
--project phenomenal-1145 -q
# AWS login
- source test/secrets-kubenow/host_cloud/aws.sh
script:
- ansible-playbook -e "host_cloud=$HOST_CLOUD" test/integration-test.yml