如果使用Subversion在整个团队中同步工作,如何将Subversion和CA嘉实SCM集成在一起,并将嘉实作为企业记录系统?
我正在研究的一种方法是创建一个脚本,将SVN标记加载到嘉实中,但我很好奇是否有人以前做过这样的事情,或者有更好的方法来解决这个问题。
发布于 2011-03-29 00:15:01
我最终创建了一个脚本来将Subversion同步到嘉实。我们不需要以另一种方式进行同步,但是更改脚本来实现同步并不难。您可以在此处查看脚本-> http://developerdad.com/2011/03/28/synchronize-subversion-to-ca-allfusion-harvest/
我们现在将此脚本与Jenkins (以前称为Hudson) CI服务器一起使用,以便在运行每个生产构建时创建一个新的收获包(由Jenkins设置的%JOB_NAME%变量命名)。
更新
网站一直处于起伏不定的状态,所以脚本如下:
@echo off
REM ###########################################################################
REM #
REM # Script file to move changes from Subversion to Harvest
REM #
REM ###########################################################################
if "%1" == "" goto usage
setlocal
set PROJECT_STAGE=-b "" -en "" -st ""
set VIEW=-vp ""
set CREDENTIALS=-usr "" -pw ""
set SUBVERSION_REPO=svn:////trunk/
REM Clean up any build artifacts if present
call ant clean
REM Create Harvest package
hcp %1 %PROJECT_STAGE% %CREDENTIALS%
REM Delete the checked-out Subversion code
REM Note: You will need to remove everything (except this file of course), so more rmdir or del statements may be required below
rmdir /S /Q project
REM Check out the files in Harvest to modify
hco * %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -pn "Check Out Files for Update" -up -r -s * -op pc -cp %CD%
REM Delete the checked-out Harvest code
REM Note: You will need to remove everything (except this file of course), so more rmdir or del statements may be required below
rmdir /S /Q project
REM Replace with the latest code from Subversion repository
svn co %SUBVERSION_REPO% .
REM Delete the .svn directories
for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *svn') do (
rd /s /q "%%i"
)
REM What are the updates for Harvest? Check them into Harvest
hci * %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -pn "Check In Modified Files" -s * -ur -de "Added in Subversion" -if ne -op pc -cp %CD%
REM Remove the log files from Harvest
REM Note: You may need to change or remove this statement depending on whether you want the Harvest logs checked in
hdv *.log %PROJECT_STAGE% %CREDENTIALS% %VIEW% -pn "Delete Versions"
REM What removals from Harvest do we need to process? (What files were deleted in Subversion?)
hsv %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -it r -s "*"
REM 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)
for /f "tokens=1-5 skip=3" %%i in (hsv.log) do (
if not "%%i"=="hsv" (
hci "%%i" %PROJECT_STAGE% %CREDENTIALS% -vp "%%j" -p "%1" -pn "Check In Modified Files" -ro -cp %CD%
hri "%%i" %PROJECT_STAGE% %CREDENTIALS% -vp "%%j" -p "%1"
)
)
REM remove read-only attribute from all files
attrib -r -h * /s
REM delete all harvest.sig files
del /f /s /q harvest.sig
endlocal
goto end
:usage
echo USAGE:
echo -----------------------------------------------------------------------------
echo "svn2harvest {package_name}"
echo -----------------------------------------------------------------------------
:end发布于 2009-06-25 11:23:04
我知道,使用subversion,您可以将服务器配置为在每次提交时运行一个脚本,该脚本可能能够调用CA收获上的一些函数。
如果您正在使用Eclipse,另一种选择是使用Mylyn进行集成。Mylyn与Subversion集成在一起,我认为有一个用于CA收获的Eclipse插件--也许它们都能很好地协同工作?
发布于 2014-05-28 23:37:20
@ECHO OFF
REM By Developer Dad
REM ###########################################################################
REM #
REM # Archivo script para mover los cambios desde el SVN al Harvest
REM #
REM ###########################################################################
IF "%1" == "" GOTO usage
REM Enable local environment to be changed without affecting anything else
REM
SETLOCAL
SET PROJECT_STAGE=-b "" -en "" -st ""
SET VIEW=-vp ""
SET CREDENTIALS=-usr "" -pw ""
SET SUBVERSION_REPO=svn:////trunk/
REM Clean up any build artifacts if present
REM
CALL NAnt clean
REM Create Harvest package
REM
HCP %1 %PROJECT_STAGE% %CREDENTIALS%
REM Delete the checked-out Subversion code
REM Note: You will need to remove everything (except this file of course), so more RMDIR or del statements may be required below
REM
RMDIR /S /Q project
REM Check out the files in Harvest to modify
REM
HCO * %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -pn "Check Out Files for Update" -up -r -s * -op pc -cp %CD%
REM Delete the checked-out Harvest code
REM Note: You will need to remove everything (except this file of course), so more RMDIR or del statements may be required below
REM
RMDIR /S /Q project
REM Replace with the latest code from Subversion repository
REM
SVN co %SUBVERSION_REPO% .
REM Delete the .svn directories
REM
FOR /f "tokens=* delims=" %%i IN ('DIR /s /b /a:d *svn') DO (
RD /s /q "%%i"
)
REM What are the updates for Harvest? Check them into Harvest
REM
HCI * %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -pn "Check In Modified Files" -s * -ur -de "Added in Subversion" -if ne -op pc -cp %CD%
REM Remove the log files from Harvest
REM Note: You may need to change or remove this statement depending on whether you want the Harvest logs checked in
REM
HDV *.log %PROJECT_STAGE% %CREDENTIALS% %VIEW% -pn "Delete Versions"
REM What removals from Harvest do we need to process? (What files were deleted in Subversion?)
REM
HSV %PROJECT_STAGE% %CREDENTIALS% %VIEW% -p "%1" -it r -s "*"
REM 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)
REM
FOR /f "tokens=1-5 skip=3" %%i IN (hsv.log) DO (
IF NOT "%%i"=="hsv" (
HCI "%%i" %PROJECT_STAGE% %CREDENTIALS% -vp "%%j" -p "%1" -pn "Check In Modified Files" -ro -cp %CD%
HRI "%%i" %PROJECT_STAGE% %CREDENTIALS% -vp "%%j" -p "%1"
)
)
REM remove read-only attribute from all files
REM
ATTRIB -r -h * /s
REM delete all harvest.sig files
REM
DEL /f /s /q harvest.sig
ENDLOCAL
GOTO end
:usage
ECHO USAGE:
ECHO -----------------------------------------------------------------------------
ECHO "svn2harvest {package_name}"
ECHO -----------------------------------------------------------------------------
:endhttps://stackoverflow.com/questions/965379
复制相似问题