-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (36 loc) · 1.34 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
sudo: required
os:
- linux
language: go
services:
- docker
go:
- 1.9.2
script:
- 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.yaml ${HOME}/.kube/config
- docker --version
- go test -v ./... -cover
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then
export AWS_ACCESS_KEY_ID=${OATHCI_ACCESS_KEY_ID};
export AWS_SECRET_ACCESS_KEY=${OATHCI_SECRET_ACCESS_KEY};
pip install --user awscli;
export PATH=$PATH:$HOME/.local/bin;
aws --version;
eval $(aws ecr get-login --no-include-email --region ap-northeast-1);
export IMAGE=oath:${TRAVIS_COMMIT};
IMAGE=${IMAGE} make oathd;
docker tag ${IMAGE} ${ECR_REPO_URI}/${IMAGE};
docker images;
docker push ${ECR_REPO_URI}/${IMAGE};
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};
kubectl set image deployment oath oath=${ECR_REPO_URI}/${IMAGE};
else
make;
fi