同步Subversion和Harvest SCM存储库?

cwa*_*ash 6 svn scripting integration harvest-scm

如果使用Subversion同步团队中的工作和Harvest作为企业记录系统,您将如何集成Subversion和CA Harvest SCM?

我正在研究的一种方法是创建一个将SVN标签加载到Harvest中的脚本,但是如果其他人之前做过这样的事情或者有更好的方法来解决问题,我很好奇.

jef*_*l8n 4

我最终创建了一个脚本来将 Subversion 同步到 Harvest。我们不必以相反的方式进行同步,但更改脚本来做到这一点并不困难。您可以在此处查看脚本 - > http://developerdad.com/2011/03/28/synchronize-subversion-to-ca-allfusion-harvest/

\n\n

我们\xe2\x80\x99现在正在与我们的Jenkins(以前的Hudson)CI服务器一起使用此脚本,因此在运行每个生产版本时都会创建一个新的Harvest包(由Jenkins设置的%JOB_NAME%变量命名)。

\n\n

更新

\n\n

该网站已经上线和关闭,所以这是脚本:

\n\n
@echo off\n\nREM ###########################################################################\nREM #\nREM # Script file to move changes from Subversion to Harvest\nREM #\nREM ###########################################################################\n\nif "%1" == "" goto usage\n\nsetlocal\n\nset PROJECT_STAGE=-b "" -en "" -st ""\nset VIEW=-vp ""\nset CREDENTIALS=-usr "" -pw ""\nset SUBVERSION_REPO=svn:////trunk/\n\nREM Clean up any build artifacts if present\ncall ant clean\n\nREM Create Harvest package\nhcp %1 %PROJECT_STAGE% %CREDENTIALS%\n\nREM Delete the checked-out Subversion code\nREM Note: You will need to remove everything (except this file of course), so more rmdir or del statements may be required below\nrmdir /S /Q project\n\nREM Check out the files in Harvest to modify\nhco * %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -pn "Check Out Files for Update" -up -r -s * -op pc -cp %CD%\n\nREM Delete the checked-out Harvest code\nREM Note: You will need to remove everything (except this file of course), so more rmdir or del statements may be required below\nrmdir /S /Q project\n\nREM Replace with the latest code from Subversion repository\nsvn co %SUBVERSION_REPO% .\n\nREM Delete the .svn directories\nfor /f "tokens=* delims=" %%i in (\'dir /s /b /a:d *svn\') do (\n  rd /s /q "%%i"\n)\n\nREM What are the updates for Harvest?  Check them into Harvest\nhci * %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -pn "Check In Modified Files" -s * -ur -de "Added in Subversion" -if ne -op pc -cp %CD%\n\nREM Remove the log files from Harvest\nREM Note: You may need to change or remove this statement depending on whether you want the Harvest logs checked in\nhdv *.log %PROJECT_STAGE% %CREDENTIALS% %VIEW% -pn "Delete Versions"\n\nREM What removals from Harvest do we need to process? (What files were deleted in Subversion?)\nhsv %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -it r -s "*"\n\nREM This will not work if the file path has spaces in it.  You can use %%j %%k ... in the -vp switch for one space in your project name (For example, if you have 2 spaces, it should be -vp %%j %%k %%l)\nfor /f "tokens=1-5 skip=3" %%i in (hsv.log) do (\n    if not "%%i"=="hsv" (\n        hci "%%i" %PROJECT_STAGE% %CREDENTIALS% -vp "%%j" -p "%1" -pn "Check In Modified Files" -ro -cp %CD%\n        hri "%%i" %PROJECT_STAGE% %CREDENTIALS% -vp "%%j" -p "%1"\n    )\n)\n\nREM remove read-only attribute from all files\nattrib -r -h * /s\n\nREM delete all harvest.sig files\ndel /f /s /q harvest.sig\n\nendlocal\n\ngoto end\n\n:usage\n\necho USAGE:\necho -----------------------------------------------------------------------------\necho "svn2harvest {package_name}"\necho -----------------------------------------------------------------------------\n\n:end\n
Run Code Online (Sandbox Code Playgroud)\n