I’m attempting to update aws-ecr orb version 8.x to 9.0.2. I’m running into some issues with tags. Previously we had:
tag: "$(git log --pretty=format:'%ad' --date=iso -n 1| awk '{print $1}'|tr '-' '.')-$CIRCLE_BUILD_NUM,$(echo $CIRCLE_SHA1|cut -c -7)"
And this worked as expected, creating two tags 2024.01.24-1234
and 4e035af
.
In 9.0.2 though, this fails and it appears that the shell script bits aren’t being parsed anymore - in the log for a 9.0.2 run, I’m seeing:
+ docker buildx build -f ./Dockerfile -t '************.dkr.ecr.*********.amazonaws.com/org/app:$(git' log '--pretty=format:'\''%ad'\''' --date=iso -n '1|' awk ''\''{print' '}'\''|tr' ''\''-'\''' ''\''.'\'')-761' -t '************.dkr.ecr.*********.amazonaws.com/org/app:$(echo' '10afb4b4f192a0ef3d39402e02ec7a749db1f3ed|cut' -c '-7)' --platform linux/amd64 --progress plain --push .
Where the log for 8.2.1 shows that the shell bits were parsed before the docker call:
+ docker buildx build -f ./Dockerfile -t ************.dkr.ecr.*********.amazonaws.com/org/app:2024.01.24-752 -t ************.dkr.ecr.*********.amazonaws.com/org/app:3780b97 --platform linux/amd64 --progress plain --push .
Is there a different syntax I can use or a better way to handle this now that the embedded shell script is broken? I’ve tried a run-command with an export, but that doesn’t work. How can we do simple dynamic tagging using 9.0.2?