Linux various software Installation-jenkins and SVN combination

Source: Internet
Author: User
Tags svn aliyun

Typically, the code is modified, packaged, uploaded, published, and published in this order.

With Jenkins, these repetitive operations can be handled automatically by the program. You can even specify the timing of a release, such as submitting an SVN once, releasing it automatically, and publishing it regularly every day.

1: Install Jenkins

wget Http://mirrors.jenkins-ci.org/war/latest/jenkins.war

2: Put the package under Tomcat under WebApps, (of course WebApps path can be modified to its own deployment path)

3:ip:8080/jenkins

View initial Password: cat/root/. Jenkins/secrets/initialadminpassword

Oh, I forgot to install maven.

1. Download maven

wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz

2. Extract to/usr/local directory

TAR-ZXVF apache-maven-3.2.5-bin.tar.gz

3, configure the domestic source

In/usr/local/apache-maven-3.2.5/conf/settings.xml

Add the following in mirrors

<mirror><id>alimaven</id><name>aliyun maven</name><url>http:// Maven.aliyun.com/nexus/content/groups/public/</url><mirrorof>central</mirrorof></mirror >

4, configure the environment variable etc/profile Last add the following two lines

    1. Export maven_home=/usr/local/apache-maven-3.2.5
    2. Export Path=${path}:${maven_home}/bin
    3. Source/etc/profile

5: Test Mvn-v

The next step is to configure the SVN link to link the two together.

1: First you need to add a Tomcat user and assign the appropriate administrator role

Enter/usr/local/tomcat/conf

VI tomcat-users.xml Add the following:

<role rolename= "Manager-gui"/>
<role rolename= "Manager-script"/>
<role rolename= "Manager-jmx"/>
<role rolename= "Manager-status"/>

<user username= "Tomcat" password= "Tomcat" roles= "Manager-gui,manager-script,manager-jmx,manager-status"/>

2: For tomcat8.5 There is a pit of the place, also need to change a file, in order to let http://IP:8080/manager/html can access,

Enter/usr/local/tomcat/webapps/manager/meta-inf

VI Context.xml to comment out this paragraph

<!--<valve Classname= "Org.apache.catalina.valves.RemoteAddrValve"
allow= "127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"/>-->

3: Modify the configuration of Jenkins

Go to Global tool configuration, add Maven path

Then select the Admin plugin and install a plugin called "Deploy to Container Plugin"

4: Back to the project, select "Configure"

Fill in the project name and description and use the custom workspace.

Configure the SVN address and username password so that Jenkins gets the source from SVN

Configure Maven

Add post-build operation, select "Deploy war/ear to a container", here to fill in a user name and password, is the tomcat-users.xml configuration of the User,tomcat/tomcat

Note: If the WebApps is posted to tomcat, the context path does not need to be filled in, otherwise Jenkins cannot copy the war package into the Tomcat directory.

5: Click "Build Now" to get it done.

Linux various software Installation-jenkins and SVN combination

Related Article

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.