Linux Server Jenkins Environment setup

Source: Internet
Author: User
Tags server port cloudbees

First, the concept of continuous integration

1.1: A general overview

Continuous integration continuous integration continuous delivery continuous Delivery continuous deployment continuous Deployment

1.2: What is continuous integration:

Continuous integration means that developers can frequently integrate code deployment into the backbone during the development of the code, and process automated testing

1.3: What is continuous delivery:

Continuous delivery refers to the deployment of code to a pre-production environment based on an environment that is continuously integrated

1.4: Continuous Deployment:

On the basis of continuous delivery, automating the process of deploying to a production environment, the difference between continuous deployment and continuous delivery is that the final deployment to the production environment is automated.

Second, environmental support

2.1 JDK Environment

Step 1: Find the required JDK version on the Web for resources download, the JDK version I downloaded is: 1.8.0_11,jdk-8u11-linux-x64.tar.gz

Step 2:liunx the system to create a Java file in the USR directory; command: Mkdir/usr/java

Step 3:JDK Compression Package import liunx Environment, command: RZ

Step 4: Extract the JDK, command: TAR-XZVF jdk-8u11-linux-x64.tar.gz

Step 5: Check if the unpacked JDK has a compressed package, the SRC file of the compressed package I downloaded is compressed in zip format. I created the src file first, then unzipped src.zip, command: unzip-o-d src src.zip

Step 6:vim/etc/profile

Step 7: Add the code to the profile:

Java_home=/usr/java/jdk1.8.0_11Jre_home=/usr/java/jdk1.8.0_11/jrepath= $JAVA _home/bin: $JRE _home/bin: $PATHclasspath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport java_home jre_home PATH CLASSPATHNote here: path in the configuration, be sure to put $java_home/bin in front, or use Java command, the system will find the previous Java, will not look down. In this way, the JAVA executable file run directory is not $java_home/bin, and in other directories, will cause a lot of problems.

Step 8:source/etc/profile make the modified file effective

It's almost over here, and finally we check to see if the configured JDK is in effect: The 1.javac is correctly configured without error, and you can write Java code. 2.java-version See if the configured JDK version, 3.echo $JAVA _hom, Echo $PATH, and so on, see if the configured global variables are correct 2.2 Tomcat EnvironmentStep one: Download the Linux version of Tomcat; the Tomcat version I chose is 8.5.20tomcat:http://tomcat.apache.org/download-80.cgi (Apache website)

Step Two: Create the/data directory under the/USR directory of the Linux system and import the apache-tomcat-8.5.20.tar.gz into the directory

Step three: Extract, command: TAR-XZVF apache-tomcat-8.5.20.tar.gz

Step three: Modify the catalina.sh file in the Tomcat/bin directory to add the Java environment variable information

Export java_home=/usr/java/jdk1.7.0_25export classpath=.: $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/libexport path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin

Step four: Modify the Service.xml configuration file, mainly modify several ports

(1) Modify the HTTP access port (the default is 8080 port, modify to infrequently used port, so as not to conflict)

<connector port= "8080" maxhttpheadersize= "8192" maxthreads= "" "minsparethreads=" maxsparethreads= "75" Enablelookups= "false" redirectport= "8443" acceptcount= "" connectiontimeout= "20000" disableuploadtimeout= "true"/ > modifies 8080 to the port number that the first Tomcat is not using. The port number you set here is the port number that you will use to access the web later.

(2) Modify shutdown port (default is 8005 port, prevent multiple Tomcat port conflict not to get up)
<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)
<!--Define an AJP 1.3 Connector on port 8009-
<connector port= "8009"
Enablelookups= "false" redirectport= "8443" protocol= "ajp/1.3"/>

Step five: Start Tomcat, execute the start.sh file

2.3 Other environments

1. The firewall is in the off state. 2. The server is connected to a networked state. 3. Into the automation script is Python, then you need to configure the Python environment.

2.4 Jenkins Configuration

Step one, download Jenkins.war package online;: http://ip:port/jenkins

Step two, the war package is imported into Tomcat's WebApps directory

Step three, start Tomcat, execute the startup.sh file in the bin directory

Step four, browser access to Jenkins; IP: Port/jenkins

Step Five, enter Jenkins there is a wait page, you need to enter the verification, according to the path of the page to find the Initialadminpassword file, the contents of the file is the verification code

Step six, install plug-ins, and sometimes reported similar errors: An error occurred during installation:no such plugin:cloudbees-folder

The above error shows that the installation plugin Cloudbees-folder failed because there is no Cloudbees-folder plugin in the downloaded Jenkins.war.

Need to download on-line: http://ftp.icm.edu.pl/packages/jenkins/plugins/cloudbees-folder/

Download Cloudbees-folder.hpi on/usr/local/tomcatjenkins-8090/webapps/jenkins/web-inf/detached-plugins

Step seven, restart Tomcat, browser access to Jenkins server, set user name, password, etc., and then go to the Jenkins home page, here we can according to their own needs to do the corresponding configuration of Jenkins

Linux Server Jenkins Environment setup

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.