Jenkins Build and use

Source: Internet
Author: User
Tags character set file upload svn zip git client port number tomcat checkstyle

1. Preparation Java8 Environment .

2. Download the latest war package for Jenkeins deployment (Jenkins.war) wget Http://mirrors.jenkins-ci.org/war/latest/jenkins.war

3. Download the deployment jenkeins Application Server Tomcat, unzip the tar.gz package, and set Tomcat to execute and read and write permissions to a start command permission: chmod u+x *.sh (. sh file), such as: Tomcat under L The OGs directory requires write permission, and the Execute permission is required in the bin directory.

4. download maven package: wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/ Apache-maven-3.2.5-bin.zip b, install maven [Jenkins Packaging will call Maven package], unzip the Apache-maven-3.2.5-bin.zip package to the installation path, configure the MAVEN environment variable

Image: Export maven_home=/opt/apache-maven-3.2.5 export path= $PATH: $JAVA _home/bin: $MAVEN _home/bin


5, Tomcat configuration items (some do not need) modify the encoding character set in the Server.xml file to UTF-8, such as the port number and other program conflicts are modified,error as shown in figure
6. Deploy Jenkins.war: Copy the Jenkins.war to Tomcat WebApp and start Tomcat in the bin directory.
7. Run: Enter the Tomcat/bin directory, run./startup.sh & Start Tomcat access: 1**.**.**:8080/jenkins as shown:
8, Jenkins Project default storage pathWhen Jenkins starts, the. Jenkins directory is created by default in the user's root directory, storing Jenkins ' project build information, such as: I started Jenkins with Root, and I created the. Jenkins directory under/root. Backup and restore copies. The Jenkins directory can be, as shown:
9, the system will be automatically created when you start . Jenkins, create a. Jenkins in/opt. Modify Path Jenkins default path:/etc/profile file, add jenkins_home environment amount.  Export Jenkins_home=/opt/.jenkins; As shown in figure:

10. Access Tomcat to find the unlock password


11. Click to enter: (Auto install plugin)


12. Registration:

13. System settings:

   

14.after configuration is completeYou can see that the Jenkins home directory becomes/opt/.jenkins as shown:

15. Backup and Recovery     Copy the Jenkins_home path under the. Jenkins directory. Jenkins Configuration: Configure security Policy [System Administration > Configure Global Security] to enable the policy. As shown in figure:
16. Add a user/group to Jenkins and give all permissions, as shown on: 17. Sign up for the Jenkins account, as shown in figure: 18. No permissions [just registered users do not have permission to login] 19, to new users open permissions [System Management > Management users] with the Administrator Jenkins login, create a user/group corresponding to the registered users, and give Read permission to log in, as shown in Figure 20, configuration Jenkin s parameter [System Administration > System Settings] settings jdk,maven,git settings Email notifications = = = "NOTE: The mailbox must have the SMTP port turned on     plug-in installation(For the first time in the project, there is no optional plugin in the optional plugin and must be in plug-in Management > Advanced > Immediate Access) 1.  SVN (Subversion Plugin) Select Subversion Plugin in the not installed plugin and click Install. 2. Git (git Plugin plugin must be installed) git plugin,credentials plugin,git Client plugin,scm API Plugin Choose git Plugin in the plugin not installed, click  Installation can be done. 3. Remote deployment plug-in (native arbitrary path) HTTP://MIRROR.BIT.EDU.CN/JENKINS/PLUGINS/DEPLOY/1.10/DEPLOY.HPI
jenkins-> system Management, management plug-in, advanced upload plugin, select Deploy.hpi file upload or select Deploy to container Plugin in the plugin not installed, click Install. 4. Code coverage plug-in Emma installation (Emma Plugin Emma Coverage Column) 5. Code detection plug-in Checkstyle installation (Static analysis Utilities, Checkstyle plugin,ezwall Plugin) SVN (must install Subversion plug-in plugin) configuration build code Source G IT (You must install the Git plugin plugin) and credentials add authorization, as shown in the figure:

Create a Job "create a free-style software project"

Configure Build Frequency 1, Poll SCM: Code changes after build, as shown in Figure 2, build periodically

Note: Cron-style syntax    MINUTE HOUR DOM manth DOW minute:0-59 hour:0-23 dom:1-31 month:1-122 dow:0-7, where 0, 7 are all represented Sunday, following a few simplified characters characters 1, "*" means that all possible values in the field 2, you can also use the hyphen "-" to define the scope, such as the Dow Field defined 1-5, for the Monday to Friday 3, the use of a forward slash symbol to define a skip a range, such as the definition of */5 on the minute field means five minutes per 4 , separating a field with a comma represents a series of valid values, such as the hour field definition 12,18 represents 12 points and 18 points

Configuring Remote Automatic Deployment (you must install the deploy to container plugin plugin)

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.