@@ -80,16 +80,18 @@ commands:
80
80
docker_build_push :
81
81
description : " Build and Push image to docker hub"
82
82
parameters :
83
- target :
83
+ docker_latest_image_tag :
84
+ type : string
85
+ default : " latest-staging"
86
+ docker_image_tag :
84
87
type : string
88
+ default : ${CIRCLE_SHA1}
85
89
steps :
86
90
- setup_remote_docker
87
91
- run :
88
- name : Building docker image for << parameters.target >>
92
+ name : Building docker image for << parameters.docker_latest_image_tag >>
89
93
command : |
90
- build_latest="latest"
91
- [ "<< parameters.target >>" == "beta" ] && build_latest="beta-latest"
92
- docker build -t ${DOCKHUB_ORGANISATION}/binary-static-bot:${CIRCLE_TAG} -t ${DOCKHUB_ORGANISATION}/binary-static-bot:${build_latest} .
94
+ docker build -t ${DOCKHUB_ORGANISATION}/binary-static-bot:<< parameters.docker_image_tag >> -t ${DOCKHUB_ORGANISATION}/binary-static-bot:<< parameters.docker_latest_image_tag >> .
93
95
- run :
94
96
name : Pushing Image to docker hub
95
97
command : |
@@ -100,6 +102,13 @@ commands:
100
102
parameters :
101
103
target :
102
104
type : string
105
+ default : " beta"
106
+ k8s_version :
107
+ type : string
108
+ default : ${CIRCLE_SHA1}
109
+ k8s_namespace :
110
+ type : string
111
+ default : " bot-binary-com-staging"
103
112
steps :
104
113
- k8s/install-kubectl
105
114
- run :
@@ -122,6 +131,12 @@ commands:
122
131
kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/${deployment_target} ${deployment_target}=${DOCKHUB_ORGANISATION}/binary-static-bot:${CIRCLE_TAG}
123
132
fi
124
133
done
134
+
135
+ export NAMESPACE=<< parameters.k8s_namespace >>
136
+ git clone https://github.com/binary-com/devops-ci-scripts
137
+ cd devops-ci-scripts/k8s-build_tools
138
+ echo $CA_CRT | base64 --decode > ca.crt
139
+ ./release.sh binary-static-bot << parameters.k8s_version >>
125
140
test :
126
141
description : " Run test"
127
142
steps :
@@ -154,21 +169,12 @@ jobs:
154
169
- npm_install
155
170
- test
156
171
- build
172
+ - docker_build_push
157
173
- deploy :
158
174
target_branch : " staging"
175
+ - k8s_deploy
159
176
- notify_slack
160
177
release_production :
161
- docker :
162
- - image : circleci/node:8.10.0-stretch
163
- steps :
164
- - git_checkout_from_cache
165
- - npm_install
166
- - test
167
- - build
168
- - deploy :
169
- target_branch : " production"
170
- - notify_slack
171
- release_aws_production :
172
178
docker :
173
179
- image : circleci/node:12.13.0-stretch
174
180
steps :
@@ -177,9 +183,12 @@ jobs:
177
183
- test
178
184
- build
179
185
- docker_build_push :
180
- target : " production"
186
+ docker_latest_image_tag : latest
187
+ docker_image_tag : ${CIRCLE_TAG}
181
188
- k8s_deploy :
182
189
target : " production"
190
+ k8s_namespace : " bot-binary-com-production"
191
+ k8s_version : ${CIRCLE_TAG}
183
192
184
193
workflows :
185
194
test :
@@ -200,10 +209,4 @@ workflows:
200
209
ignore : /.*/
201
210
tags :
202
211
only : /^production.*/
203
- - release_aws_production :
204
- filters :
205
- branches :
206
- ignore : /.*/
207
- tags :
208
- only : /^production.*/
209
212
context : binary-frontend-artifact-upload
0 commit comments