jenkinsci / jenkinsci/docker-plugin

[JENKINS-39104] Add new template build step should do variable substitution

Open
#1,274 0 comments 0 reactions 0 assignees View on GitHub
component:docker-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
498
Forks
324
Avg merge
1d 2h
Merged PRs (30d)
2

Description

The "Add a new template to all docker clouds" build step makes an excellent follow-on build step to the "Build / Publish Docker Containers" build step.

e.g. you can create an image tagged as myregistry:1234/myimage:version-${BUILD_NUMBER} and you'll get myimage:version-1, myimage:version-2 etc pushed to your registry in subsequent builds.

However, if you use the "Add a new template to all docker clouds" build step and specify a "Docker Image" field of "myregistry:1234/myimage:version-${BUILD_NUMBER}" then that's exactly what you'll get - it won't replace ${BUILD_NUMBER} with the build number.

What should happen is that all of the plain-text fields should be subjected to Jenkins' variable substitution so that all text fields can be parameterised.

---
Originally reported by pjdarton, imported from: Add new template build step should do variable substitution


  • status: Open
  • priority: Minor
  • component(s): docker-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 4
  • imported: 20260709-204134

Raw content of original issue

The "Add a new template to all docker clouds" build step makes an excellent follow-on build step to the "Build / Publish Docker Containers" build step.
e.g. you can create an image tagged as myregistry:1234/myimage:version-${BUILD_NUMBER} and you'll get myimage:version-1, myimage:version-2 etc pushed to your registry in subsequent builds.
However, if you use the "Add a new template to all docker clouds" build step and specify a "Docker Image" field of "myregistry:1234/myimage:version-${BUILD_NUMBER}" then that's exactly what you'll get - it won't replace ${BUILD_NUMBER} with the build number.

What should happen is that all of the plain-text fields should be subjected to Jenkins' variable substitution so that all text fields can be parameterised.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.