Log changes in Jenkins

后端 未结 4 609
天涯浪人
天涯浪人 2021-01-15 12:09

Continuing on my question here: Jenkins pass or fail build on external executable

My build process now builds from source using MS Build, and executes a custom progr

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-15 12:26

    Here's what I did to add my own log to the normal Jenkins 'Changes' link per build: I ended up having to write my svn ant routines (using svnant) to do checkouts and updates etc...

    My Trick To Make it Work:
    1.) Under "Source Code Management" add "Subversion Modules". Do not fill out the section. I do not want it to check anything out. I have to do this to make Jenkins show the changelog.xml file I create, otherwise it can exist but Jenkins will not show it. In the job config.xml file you will see SCM...null... without this. When you add the empty svn repo, it thinks you are using svn and then lets your changelog.xml show up. (who knows how long this will work?)

    In your build you want to do these steps in this order:
    2.) write a create-changelog target. it should find the revision of code in your build folder. find the revision of code in svn. do svn log asXml="true" or "--xml" from start-rev to stop-rev. concat multiple log files together if needed to create ${Jenkins_Home}/jobs/${MYJOB}/builds/${BUILD_NUMBER}/changelog.xml

    3.) now you can delete $workspace area if you want to.

    4.) svn checkout of update

    5.) build

    6.) after build, 'Changes' link will show your changelog.xml

    Problems I had:
    scm polling did not do tags.
    scm url was not flexible enough.
    groovy-postbuild-plugin messed up my jenkins ui so I could not use it at this time.
    sidebar-link-plugin does not seem to let you do it for each build. You might be able to do something with other plugins for build history, but I did not pursue it at this point.

提交回复
热议问题