Linux-jenkins, MAVEN installation +git auto-integration

Source: Internet
Author: User
Tags server port

Jenkins+maven+git Automatic integrated installation:
In the server where Jenkins is installed, you must have a basic environment in which you can: Code Clone (Git), code compilation (Maven), Code Run (TOMCAT) to complete the auto-integration, PS:JDK first install the configuration.
First, install Git
#sudo Yum Install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-extutils-makemaker
Second, ubuntu16.04 install Maven
1. Download maven to/opt/apache-maven-3.5.2
2. Configure the MAVEN environment variable ETC/PROFILE configuration statement as follows:
Export maven_home=/opt/apache-maven-3.5.2
Export path= $JAVA _home/bin: $PATH: $ (maven_home)/bin
--Add after Path: $ (maven_home)/bin

3.source/etc/profile Update configuration file
4. Verify that MVN-V is successful:

5. Modify the MAVEN source and warehouse default storage path: Increase the speed of packaging jar packages
/opt/apache-maven-3.5.2/conf/settings.xml


Because the test environment directly download the development of the submitted code, in order to improve the download speed, the address is changed to the Development server intranet address
iii.. Installation of Jenkins
Download Jenkins installation package Jenkins.war
Decompression apache-tomcat-8.5.4.tar.gz
Create a new directory to store Jenkins
Mkdir/opt/jenkins
MV apache-tomcat-8.5.4/opt/jenkins/apache-tomcat-8.5.4
Put Jenkins's war package under the Tomcat service, which is/opt/jenkins/apache-tomcat-8.5.4/webapps
(1) Start port, the default port is 8080, there will be conflict, modify the lower port is best, modify the configuration file
/opt/jenkins/apache-tomcat-8.5.4/conf/server.xml

(2) Modify the shutdown port (default is 8005 port, prevent multiple tomcat port conflicts)
<server port= "8005" shutdown= "Shutdown" >
Change 8005 to a port number that is not in use, such as 8088
(3) Modify JVM boot port (default is 8009 port)

Modify and start Tomcat to enter http://localhost: Port number/jenkins go to Jenkins home Page three, use jenkins:***1. New item***! [] (http://i2.51cto.com/images/blog/201712/25/1fdc91d17ef0caa75a86cf6856310304.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) Choose to build a free-style software project, enter the project name (according to the actual), and click OK ***2. Enter the source address ***! [] (http://i2.51cto.com/images/blog/201712/25/26edfb3b84051cef9f152b2492ac227d.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) If this option is not available, because the plugin is not downloaded when the configuration is installed, you can download the required plugins in the system Management-management plugin! [] (http://i2.51cto.com/images/blog/201712/25/f0ca903ed4ea39781bc8c12c8288a029.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) Required plugins: Git plugin and GitHub plugin go into system Management--system settings settings for Jenkins parameters. The main is to set the parameters of Git and GitHub plug-ins, in Git, path to executable column to add the local git.exe path, in git Plugin add local git user.name and user.email information on GitHub Web HOok to add information about your GitHub account. If you want to use the function of the message, you need to add the SMTP server and mailbox information in the Mail Notification column, and then click the Test button after adding the message, this function can be used in the subsequent projects to make the email notification function normal use. * Build Step settings: *! [] (http://i2.51cto.com/images/blog/201712/25/5d23f243c224d22b27bc992e4d1d4058.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) You can set up a Send build message: ***! [] (http://i2.51cto.com/images/blog/201712/25/bbb32a6da126ca76d8707883be33b5bf.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) Once set up, you can click Build now to see if the configuration is correct. PS: In the shell statement in the first sentence debugging is better, especially the removal of the package step to note that you can view the detailed build information in the console:! [] (http://i2.51cto.com/images/blog/201712/25/f296ba63553733f31ed72c11444591b9.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) More intuitive results:! [] (http://i2.51cto.com/images/blog/201712/25/64a0b18139b6626c4996f1affab9c715.png?x-oss-process=image/ Watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=) Note: In the debugging process to pay attention to the error log, Before encountering a problem is unable to find server-module in the server-* name of the file, carefully read the error log, the file name after the space, that is, the time in the build step shell statement There are extra spaces =-=, because I was copied and pasted, so it may have a bit of influence, Hand over again, after the removal and re-hand after the call OK, is also more fan ...

Linux-jenkins, MAVEN installation +git auto-integration

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.