This repository was archived by the owner on Feb 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,24 @@ commands:
115115 - run :
116116 name : Deploying to k8s cluster for service binary-bot-beta
117117 command : |
118- build_tag="${CIRCLE_SHA1}"
119- deployment_target="bot-binary-com"
120- [ "<< parameters.target >>" == "beta" ] && build_tag="beta-${CIRCLE_SHA1}" && deployment_target="bot-beta-binary-com"
121- echo $CA_CRT | base64 --decode > ca.crt
122- kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/${deployment_target} ${deployment_target}=${DOCKHUB_ORGANISATION}/binary-static-bot:${build_tag}
118+ for SERVER_ID in {1..5}
119+ do
120+ KUBE_SERVER_REF="KUBE_SERVER_$SERVER_ID"
121+ SERVICEACCOUNT_TOKEN_REF="SERVICEACCOUNT_TOKEN_$SERVER_ID"
122+ CA_CRT_REF="CA_CRT_$SERVER_ID"
123+ if [ ! -z "${!KUBE_SERVER_REF}" ]
124+ then
125+ echo "Deploying to cluster $SERVER_ID"
126+ CA_CRT="${!CA_CRT_REF}"
127+ KUBE_SERVER="${!KUBE_SERVER_REF}"
128+ SERVICEACCOUNT_TOKEN="${!SERVICEACCOUNT_TOKEN_REF}"
129+ build_tag="${CIRCLE_SHA1}"
130+ deployment_target="bot-binary-com"
131+ [ "<< parameters.target >>" == "beta" ] && build_tag="beta-${CIRCLE_SHA1}" && deployment_target="bot-beta-binary-com"
132+ echo $CA_CRT | base64 --decode > ca.crt
133+ kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/${deployment_target} ${deployment_target}=${DOCKHUB_ORGANISATION}/binary-static-bot:${build_tag}
134+ fi
135+ done
123136
124137 npm_test :
125138 description : Run test
You can’t perform that action at this time.
0 commit comments