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

Add docker build/push to staging release #6615

Merged
merged 1 commit into from
Jun 16, 2021
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
24 changes: 19 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,25 @@ commands:
command: gh-pages -d dist --branch << parameters.target_branch >> --message '[skip ci]'
docker_build_push:
description: "Build Docker image"
parameters:
docker_latest_image_tag:
type: string
default: "latest-staging"
docker_image_tag:
type: string
default: ${CIRCLE_SHA1}
steps:
- setup_remote_docker
- run:
name: Building docker image
command: |
docker build -t ${DOCKHUB_ORGANISATION}/binary-static:${CIRCLE_TAG} -t ${DOCKHUB_ORGANISATION}/binary-static:production-latest .
docker build -t ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_image_tag >> -t ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_latest_image_tag >> .
- run:
name: Pushing Image to docker hub
command: |
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
docker push ${DOCKHUB_ORGANISATION}/binary-static:${CIRCLE_TAG}
docker push ${DOCKHUB_ORGANISATION}/binary-static:production-latest
docker push ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_image_tag >>
docker push ${DOCKHUB_ORGANISATION}/binary-static:<< parameters.docker_latest_image_tag >>
k8s_deploy:
description: "Deploy to k8s cluster"
parameters:
Expand All @@ -106,6 +113,9 @@ commands:
k8s_namespace:
type: string
default: "www-binary-com-staging"
k8s_version:
type: string
default: ${CIRCLE_SHA1}
steps:
- k8s/install-kubectl
- run:
Expand All @@ -116,7 +126,7 @@ commands:
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 binary-static ${TAG}
./release.sh binary-static << parameters.k8s_version >>
notify_slack:
description: "Notify slack"
steps:
Expand Down Expand Up @@ -146,6 +156,7 @@ jobs:
target: 'translations'
- deploy:
target_branch: "staging"
- docker_build_push
- k8s_deploy
- notify_slack
release_production:
Expand All @@ -169,10 +180,13 @@ jobs:
- test
- build:
target: 'production'
- docker_build_push
- docker_build_push:
docker_latest_image_tag: latest
docker_image_tag: ${CIRCLE_TAG}
- k8s_deploy:
k8s_svc_name: "production-binary-com"
k8s_namespace: "www-binary-com-production"
k8s_version: ${CIRCLE_TAG}

workflows:
test:
Expand Down