Plugin to commit hudson build artifact

前端 未结 2 1562
轮回少年
轮回少年 2021-01-21 11:08

Are there any plugins available which will commit the build artifact back to SVN?

2条回答
  •  无人及你
    2021-01-21 11:17

    Unfortunately Svn Publisher is not really finished and requires quite a bit more work before I can use it in anger.

    I've found I can do what I need with a shell/cmd script executed as a build action (or of course post-build would work), although it's not really ideal. The script just uses standard svn command line functions and looks something like:

    svn mkdir http://my.server:port/project/branches/buildArtifacts/${BUILD_ID}/ --username USERNAME --password PASSWORD -m "JIRA_ISSUE This is a commit message"
    
    svn co http://my.server:port/project/branches/buildArtifacts/${BUILD_ID}/ BuildArtifacts --username USERNAME --password PASSWORD
    
    cd BuildArtifacts
    cp ../../build/${BUILD_ID}/*.xml .
    
    svn add *
    
    svn ci --username USERNAME --password PASSWORD -m "JIRA_ISSUE This is a commit message"
    

    So, we create the new folder for the build artifacts in Subversion, check it out to a local (in-workspace) folder, copy what we want in, svn add those items then commit everything back.

    Personally, I am still not sold on the benefit of having build reports in Subversion, but we need to have persistent storage of this information -- the Jenkins server isn't a good repository for it.

    Writing a custom plugin or actually fixing Svn Publisher would be a better solution long term.

提交回复
热议问题