Jenkins automates deployment and service restart-Beginner

Source: Internet
Author: User

Jenkinsautomate deployment and service restart-PrimaryI. Description

Deploying Jenkins is primarily used for Web -Interface code uploads, production service restarts. the code package in SVN is not yet covered , and it will be done together with development colleagues later. The main purpose of using Jenkins instead of scripting is to facilitate versioning and reduce human error. While Jenkins is primarily used as a framework for visualization, the core is also the execution of various scripts. And this content is mainly explained if the building Jenkins, script content will be shown in the following, because the author of the use of Jenkins relatively superficial, but also in constant groping, this article is also for rookie friends prepared, hope to learn from this article, less go some detours.

The author just showed a little use of the demo, more fine-grained settings related just to see what the brother wrote:

Http://www.cnblogs.com/zz0412/p/jenkins01.html

second, the interface display

Figure one:Jenkins main interface,Jenkins is very simple to use, implementation of the script, click the Execute button, equivalent to execute the script.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5C/9A/wKiom1UeDsDwmuA1AAGV5oi9Nbw387.jpg "title=" 01.jpg "alt=" Wkiom1uedsdwmua1aagv5oi9nbw387.jpg "/>

Figure II: View the output information of the script during execution, which requires output redirection in the script, similar to executing script output information in the shell.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/95/wKioL1UeEDTQhjJrAAJlWxITsrA580.jpg "title=" 08.png "alt=" Wkiol1ueedtqhjjraajlwxitsra580.jpg "/>

Figure Three: You can see the detailed output information, than under Linux to see the output information more convenient.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5C/95/wKioL1UeEKPyflcMAAKGA8WZQJw576.jpg "title=" 02.jpg "alt=" Wkiol1ueekpyflcmaakga8wzqjw576.jpg "/>


Figure four:Jenkins can visually view the time nodes for each build execution, either successfully or not.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5C/95/wKioL1UeEMvD_y4PAARc6cLG86M310.jpg "title=" 09.png "alt=" Wkiol1ueemvd_y4paarc6clg86m310.jpg "/>

Iii. DeploymentJenkinsa, deployJdkand theTomcat

to facilitate administrative debugging, the author deploys Jenkins directly under Tomcat.

Version Description:jdk1.6.0_38 apache-tomcat-6.0.35

software get address:http://down.51cto.com/data/2025327

JDK Installation:

chmod Jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin

./Jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin

Tomcat Installation:

Tar-xzf apache-tomcat-6.0.35.tar.gz

MV Apache-tomcat-6.0.35/home/vekergu/jenkins

B, deployJenkins

Deploying Jenkins is simple, first configuring the JDK's variable environment:

vi/home/vekergu/jenkins/bin/catalina.sh

Insert at the beginning of the comment end code:

Export jre_home=/usr/java/jdk1.6.0_38

Export catalina_home=/home/vekergu/jenkins

Java_opts= "-server-xms2048m-xmx2048m-xmn768m-xx:permsize=128m-xx:maxpermsize=256m-xx:+useparalleloldgc-xx:+ printgcdatestamps-xx:+printgcdetails-xx:+heapdumponoutofmemoryerror-xx:heapdumppath=/home/xrltest1/tomcat/ Dumpfile/heap.bin-xloggc:/home/xrltest1/tomcat/logs/gc.log "

The above content and meaning and use is no longer detailed, do not understand can be seen as a blog before writing

Delete other files under WebApps

Rm/home/vekergu/jenkins/webapps/webapps/*-rf

Place Jenkins.war to /home/vekergu/jenkins/webapps

MV Jenkins.war/home/vekergu/jenkins/webapps

Focus:

Change /home/vekergu the directory owner is Vekergu

Use Root Account Execution:

Chown-r Vekrgu:vekrgu/home/vekergu

start Tomcat

Access Path http://host_id:8080

The author simplifies a lot of operations, because Jenkins is mainly used in the intranet, so the alignment deployment requirements are not very strict, if the external network environment deployment, the small partners are better to start with a bit of Tomcat deployment experience.

third, the useJenkinsa, page description

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5C/95/wKioL1UeEVPy6q3OAAFY59OSOlA861.jpg "title=" 10.png "alt=" Wkiol1ueevpy6q3oaafy59osola861.jpg "/>

B, new Project

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5C/9A/wKiom1UeEQOgeS3IAAO9GjaHkrA791.jpg "title=" 11.png "alt=" Wkiom1ueeqoges3iaao9gjahkra791.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/9A/wKiom1UeFTqTYv3ZAAN2cvoS2gU435.jpg "title=" 18.png "alt=" Wkiom1ueftqtyv3zaan2cvos2gu435.jpg "/>

Places to be aware of:

1.jenkins deployed under the Vekergu User directory, the owner of the Jenkins Project has been changed to Vekergu, so the script only Vekergu the user's permissions, If you have permission conflicts, consider using Sodu to resolve them.

2. The script can be applied repeatedly to different scenes according to the following parameters

C, new user

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5C/95/wKioL1UeFxbxTqY7AARhYehzINo313.jpg "title=" 20.png "alt=" Wkiol1uefxbxtqy7aarhyehzino313.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5C/9A/wKiom1UeFWmzxce-AAMTR_IKw7I382.jpg "title=" 19.png "alt=" Wkiom1uefwmzxce-aamtr_ikw7i382.jpg "/>



It is important to note that:

1. The Allow users to signup option must be selected or the user cannot be registered

2. Anyone can do anything must choose this first, or you have not registered users to use the account password authentication, it is possible to log on (the author has stepped on the pit), and you will find the timely redeployment, or can not login

it should be stated that all the file information thatJenkins saved is in the /home/vekergu directory . Jenkins directory, you need to delete this directory clean.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5C/9A/wKiom1UeFhGTCi06AAGW1nB3hCs577.jpg "title=" 21.png "alt=" Wkiom1uefhgtci06aagw1nb3hcs577.jpg "/>

D, user authorization

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5C/9A/wKiom1UeFO2RcTJdAALTAG9AgL8838.jpg "title=" 17.png "alt=" Wkiom1uefo2rctjdaaltag9agl8838.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/9A/wKiom1UeEjfzmz62AAMl1TM9Yoo331.jpg "title=" 15.png "alt=" Wkiom1ueejfzmz62aaml1tm9yoo331.jpg "/>

E, Summary

The author uses the Jenkins function to be less, other functions are not used, after what very useful function, and then share to everyone to put ~ ~


This article is from the "Ops Road" blog, please be sure to keep this source http://vekergu.blog.51cto.com/9966832/1627955

Jenkins automates deployment and service restart-Beginner

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.