Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Jenkins variables to create the release version. #28

Open
superdale opened this issue Nov 19, 2018 · 5 comments
Open

Using Jenkins variables to create the release version. #28

superdale opened this issue Nov 19, 2018 · 5 comments

Comments

@superdale
Copy link

I am trying to create a release version using Jenkin variable $BUILD_NUMBER. I enter the variable in the plugin field it does not pull the value from Jenkins. How can I get this to work?

@motowilliams
Copy link

I'm in the same boat @badriance. The log is showing the actual templated value and the REST API ends up throwing with an error saying "$BUILD_NUMBER is not a valid release number format"

@badriance
Copy link
Contributor

Did the instructions in the readme not work?

Environment variables can be used in many fields in the Release and Deployment components of this plugin. Any variable, written as ${VARIABLE_NAME} will get replaced by that variable's value. If there is no value set for that variable, the token is not replaced.

@codingbadger
Copy link

This issue is still happening when using Jenkins Pipelines. Any idea when it will be fixed?

Using the example from the docs
e.g.

octopusPushPackage overwriteMode: 'FailIfExists', packagePaths: './artifacts/OctoPetShop.1.1.${BUILD_NUMBER}.zip', serverId: 'octopus-server', spaceId: 'Spaces-1', toolId: 'octocli'

The variable ${BUILD_NUMBER} is not substituted and causes an error.

It works fine for the Push Package Info example though

@spallister
Copy link

Hi @codingbadger - suspect you may have already sorted things out at this point, but I came across a similar issue with my interpolated string not resolving as expected. After taking a look at: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#string-interpolation, it became clear that I had to use double quotes instead of single quotes.

Perhaps this was your issue as well?

@AndreCbrera
Copy link

This issue is still happening when using Jenkins Pipelines. Any idea when it will be fixed?

Using the example from the docs e.g.

octopusPushPackage overwriteMode: 'FailIfExists', packagePaths: './artifacts/OctoPetShop.1.1.${BUILD_NUMBER}.zip', serverId: 'octopus-server', spaceId: 'Spaces-1', toolId: 'octocli'

The variable ${BUILD_NUMBER} is not substituted and causes an error.

It works fine for the Push Package Info example though

try this ${env.BUILD_NUMBER} :

octopusPushPackage overwriteMode: 'FailIfExists', packagePaths: './artifacts/OctoPetShop.1.1.${env.BUILD_NUMBER}.zip', serverId: 'octopus-server', spaceId: 'Spaces-1', toolId: 'octocli'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants