-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre.sh
executable file
·31 lines (27 loc) · 1.41 KB
/
pre.sh
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
#!/bin/bash
docker --version
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
mkdir ${HOME}/.kube
cp ./kubeconf.yml ${HOME}/.kube/config
# 'master' is our development branch
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
echo "Setting up development environment"
kubectl config set clusters.mochi.k8s.local.certificate-authority-data ${KUBE_CLUSTER_CERT}
kubectl config set clusters.mochi.k8s.local.server ${KUBE_SERVER}
kubectl config set users.mochi.k8s.local.client-certificate-data ${KUBE_CLIENT_CERT}
kubectl config set users.mochi.k8s.local.client-key-data ${KUBE_CLIENT_KEYDATA}
fi
# production branch and tags will deploy to production
if [[ "$TRAVIS_BRANCH" == "production" ]] || [[ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]]; then
echo "Setting up production environment"
kubectl config set clusters.mochi.k8s.local.certificate-authority-data ${KUBE_PROD_CLUSTER_CERT}
kubectl config set clusters.mochi.k8s.local.server ${KUBE_PROD_SERVER}
kubectl config set users.mochi.k8s.local.client-certificate-data ${KUBE_PROD_CLIENT_CERT}
kubectl config set users.mochi.k8s.local.client-key-data ${KUBE_PROD_CLIENT_KEYDATA}
fi
kubectl version
pip install --user awscli
export PATH=${PATH}:${HOME}/.local/bin
aws --version