drone-kubernetes/update.sh

20 lines
658 B
Bash
Raw Normal View History

2017-01-13 10:07:48 +00:00
#!/bin/sh
2017-01-16 02:00:29 +00:00
if [ -z ${PLUGIN_NAMESPACE} ]; then
PLUGIN_NAMESPACE="default"
fi
2017-02-08 02:49:32 +00:00
if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then
KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN
2017-02-07 06:09:44 +00:00
fi
2017-02-08 02:49:32 +00:00
if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then
KUBERNETES_SERVER=$PLUGIN_KUBERNETES_SERVER
2017-02-07 06:09:44 +00:00
fi
2017-02-08 02:49:32 +00:00
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
2017-01-13 10:07:48 +00:00
kubectl config set-context default --cluster=default --user=default
kubectl config use-context default
2017-01-17 03:04:10 +00:00
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}