Add namespace option
This commit is contained in:
parent
4490e740d3
commit
8d2432c6e8
|
@ -12,6 +12,7 @@ This pipeline will update the `my-deployment` deployment with the image tagged `
|
||||||
deployment: my-deployment
|
deployment: my-deployment
|
||||||
repo: myorg/myrepo
|
repo: myorg/myrepo
|
||||||
name: my-container
|
name: my-container
|
||||||
|
namespace: default
|
||||||
tag: ${DRONE_COMMIT_SHA:8}
|
tag: ${DRONE_COMMIT_SHA:8}
|
||||||
|
|
||||||
## Required secrets
|
## Required secrets
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -z ${PLUGIN_NAMESPACE} ]; then
|
||||||
|
PLUGIN_NAMESPACE="default"
|
||||||
|
fi
|
||||||
|
|
||||||
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
|
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
|
||||||
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
|
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
|
||||||
kubectl config set-context default --cluster=default --user=default
|
kubectl config set-context default --cluster=default --user=default
|
||||||
kubectl config use-context default
|
kubectl config use-context default
|
||||||
kubectl set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_NAME}=${PLUGIN_REPO}:${PLUGIN_TAG}
|
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_NAME}=${PLUGIN_REPO}:${PLUGIN_TAG}
|
||||||
|
|
||||||
#TODO : Identify a good way to identify IMAGE_NAME and PLUGIN_DEPLOY_IMAGE
|
|
||||||
|
|
Loading…
Reference in New Issue