11version : 2.1
22orbs :
334+ 45commands :
56 git_checkout_from_cache :
67 description : " Git checkout and save cache"
@@ -30,24 +31,21 @@ commands:
3031 key : source-v1-{{ .Branch }}-{{ .Revision }}
3132 paths :
3233 - " .git"
33- docker_build :
34+ docker_build_push :
3435 description : " Build Docker image"
3536 steps :
3637 - setup_remote_docker
3738 - run :
3839 name : Building docker image
3940 command : |
4041 docker build -t ${DOCKHUB_ORGANISATION}/binary-bitcoin-wallet:${CIRCLE_SHA1} -t ${DOCKHUB_ORGANISATION}/binary-bitcoin-wallet:latest .
41- docker_push :
42- description : " Push image to docker hub"
43- steps :
4442 - run :
4543 name : Pushing Image to docker hub
4644 command : |
4745 echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
4846 docker push ${DOCKHUB_ORGANISATION}/binary-bitcoin-wallet:${CIRCLE_SHA1}
4947 docker push ${DOCKHUB_ORGANISATION}/binary-bitcoin-wallet:latest
50- deploy_gh_pages :
48+ deploy :
5149 description : " Deploy to static branches"
5250 parameters :
5351 target_branch :
@@ -58,24 +56,21 @@ commands:
5856 at : ./
5957 - run :
6058 name : Tag build
61- command : echo "<< parameters.target_branch >>-$(date -u +'%Y-%m-%dT%H:%M:%SZ')" > ./ version
59+ command : echo "<< parameters.target_branch >>-$(date -u +'%Y-%m-%dT%H:%M:%SZ')" > version
6260 - run :
6361 name : Install and configure dependencies
6462 command : |
6563 curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
6664 sudo apt install nodejs
67- mkdir "/home/circleci/.npm-packages"
68- npm config set prefix "/home/circleci/.npm-packages"
69- 65+ sudo npm install [email protected] 7066 git config user.email "[email protected] " 7167 git config user.name "ci-build"
7268 - add_ssh_keys :
7369 fingerprints :
74- - " 5e:29:b6:17:40:54:7c:c7:45:b5:9a:c1:28:c2:6a:1a "
70+ - " 01:67:4a:6d:26:9c:70:c4:1a:60:91:88:d9:dd:f0:83 "
7571 - run :
7672 name : Deploy docs to gh-pages branch
77- command : /home/circleci/.npm-packages/bin/gh-pages -d ./ --branch << parameters.target_branch >> --message '[skip ci]'
78-
73+ command : node ./node_modules/gh-pages/bin/gh-pages -d ./ --branch << parameters.target_branch >> --message '[skip ci]'
7974 k8s_deploy :
8075 description : " Deploy to k8s cluster"
8176 steps :
@@ -98,18 +93,30 @@ commands:
9893 kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/bitcoin-wallet-binary-com bitcoin-wallet-binary-com=${DOCKHUB_ORGANISATION}/binary-bitcoin-wallet:${CIRCLE_SHA1}
9994 fi
10095 done
96+ notify_slack :
97+ description : " Notify slack"
98+ steps :
99+ - slack/status :
100+ include_project_field : false
101+ failure_message : " Release failed for bitcoin-wallet.binary.com with version *$(cat version)*"
102+ success_message : " Release succeeded for bitcoin-wallet.binary.com with version *$(cat version)*"
103+ webhook : ${SLACK_WEBHOOK}
101104jobs :
102105 release_production :
103106 docker :
104107 - image : circleci/ruby:2.6.5
105108 steps :
106109 - git_checkout_from_cache
107- - docker_build
108- - docker_push
109- - k8s_deploy
110- - deploy_gh_pages :
110+ - deploy :
111111 target_branch : " production"
112-
112+ - notify_slack
113+ release_aws_production :
114+ docker :
115+ - image : circleci/ruby:2.6.5
116+ steps :
117+ - git_checkout_from_cache
118+ - docker_build_push
119+ - k8s_deploy
113120workflows :
114121 release :
115122 jobs :
@@ -119,4 +126,10 @@ workflows:
119126 ignore : /.*/
120127 tags :
121128 only : /^production.*/
122- context : binary-frontend-artifact-upload # context name needed to be changed here
129+ - release_aws_production :
130+ filters :
131+ branches :
132+ ignore : /.*/
133+ tags :
134+ only : /^production.*/
135+ context : binary-frontend-artifact-upload
0 commit comments