Jenkins - Updating a String Changelog During the Build Phase

I noticed that if you use Jenkins with the SVN or CVS parameter, a changelog.xml file is created for each assembly, containing the author and a commit message for this assembly.

Unfortunately, in my setup, I do not use SVN or CVS, so I cannot use the change parser. I was wondering whether it is possible to create your own change log with the same format (eg, SVN XML log of changes), and then specify Jenkins on him during the assembly process. Thus, when someone clicks on a change to the assembly, they can see what has changed and who changed it.

I tried to just create changelog.xml file and then update the build.xml, to use the SVN parser, but the two issues that I noticed:
1) You need to reload the configuration files so that they appear in
2) Build.xml not created until the job is completed.

There is some information about the parser changes, but it seems that you can not just have access to it during the assembly step: https://wiki.jenkins-ci.org/display/JENKINS/Change+log

+4
source share
1 answer

Maybe, groovy scripts system would be a good direction (plug groovy script). Simply add a new script as an assembly step. You can get access to the object AbstractBuild, running the following code:

import hudson.model.* import hudson.util.* import hudson.scm.* def thr = Thread.currentThread() def build = thr?.executable 

I'm trying to solve a similar problem at the moment, but my use case has changed a bit. I'm trying to copy changes from the Upstream project in the same way as it does BlameSubversion plugin. Unfortunately, I cannot use the SCM plugin mentioned above because it does not work with post-commit-hook, so I need to write my own solution.

Take a look at the copyChangeLogFromTriggerJob and copyRevisionFromTriggerJob methods to find out how BlameSubversion does it.

I can copy changes and changes, but I'm still struggling with ChangeLogParser. I would be glad for any help.

0
source

All Articles