Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 369afb5

Browse files
authored
Remove old release and use Blue/Green as default (#6614)
Switch to blue/green deployment as a default release strategy Signed-off-by: Afshin Paydar <afshin.paydar@binary.com>
1 parent f0c2608 commit 369afb5

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

.circleci/config.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,20 @@ commands:
103103
k8s_svc_name:
104104
type: string
105105
default: "staging-binary-com"
106+
k8s_namespace:
107+
type: string
108+
default: "www-binary-com-staging"
106109
steps:
107110
- k8s/install-kubectl
108111
- run:
109112
name: Deploying to k8s cluster for service << parameters.k8s_svc_name >>
110113
command: |
111-
for SERVER_ID in {1..5}
112-
do
113-
KUBE_SERVER_REF="KUBE_SERVER_$SERVER_ID"
114-
SERVICEACCOUNT_TOKEN_REF="SERVICEACCOUNT_TOKEN_$SERVER_ID"
115-
CA_CRT_REF="CA_CRT_$SERVER_ID"
116-
if [ ! -z "${!KUBE_SERVER_REF}" ]
117-
then
118-
echo "Deploying to cluster $SERVER_ID"
119-
CA_CRT="${!CA_CRT_REF}"
120-
KUBE_SERVER="${!KUBE_SERVER_REF}"
121-
SERVICEACCOUNT_TOKEN="${!SERVICEACCOUNT_TOKEN_REF}"
122-
echo $CA_CRT | base64 --decode > ca.crt
123-
kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/<< parameters.k8s_svc_name >> << parameters.k8s_svc_name >>=${DOCKHUB_ORGANISATION}/binary-static:${CIRCLE_TAG}
124-
fi
125-
done
114+
TAG=${CIRCLE_TAG:-$CIRCLE_SHA1}
115+
export NAMESPACE=<< parameters.k8s_namespace >>
116+
git clone https://github.com/binary-com/devops-ci-scripts
117+
cd devops-ci-scripts/k8s-build_tools
118+
echo $CA_CRT | base64 --decode > ca.crt
119+
./release.sh binary-static ${TAG}
126120
notify_slack:
127121
description: "Notify slack"
128122
steps:
@@ -139,7 +133,7 @@ jobs:
139133
- git_checkout_from_cache
140134
- npm_install
141135
- test
142-
release_beta:
136+
release_staging:
143137
docker:
144138
- image: circleci/node:9.8.0-stretch
145139
steps:
@@ -152,6 +146,7 @@ jobs:
152146
target: 'translations'
153147
- deploy:
154148
target_branch: "staging"
149+
- k8s_deploy
155150
- notify_slack
156151
release_production:
157152
docker:
@@ -177,7 +172,8 @@ jobs:
177172
- docker_build_push
178173
- k8s_deploy:
179174
k8s_svc_name: "production-binary-com"
180-
175+
k8s_namespace: "www-binary-com-production"
176+
181177
workflows:
182178
test:
183179
jobs:
@@ -187,7 +183,7 @@ workflows:
187183
ignore: /^master$/
188184
release:
189185
jobs:
190-
- release_beta:
186+
- release_staging:
191187
filters:
192188
branches:
193189
only: /^master$/

0 commit comments

Comments
 (0)