Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,24 @@ commands:
docker push ${DOCKHUB_ORGANISATION}/binary-static-ticktrade
k8s_deploy:
description: "Deploy to k8s cluster"
parameters:
k8s_namespace:
type: string
default: "ticktrade-binary-com-production"
k8s_service:
type: string
default: "binary-static-ticktrade"
steps:
- k8s/install-kubectl
- run:
name: Deploying to k8s cluster for service ticktrade-binary-com
command: |
for SERVER_ID in {1..5}
do
KUBE_SERVER_REF="KUBE_SERVER_$SERVER_ID"
SERVICEACCOUNT_TOKEN_REF="SERVICEACCOUNT_TOKEN_$SERVER_ID"
CA_CRT_REF="CA_CRT_$SERVER_ID"
if [ ! -z "${!KUBE_SERVER_REF}" ]
then
echo "Deploying to cluster $SERVER_ID"
CA_CRT="${!CA_CRT_REF}"
KUBE_SERVER="${!KUBE_SERVER_REF}"
SERVICEACCOUNT_TOKEN="${!SERVICEACCOUNT_TOKEN_REF}"
echo $CA_CRT | base64 --decode > ca.crt
kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/ticktrade-binary-com ticktrade-binary-com=${DOCKHUB_ORGANISATION}/binary-static-ticktrade:${CIRCLE_TAG}
fi
done
TAG=${CIRCLE_TAG:-$CIRCLE_SHA1}
export NAMESPACE=<< parameters.k8s_namespace >>
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo $CA_CRT | base64 --decode > ca.crt
./release.sh << parameters.k8s_service >> ${TAG}

jobs:
test:
Expand Down