exodus
exodus

Reputation: 3

Stash Pull Request Builder plugin for Jenkins custom variables in comments

I have the Stash pull request builder plugin working great in Jenkins, it see's a pull request and kicks off the Jenkins job which runs some tests and puts a generic comment on the pull request saying pass or fail.

The problem I'm having is when the plugin comments back to the pull request I'd like to use a variable I create in the post build section, I've tried creating the variable as an environment variable but it seems the comments part of the plugin can only see the built in Jenkins variables like ${BUILD_NUMBER} anything else just prints out the name directly.

I've had a look at envinject, but I'm not sure how to set a variable from it in the post build section, or even if the variables it creates would be seen by the Pull Request Builder Plugin.

Upvotes: 0

Views: 531

Answers (1)

Bruno Lavit
Bruno Lavit

Reputation: 10382

I did a quick test with my Jenkins/Stash platform.

I have a job using this custom variable:

enter image description here

I've added a post-build step to publish a custom comment:

enter image description here

We can see that my SCM_REVISION environment variable is displayed in Stash:

enter image description here

I hope it helped :)

Upvotes: 0

Related Questions