Hi everyone!
We are in the middle of transition to bitbucket pipelines.
We build docker images from every git branch and run tests against these images. To make tracking of what image was build from what branch easier we tag docker images with git branch name it was built from.
The problem is that feature branches have slash "/' in their name and slash is not allowed in docker image tag. What we used to do is replace slashes with dashes and use that as a tag.
One option for us would be to use a script that does that substitution and pushes image, but we would have to put that script in every repository.
To use pipe atlassian/aws-ecr-push-image:1.2.2 we tried to define tags as
TAGS: '${BITBUCKET_BRANCH//\//-}'
or
TAGS: ${BITBUCKET_BRANCH//\//-}but it does not work and build fails with
<span>Image not found: 404 Client Error: Not Found </span>
<span>Image not found: 404 Client Error: Not Found ("no such image: whatever: No such image: whatever:latest")</span> We also tried to add a separate step that does replacement and exports result as another variable, but that did not work either.
Changing naming convention would cause a lot of pain, many scripts rely on existing scripts rely on that naming convention.