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

Commit 7e518d7

Browse files
authored
Add docker build/push to staging release (#6615)
1 parent 369afb5 commit 7e518d7

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.circleci/config.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,25 @@ commands:
8585
command: gh-pages -d dist --branch << parameters.target_branch >> --message '[skip ci]'
8686
docker_build_push:
8787
description: "Build Docker image"
88+
parameters:
89+
docker_latest_image_tag:
90+
type: string
91+
default: "latest-staging"
92+
docker_image_tag:
93+
type: string
94+
default: ${CIRCLE_SHA1}
8895
steps:
8996
- setup_remote_docker
9097
- run:
9198
name: Building docker image
9299
command: |
93-
docker build -t ${DOCKHUB_ORGANISATION}/binary-static:${CIRCLE_TAG} -t ${DOCKHUB_ORGANISATION}/binary-static:production-latest .
100+
docker build -t ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_image_tag >> -t ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_latest_image_tag >> .
94101
- run:
95102
name: Pushing Image to docker hub
96103
command: |
97104
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
98-
docker push ${DOCKHUB_ORGANISATION}/binary-static:${CIRCLE_TAG}
99-
docker push ${DOCKHUB_ORGANISATION}/binary-static:production-latest
105+
docker push ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_image_tag >>
106+
docker push ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_latest_image_tag >>
100107
k8s_deploy:
101108
description: "Deploy to k8s cluster"
102109
parameters:
@@ -106,6 +113,9 @@ commands:
106113
k8s_namespace:
107114
type: string
108115
default: "www-binary-com-staging"
116+
k8s_version:
117+
type: string
118+
default: ${CIRCLE_SHA1}
109119
steps:
110120
- k8s/install-kubectl
111121
- run:
@@ -116,7 +126,7 @@ commands:
116126
git clone https://github.com/binary-com/devops-ci-scripts
117127
cd devops-ci-scripts/k8s-build_tools
118128
echo $CA_CRT | base64 --decode > ca.crt
119-
./release.sh binary-static ${TAG}
129+
./release.sh binary-static << parameters.k8s_version >>
120130
notify_slack:
121131
description: "Notify slack"
122132
steps:
@@ -146,6 +156,7 @@ jobs:
146156
target: 'translations'
147157
- deploy:
148158
target_branch: "staging"
159+
- docker_build_push
149160
- k8s_deploy
150161
- notify_slack
151162
release_production:
@@ -169,10 +180,13 @@ jobs:
169180
- test
170181
- build:
171182
target: 'production'
172-
- docker_build_push
183+
- docker_build_push:
184+
docker_latest_image_tag: latest
185+
docker_image_tag: ${CIRCLE_TAG}
173186
- k8s_deploy:
174187
k8s_svc_name: "production-binary-com"
175188
k8s_namespace: "www-binary-com-production"
189+
k8s_version: ${CIRCLE_TAG}
176190

177191
workflows:
178192
test:

0 commit comments

Comments
 (0)