Jenkins Configuration SVN automatic deployment
After the Jenkins environment is set up, you need to configure the project, which is also introduced here. Create a new project
Click New
Enter project name
Choose: Build a free-style software project
Click OK
Enter Item description
Configure build retention and maximum number of days
Enter SVN project address
Select username & Password #如果没有就, click Add yourself
Configure Daily 1:15AM Build
Configure each SCM version change to build
Configure delete directory before each build, place build generated files resulting in SVN not updating normally
Add Build:
cd/home/xxx/.jenkins/workspace/fft-bill-web/&& ant #打开工作目录, the project is updated to this directory, and the ant command is executed to pack
cd/home/xxx /.jenkins/workspace/fft-bill-web/release/#打开war Directory, the package will be placed in this directory
mv Xxxx-1.0.0.0.war Xxx.war #给war包重新命名
SCP Xxx.war user@192.xxx.xxx.xxx:/opt/tomcat-xxxx/webapps #把war包发送到指定服务器目录
ssh user@192.xxx.xxx.xxx "CD/ Xxx/xxx/tomcat-xxxx/bin && sh shutdown.sh "#远程关闭 tomcat
ssh user@192.xxx.xxx.xxx" cd/xxx/xxx/tomcat-xxxx/ Bin && sh startup.sh "#远程命令启动 Tomcat
Here the basic configuration is complete, click Build now, try it.
You can also add some post-build steps, such as sending a message, and so on.