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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

54 views 1 0
Join discussion

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