diff --git a/README.md b/README.md index 8f24034..4950d8f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,16 @@ This pipeline will update the `my-deployment` deployment with the image tagged ` container: my-container tag: ${DRONE_COMMIT_SHA:8} +Deploying several new containers, eg in a scheduler-worker setup. + + pipeline: + deploy: + image: quay.io/honestbee/drone-kubernetes + deployment: [server-deploy, worker-deploy] + repo: myorg/myrepo + container: my-container + tag: ${DRONE_COMMIT_SHA:8} + This more complex example demonstrates how to deploy to several environments based on the branch, in a `app` namespace pipeline: diff --git a/update.sh b/update.sh index 44ef4c1..7234dcc 100644 --- a/update.sh +++ b/update.sh @@ -16,4 +16,9 @@ kubectl config set-credentials default --token=${KUBERNETES_TOKEN} kubectl config set-cluster default --server=${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} + +DEPLOYMENTS=$(echo $PLUGIN_DEPLOYMENT|tr -d '[],') +for DEPLOY in ${DEPLOYMENTS[@]}; do + kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \ + ${PLUGIN_CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG} +done