1、选择新建Maven项目;

2、添加项目名、描述;

3、勾选丢弃旧的构建;

4、勾选参数化构建过程,把分支名称单独处理;


5、编辑源码管理块;


6、编辑Build配置;


7、编辑Post Steps,处理构建完成后做的事情,因为CI服务器是Windows服务器,所以添加Execute Windows batch command,这里的作用是将新的构建好的内容,提交到SVN上,等待最终发布生产。

cd F:\publish\MyProj\demo_MyProj_service\
svn update
rd /Q/S F:\publish\MyProj\demo_MyProj_service\WEB-INF
rd /Q/S F:\publish\MyProj\demo_MyProj_service\META-INF
copy %WORKSPACE%\restart.txt %WORKSPACE%\target\javaMyProj-service-1.0-SNAPSHOT\WEB-INF
xcopy /e %WORKSPACE%\target\javaMyProj-service-1.0-SNAPSHOT F:\publish\MyProj\demo_MyProj_service
svn add F:\publish\MyProj\demo_MyProj_service\WEB-INF\* --force
svn status | sed -e '/!/!d' -e 's/!//' >> 1.txt
for /f %%i in (1.txt) do svn rm %%i
rm 1.txt
svn commit F:\publish\MyProj\demo_MyProj_service -m "aotu commit by jenkins,JOB_NAME=%JOB_NAME%,BUILD_NUMBER=%BUILD_NUMBER%,GIT_BRANCH=%BRANCH_SPECIFIER%"




Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐