-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
117 lines (94 loc) · 4.31 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
language: python # (Ansible)
sudo: required
services:
- docker
branches:
except:
- /^experimental\/.*$/
- /^exp\/.*$/
- /^testing\/.*$/
- /^test\/.*$/
- /^doc\/.*$/
- /^docs\/.*$/
- /^documentation\/.*$/
env:
global:
- TIMEOUT=2250
- KN_BRANCH="phenomenal/stable"
- KN_PLUGIN_REPO="https://github.com/phnmnl/KubeNow-plugin.git"
- KN_PLUGIN_NAME="phnmnl/KubeNow-plugin"
- KN_PLUGIN_REPO_BRANCH="$TRAVIS_BRANCH"
matrix:
- HOST_CLOUD=openstack
addons:
apt:
sources:
- debian-sid
before_install:
# currently nothing
install:
# Nothing for now
before_script:
# Copy kn bin
- curl -f "https://raw.githubusercontent.com/kubenow/KubeNow/$KN_BRANCH/bin/kn" -o "/tmp/kn"
- sudo mv /tmp/kn /usr/local/bin/
- sudo chmod +x /usr/local/bin/kn
# Init test deployment
- kn init ${HOST_CLOUD} test-deployment
- cd test-deployment
# Overwrite ssh-key for debug purposes
- echo -e "$TRAVIS_SSH_KEY_PRIV" > ssh_key
- echo -e "$TRAVIS_SSH_KEY_PUB" > ssh_key.pub
# RENDER CONFIGURATION
# Common
- sed -i -e "s/your-cluster-prefix/phnmnl-plugin-ci-${TRAVIS_BUILD_NUMBER}-${HOST_CLOUD}/g" config.tfvars
- sed -i -e "s/\"password\"/\"${APPLICATIONS_PASSWORD}\"/g" config.tfvars
# AWS
- sed -i -e "s/your-acces-key-id/${AWS_ACCESS_KEY_ID}/g" config.tfvars
- sed -i -e "s#your-secret-access-key#${AWS_SECRET_ACCESS_KEY}#g" config.tfvars
- sed -i -e "s/eu-west-1/${AWS_DEFAULT_REGION}/g" config.tfvars
# GCE
- printf '%s\n' "$GCE_CREDENTIALS" > "./service-account.json"
- sed -i -e "s/your_project_id/${GCE_PROJECT_ID}/g" config.tfvars
# OS
- sed -i -e "s/your-pool-name/${OS_POOL_NAME}/g" config.tfvars
- sed -i -e "s/external-net-uuid/${OS_EXTERNAL_NET_UUID}/g" config.tfvars
- sed -i -e "s/your-master-flavor/${OS_NODE_FLAVOR}/g" config.tfvars
- sed -i -e "s/your-node-flavor/${OS_NODE_FLAVOR}/g" config.tfvars
- sed -i -e "s/your-edge-flavor/${OS_NODE_FLAVOR}/g" config.tfvars
- sed -i -e "s/your-glusternode-flavor/${OS_NODE_FLAVOR}/g" config.tfvars
# Enable edges
# - sed -i -e "s/# edge/edge/g" config.tfvars
# Enable glusternodes
- sed -i -e 's/# glusternode/glusternode/g' config.tfvars
# Enable dashboard, logmon and data federation
- sed -i -e 's/\"dashboard_include.*false\"/\"dashboard_include\" = \"true\"/g' config.tfvars
- sed -i -e 's/\"logmon_include.*false\"/\"logmon_include\" = \"true\"/g' config.tfvars
- sed -i -e 's/\"datafederation_include.*false\"/\"datafederation_include\" = \"true\"/g' config.tfvars
# Cloudflare
# - sed -i -e "s/# use_cloudflare/use_cloudflare/g" config.tfvars
# - sed -i -e "s/# cloudflare_email = \"your-cloudflare-email\"/cloudflare_email = \"${CI_CLOUDFLARE_EMAIL}\"/g" config.tfvars
# - sed -i -e "s/# cloudflare_token = \"your-cloudflare-token\"/cloudflare_token = \"${CI_CLOUDFLARE_TOKEN}\"/g" config.tfvars
# - sed -i -e "s/# cloudflare_domain = \"your-domain-name\"/cloudflare_domain = \"${CI_CLOUDFLARE_DOMAIN}\"/g" config.tfvars
# - >
# sed -i -e
# "s/# cloudflare_subdomain = \"your-subdomain-name\"/cloudflare_subdomain = \"phnmnl-plugin-ci-${TRAVIS_BUILD_NUMBER}-${HOST_CLOUD}\"/g"
# config.tfvars
# Pachyderm
# This searches for a line that ends with the string `pachyderm installation` and then goes into a loop where it removes `#` characters from
# the very start of the line, until it hits a line with no `#` at the start. `:a` defines a label named `a` and `ta` jumps to that label if
# the most recent `s` command made a modification. The `n` command prints the current "pattern space" (the buffer that holds the data) and
# reads the next line into the same space. (edited)
# - sed -i -e '/pachyderm installation$/{:a;n;s/^#//;ta}' config.tfvars
# Append some params to pachyderm block
# - sed -i '/"pachyderm_etcd_pvc_size" = "5G"/a "pachd_requests_cpu" = "250m"' config.tfvars
# - sed -i '/"pachyderm_etcd_pvc_size" = "5G"/a "pachd_requests_mem" = "250M"' config.tfvars
# - sed -i '/"pachyderm_etcd_pvc_size" = "5G"/a "etcd_requests_cpu" = "250m"' config.tfvars
# - sed -i '/"pachyderm_etcd_pvc_size" = "5G"/a "etcd_requests_mem" = "250M"' config.tfvars
script:
# Deploy
- kn apply
after_script:
- export TERRAFORM_OPT="-force" && travis_retry kn destroy
- travis_retry terraform destroy -force "$HOST_CLOUD" # in case there is some problem with kn