1
0
Fork 0
mirror of https://github.com/honestbee/drone-kubernetes.git synced 2025-05-13 08:43:18 +00:00

Add handling environments

This commit is contained in:
Charles Martinot 2017-02-07 14:09:44 +08:00
parent 26454722a6
commit 3042727362
2 changed files with 37 additions and 3 deletions

View file

@ -4,8 +4,16 @@ if [ -z ${PLUGIN_NAMESPACE} ]; then
PLUGIN_NAMESPACE="default"
fi
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
if [ -z PLUGIN_KUBERNETES_TOKEN ]; then
PLUGIN_KUBERNETES_TOKEN = $KUBERNETES_TOKEN
fi
if [ -z PLUGIN_KUBERNETES_SERVER ]; then
PLUGIN_KUBERNETES_SERVER = $KUBERNETES_SERVER
fi
kubectl config set-credentials default --token=${PLUGIN_KUBERNETES_TOKEN}
kubectl config set-cluster default --server=${PLUGIN_KUBERNETES_SERVER} --insecure-skip-tls-verify=true
kubectl config set-context default --cluster=default --user=default
kubectl config use-context default
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}