diff --git a/README.md b/README.md index f3367b7..b7b335c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This pipeline will update the `my-deployment` deployment with the image tagged ` deployment: my-deployment repo: myorg/myrepo name: my-container + namespace: default tag: ${DRONE_COMMIT_SHA:8} ## Required secrets diff --git a/update.sh b/update.sh index c2f5053..14b7970 100644 --- a/update.sh +++ b/update.sh @@ -1,9 +1,11 @@ #!/bin/sh +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 kubectl config set-context default --cluster=default --user=default kubectl config use-context default -kubectl set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_NAME}=${PLUGIN_REPO}:${PLUGIN_TAG} - -#TODO : Identify a good way to identify IMAGE_NAME and PLUGIN_DEPLOY_IMAGE +kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_NAME}=${PLUGIN_REPO}:${PLUGIN_TAG}