Let’s take a look at our deployment cicle.
Note: We are planning to use Image Reflector Controller and Image Automation Controller to automate this further.
Let’s take a look at how we have configured CircleCI. This is a minimalistic configuration. We are planning to improve the setup with Orbs later on.
We have the following config.yml in each of our repositories.
Directory structure
.circleci
--config.yml
Content of .config.yml
version: 2.1
jobs:
build-and-push:
docker:
- image: cimg/node:21.7.1
steps:
- setup_remote_docker
- checkout
- run:
name: Login to Azure Container Registry
command: docker login -u $AZURE_ACR_USERNAME -p $AZURE_ACR_PASSWORD $AZURE_ACR_LOGIN_SERVER
- run:
name: Build Docker image
command: |
docker build -t $CIRCLE_PROJECT_REPONAME .
- run:
name: Tag Docker image
command: |
docker tag $CIRCLE_PROJECT_REPONAME $AZURE_ACR_LOGIN_SERVER/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1
- run:
name: Push Docker image to Azure Container Registry
command: |
docker push $AZURE_ACR_LOGIN_SERVER/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1
workflows:
build-and-push-image:
jobs:
- build-and-push:
context:
- registry
filters:
branches:
only:
- main
Above environment variables comes from CircleCI context called “registry”.
Where
Please note that we changed our release process later to use semantic versioning. See the docs