Bamboo variable injection with Docker pull

I have a build job that in one task generates a specific docker tag and writes the tag to a properties file:

dockerTag=$(head -n 1 ci/dockertag)
echo "dockerTag=${dockerTag}" > docker-tag.properties

This results in docker-tag.properties containing something like:

dockerTag=0.0.2

The next task is Inject Bamboo variables, specifying "docker-tag.properties" as the properties file and "myproject" as the namespace, to make the "dockerTag" variable available to next tasks in the job. Tried both Local and Result radio options.

Next task is Docker pull, I need to use Bamboo Docker integration rather than a generic script because its pulling from a private registry and needs to provide credentials. The problem is when specifying the image to pull as follows:

docker.mycustom.registry/mynamespace/myimage:${bamboo.inject.myproject.dockerTag}

 The variable substitution doesn't seem to be working, looking at the log file, it's literally trying to pull an image name with the "${bamboo...":

docker pull docker.mycustom.registry/mynamespace/myimage:$%7Bbamboo.inject.myproject.dockerTag%7D

I have verified that the variable substitution is available from earlier in the log:

Injected variable bamboo.myproject.dockerTag=0.0.2 in LOCAL scope

Also the image:tag is available in the private registry.

Does anyone know how to make the docker pull command use bamboo's variables?

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

540 views 0 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you