blank
blank

Reputation: 18170

How do I pass the svn_revision parameter to downstream builds in Jenkins?

I want to have the svn revision number that kicked off the parent build available to downstream jobs. Is this possible?

I'm using the Build Pipline plugin to manually trigger some downstream jobs.

Upvotes: 1

Views: 2025

Answers (1)

blank
blank

Reputation: 18170

The only way I've found to do this is like so:

In my build.xml which is fired by the first job I have access to the env.SVN_REVISION parameter, I then write this to a pipeline.properties file and archive this.

    <propertyfile file="pipeline.properties" >
      <entry key="svn.revision" value="${env.SVN_REVISION}"/>
    </propertyfile>

Each downstream job then just reads the property from the archived pipeline.properties file from the upstream build that triggered them, with the help of the copy artifact plugin.

Upvotes: 1

Related Questions