Skip to content

Commit

Permalink
[HV & CI] HV sdk version bump from 4.1.1 to 4.1.6. CI updated to allo…
Browse files Browse the repository at this point in the history
…w for same image tag deployments. (#12)

* [HV] sdk version bump from 4.1.1 to 4.1.6.

* [CI] fix.
  • Loading branch information
rsmets authored Jul 7, 2022
1 parent c66cf54 commit 01fdbdf
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
50 changes: 48 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,53 @@ jobs:
cluster-name: << parameters.cluster-name >>
- run:
command: |
kubectl set image deployment/<< parameters.deployment >> << parameters.deployment >>=${AWS_ECR_URL}/<< parameters.repo >>:"${CIRCLE_BRANCH}-${CIRCLE_PREVIOUS_BUILD_NUM}"
# Set the image tag then ensure a rollout is triggered. Thanks to the deployment pod spec being set to always pull this should grab the latest image, even with the same tag.
# ref: https://stackoverflow.com/a/55914480/2631728
kubectl set image deployment/<< parameters.deployment >> << parameters.deployment >>=${AWS_ECR_URL}/<< parameters.repo >>:"dev-latest"
kubectl rollout restart deploy << parameters.deployment >>
# Check deployment rollout status every 10 seconds (max 10 minutes) until complete.
# ref: https://www.jeffgeerling.com/blog/2018/updating-kubernetes-deployment-and-waiting-it-roll-out-shell-script
ATTEMPTS=0
ROLLOUT_STATUS_CMD="kubectl rollout status deployment/<< parameters.deployment >>"
until $ROLLOUT_STATUS_CMD || [ $ATTEMPTS -eq 60 ]; do
$ROLLOUT_STATUS_CMD
ATTEMPTS=$((attempts + 1))
sleep 10
done
name: Deploy container image to dev
- slack/notify:
event: fail
mentions: '@devops-team'
template: basic_fail_1
- slack/notify:
event: pass
template: basic_success_1

deploy-image-test:
docker: # Referencing the python image here, see https://github.com/CircleCI-Public/aws-eks-orb/issues/52#issuecomment-1006838213
- image: cimg/python:3.10
parameters:
cluster-name:
type: string
default: "dev-customer-cluster"
repo:
type: string
deployment:
type: string

steps:
- kubernetes/install
- aws-eks/update-kubeconfig-with-authenticator:
install-kubectl: true
aws-region: ${AWS_REGION}
cluster-name: << parameters.cluster-name >>
- run:
command: |
# Set the image tag then ensure a rollout is triggered. Thanks to the deployment pod spec being set to always pull this should grab the latest image, even with the same tag.
# ref: https://stackoverflow.com/a/55914480/2631728
kubectl set image deployment/<< parameters.deployment >> << parameters.deployment >>=${AWS_ECR_URL}/<< parameters.repo >>:"test-latest"
kubectl rollout restart deploy << parameters.deployment >>
# Check deployment rollout status every 10 seconds (max 10 minutes) until complete.
# ref: https://www.jeffgeerling.com/blog/2018/updating-kubernetes-deployment-and-waiting-it-roll-out-shell-script
Expand Down Expand Up @@ -444,7 +490,7 @@ workflows:
branches:
only:
- test-circleci
- deploy-image:
- deploy-image-test:
name: "deploy-id-verification-demo-test"
context:
- AWS-Dev
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<title>ACME</title>

<script src="https://hv-camera-web-sg.s3-ap-southeast-1.amazonaws.com/[email protected].1/src/sdk.min.js"></script>
<script src="https://hv-camera-web-sg.s3-ap-southeast-1.amazonaws.com/[email protected].6/src/sdk.min.js"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down

0 comments on commit 01fdbdf

Please sign in to comment.