Hey,
I’m trying to build and tag a container using aws ecr and then deploying it but I’m having difficulties getting the sha of the tagged container.
This is my yaml.
version: 2.1
orbs:
aws-ecr: circleci/aws-ecr@8.2.1
circleci-argo: joaogl/circleci-argo@0.1.13
commands:
build:
parameters:
tag:
type: string
steps:
- aws-ecr/build-and-push-image:
dockerfile: Dockerfile
repo: api
tag: << parameters.tag >>
jobs:
build-dev:
docker:
- image: cimg/base:stable
resource_class: small
steps:
- setup_remote_docker:
version: 20.10.11
- build:
tag: $CIRCLE_SHA1
deploy-dev-env:
docker:
- image: cimg/base:stable
resource_class: small
parameters:
env:
type: string
branch:
type: string
steps:
- circleci-argo/update-tag-yaml:
file-path: api/templates/<<parameters.env>>/api.yaml
app-name: api
app-tag: $CIRCLE_SHA1
gitops-repo: git@github.com:myrepo/repo.git
gitops-username: CircleCI deployer
gitops-email: deployer@me.io
gitops-deploy-branch: <<parameters.branch>>
gitops-repo-ssh-key-fingerprint: $SSH_KEY_FINGERPRINT
gitops-repo-ssh-key-host: github.com
gitops-repo-ssh-key-hostname: github.com
workflows:
build-pre-staging:
jobs:
- build-dev:
context:
- aws_ecr
filters:
tags:
ignore:
- /.*/
- hold-deploy-dev-env:
type: approval
requires:
- build-dev
- deploy-dev-env:
env: dev
branch: staging
context:
- gitops-repo
requires:
- hold-deploy-dev-env
Basically everything seems to be working the only thing I’m not sure of is, how do I get the sha of the container pushed and how do I use it in the app-tag param.
For some reason right now it’s not even passing the actual commit sha, it’s somehow passing just ‘$CIRCLE_SHA1’
Any help would be greatly appreciated.
Thanks!