Revert "Revert "Revert "[wip] K8s (#162)"""

This reverts commit 66887c14e0.
This commit is contained in:
Kevin van Zonneveld 2017-11-29 11:22:05 +01:00
parent 66887c14e0
commit 897e40e02d
6 changed files with 0 additions and 119 deletions

View File

@ -1,5 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: tus

View File

@ -1,19 +0,0 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: tusd
namespace: tus
spec:
replicas: 1
template:
metadata:
labels:
app: tusd
spec:
containers:
- image: docker.io/tusproject/tusd:latest
imagePullPolicy: Always
args: ["-port=8080","-behind-proxy","-max-size=1000000000"]
name: tusd
ports:
- containerPort: 8080

View File

@ -1,22 +0,0 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: tusd
namespace: tus
annotations:
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.class: "nginx"
spec:
tls:
- hosts:
- thesocialcactus.com
secretName: tusd-tls
rules:
- host: thesocialcactus.com
http:
paths:
- path: /
backend:
serviceName: tusd
servicePort: 80

View File

@ -1,13 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: tusd
namespace: tus
spec:
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: tusd

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
# set -o xtrace
# Set magic variables for current FILE & DIR
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__root="$(cd "$(dirname "${__dir}")" && pwd)"
# Store the new image in docker hub
docker build --quiet -t tusproject/tusd:latest -t tusproject/tusd:$TRAVIS_COMMIT ${__root};
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push tusproject/tusd:$TRAVIS_COMMIT;
docker push tusproject/tusd:latest;
echo $GCLOUD_KEY | base64 --decode -i > ${HOME}/gcloud-service-key.json
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
gcloud --quiet config set project $PROJECT_NAME
gcloud --quiet config set container/cluster $CLUSTER_NAME
gcloud --quiet config set compute/zone ${COMPUTE_ZONE}
gcloud --quiet container clusters get-credentials $CLUSTER_NAME
kubectl config current-context
helm init --service-account tiller --upgrade
kubectl apply -f "${__root}/.infra/kube/00-namespace.yaml"
kubectl apply -f "${__root}/.infra/kube/deployment.yaml"
kubectl apply -f "${__root}/.infra/kube/service.yaml"
kubectl apply -f "${__root}/.infra/kube/ingress-tls.yaml"
kubectl set image deployment/tusd --namespace=tus tusd=docker.io/tusproject/tusd:$TRAVIS_COMMIT
kubectl get pods --namespace=tus
kubectl get service --namespace=tus
kubectl get deployment --namespace=tus
function cleanup {
printf "Cleaning up...\n"
rm -vf "${HOME}/gcloud-service-key.json"
printf "Cleaning done."
}
trap cleanup EXIT

View File

@ -11,7 +11,6 @@ cache:
directories: directories:
- $HOME/.gimme - $HOME/.gimme
- $HOME/.frey - $HOME/.frey
- "$HOME/google-cloud-sdk/"
env: env:
global: global:
- GO15VENDOREXPERIMENT=1 - GO15VENDOREXPERIMENT=1
@ -26,12 +25,6 @@ script:
- ./.scripts/test_all.sh - ./.scripts/test_all.sh
before_deploy: before_deploy:
- if [[ "$TRAVIS_TAG" != "" ]]; then ./.scripts/build_all.sh; fi - if [[ "$TRAVIS_TAG" != "" ]]; then ./.scripts/build_all.sh; fi
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; curl https://sdk.cloud.google.com | bash; fi
- source /home/travis/google-cloud-sdk/path.bash.inc
- gcloud --quiet version
- gcloud --quiet components update
- gcloud --quiet components update kubectl
- curl https://raw.githubusercontent.com/kubernetes/helm/8478fb4fc723885b155c924d1c8c410b7a9444e6/scripts/get | bash
deploy: deploy:
- provider: releases - provider: releases
api_key: api_key:
@ -49,9 +42,3 @@ deploy:
branch: master branch: master
go: 1.8 go: 1.8
repo: tus/tusd repo: tus/tusd
- provider: script
script: .scripts/deploy_gcloud.sh
on:
branch: k8s
go: 1.8
repo: tus/tusd