Jenkins Configuration SVN automatic deployment

Source: Internet
Author: User
Tags svn ssh tomcat
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.