Jenkins (1) installation

Introduction to Jenkins


 Jenkins is a continuous integration tool developed based on Java, which is used to monitor continuous and repeated work. The functions include:

  1. Continuous software version release/test project.
  2. Monitor the work performed by external calls.

Installation Environment

      Operating system: linux (centOS)

  Software: jdk

  Software: tomcat

  Software: jenkins (2.32.0)

installation steps

1. Since Jenkins is developed based on Java , make sure that the operating system has installed jdk before installation , refer to: [Linux ] JDK installation and configuration (tar.gz version)

2. Download the war package of jenkins from the official website , address https://jenkins.io/

3. Press the jenkins.war package and put it under the webapps under tomcat ( tomcat installation: [Linux ] Tomcat installation and one server configures multiple Tomcats )

4. Start tomcat . Tomcat will decompress the war package, generate a jenkins folder, and generate a .jenkins folder in the root directory . As shown below: 

 

  

 

5. Enter the ip address ( http://ip: port /jenkins ) on the browser to access , as shown in the figure:

6. If you want to enter a password when entering jenkins for the first time , the password location: /root/.jenkins/secrets/initialAdminPassword

 

7. Enter the plugin installation interface, select the first one ( Install suggested plugins )

 

8. After the plugin is installed, you need to create the first user

 

9. After creating the user, you can use jenkins

 

 

If the plugin installation fails, you can go to the mirror address: https://mirrors.tuna.tsinghua.edu.cn/jenkins , download it manually, and then upload it through Advanced in Plugin Management

 

 

Reprinted from: http://www.cnblogs.com/h--d/p/5673085.html

 

 Configuration of jenkins under linux:

Jenkins will be stored in the .jenkins folder in the user's home directory by default

Such as: Linux root user: /root/.jenkins

Note: This is the linux version. Please change the Windows system by yourself. This value cannot be changed while Jenkins is running. Please stop Jenkins first.
If you view the current Jenkins directory: System Management → System Settings → Home Directory → /root/.jenkins (Note: Different users have different paths)

1. Backup, migrate, restore jenkins

First find JENKINS_HOME, because all Jenkins data is stored in the JENKINS_HOME directory in the form of files. Whether it is migration or backup, you only need to operate JENKINS_HOME.

Migration: It is recommended to package JENKINS_HOME and then copy it. Windows can use zip, rar, etc., Linux has zip, tar, etc., and then unzip the packaged files to the new JENKINS_HOME directory.

Backup: If it is a temporary backup, the entire compressed file will do.

Recovery: When recovering, you need to stop jenkins first.

 

2. Upgrade Jenkins

The development iteration of Jenkins is very fast, a development version is released every week, and the long-term support version is updated every six months (ps: major version update). With such frequent updates, how to upgrade?

war: Download the new version of the war file and replace the old version of the war file. Just restart.
Binary: Uninstall the old version and install the new version.
Jenkins program download address: http://mirrors.jenkins-ci.org/

note: Before upgrading, please test the compatibility of this version with your local data. How to test: Copy JENKINS_HOME to a new machine and start it with the new version of the program. Test the corresponding plugin and configuration.

 

3. Move, delete or modify jobs

For moving or deleting jobs, simply move or delete the %JENKINS_HOEM%\jobs directory.

For changing the name of the jobs, simply change the name of the folder corresponding to the job under %JENKINS_HOEM%\jobs.

对于不经常使用的job,只需要对%JENKINS_HOEM%\jobs下对应的jobs的目录zip或tar后存储到其他的地方。

4.Jenkins的job->build 支持Ant,maven,windows batch和Shell, 但是我们知道python,perl,ruby等脚本其实也是shell脚本,所以这里的Shell可以扩展为python,perl,ruby等。如下图:执行windows batch 和python

5.Jenkins的svn插件无法获取到最新的源代码?:
请检查你的SVN服务器时间和Jenkins服务器时间是否同步。

6.jenkins提供丰富的插件,常用的插件:
Publish Over FTP Plugin这个插件可以将构建的产物(例如:Jar)发布到FTP中去。
Publish Over SSH这个插件可以通过ssh连接其他Linux机器
JIRA Plugin
Deploy Plugin插件支持将War/Jar部署到远程的应用服务器上,例如Tomcat,JBoss,Glassfish。正在寻找或开发.NET web 应用的自动发布插件。

 

转自:http://www.cnblogs.com/shilin000/p/5244667.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326080912&siteId=291194637