Jenkins is introduced

As an important tool for continuous integration, Jenkins occupies an important position in the whole tool chain of DevOps. Jenkins typically runs as a standalone application in Java Servlet containers such as Jetty, but can also run in other containers such as Apache Tomcat or GlassFish.

Install Jenkins

Jenkins can be installed in a variety of environments, including Running in Tomcat containers, Docker, and running locally. This article describes how to run locally. For more information about how to Install Jenkins, visit Install Jenkins

Environmental requirements

The minimum environment requirements for Jenkins installation are: 1 256MB memory 2 1G disk space (if you are running Jenkins in a container, at least 10G space is recommended) 3 Java 8 runtime environment

Quick Setup method 1: RPM installation

Jenkins provides an RPM package that can be installed and run independently. Download it here. I found a problem when downloading this page, the RPM package is not exactly sorted according to time, I hope the official can solve this problem.

Redhat Linux 7.3 Jenkins-2.89.4-1.1.noarch. RPM JDK-8u171-linux-x64

Installation process:

Copy the installation file to the user directory of the VIRTUAL machineBogon :Downloads Rousseau $SCP Jenkins-2.89.4-1.1. noarch. RPM [email protected]:~Check whether the Java version of the host meets the requirements. If not, install the corresponding JDK version
[root@bogon ~]# java -version
java version "1.8.0 comes with _171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
Log in to the vm host and install the vm
[root@bogon ~]# RPM - the ivh Jenkins - 2.89.4-1.1 noarch. RPM
# start Jenkins
[root@bogon ~]# systemctl start jenkins 
[root@bogon ~]# ps - ef | grep Jenkins - 2.89.4-1.1 noarch. RPMRoot 2829 2392 0 17:05 PTS /0 00:00:00 grep --color=auto jenkins-2.89.4-1.1.noarch.rpmIf you can't access it, you may have a firewall problem. Note After Redhat 7, the command for disabling the firewall is changed
[root@bogon ~]# systemctl status firewalldLow firewalld. Service - firewalld - dynamic firewall daemon the Loaded: the Loaded (/ usr/lib/systemd/system/firewalld. Service; enabled; vendor preset: enabled) Active: active (running) since Mon 2018-05-07 16:53:24 CST; 14min ago Docs: man:firewalld(1) Main PID: 753 (firewalld) CGroup: / system. Slice/firewalld service └ ─ 753 / usr/bin/python - Es/usr/sbin/firewalld - nofork nopid May 7 16:53:23 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... May 07 16:53:24 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. [root@bogon ~]# systemctl stop firewalld
Copy the code

The process of plug-in installation.

Quick build method 2: Docker run

This article is running on a Mac, so first make sure you have Virtualbox and Docker installed on your Mac.

Mac OS X EI Caption 10.11.6 Virtualbox 5.1.26 Docker 18.031-CE

Using Docker to run Jenkins is really convenient and saves a lot of time by not having to prepare virtual machines. The steps are as follows. At yesterday’s DevOps conference, JFrog’s Head of China advised Jenkins to run in containers.

bogon:docker rousseau$ docker pull jenkinsci/blueocean
bogon:docker rousseau$ docker run -p 8080:8080 jenkinsci/blueocean
Copy the code

First request jenkinsci/ BlueOcean image from docker Hub, this step will take a while, once all requests are complete, you can perform the second step. When Jenkins is started for the first time, the initial password will be output to the terminal in the form of log, so pay attention to it. The subsequent screen also shows the location of the password file.

Follow the screen, and we’ll get to Jenkins’ welcome screen.

1, Install Jenkins