问题
Are there any plugins available which will commit the build artifact back to SVN?
回答1:
I believe the svn publisher will meet your needs.
回答2:
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.
来源:https://stackoverflow.com/questions/2446136/plugin-to-commit-hudson-build-artifact