Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Jenkins installation and upgrade

Shulou Source: shulou.com Published: 2022-06-03 04:09:10 10月01日 Update

Background

Recently, I have been working on jenkins continuous integration. I am going to write a blog post and record it. Please see the previous blog post about jenkins. This article mainly introduces jenkins installation and upgrade, the operation is still very simple. Installation environment: Centos6.8 X64.

Installation introduction

Jenkins can be started through the java-jar jenkins.war command, or the war package of jenkins can be started under tomcat, which is called method one and method two, respectively.

Method one environment prepares yum install java-1.8.0-openjdk* wget-y wyum-y install zlib-devel openssl-devel perl cpio expat-devel gettext-devel autoconf curl-devel expect to install maven

Download the apache-maven-3.3.3-bin.tar.gz package at http://maven.apache.org/download.cgi

Decompression

Tar-zxvf apache-maven-3.3.3-bin.tar.gz-C / data/service

Establish a soft link

Ln-sv apache-maven-3.3.3 maven

Configure environment variables

Vim / etc/profile

M3_HOME=/data/service/maven

PATH=$ {M3_HOME} / bin:$ {PATH}

Export PATH

Install wget-O / etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.reporpm-- import https://jenkins-ci.org/redhat/jenkins-ci.org.key yum install jenkins-y

Start

Firewall opens port 8080

Iptables-I INPUT-m state-- state NEW-m tcp-p tcp-- dport 8080-j ACCEPT

Service iptables save

Service iptables restart

Jenkins joins the self-startup list and starts

Chkconfig jenkins on

Service jenkins start

Access address

Http://192.168.10.78:8080

Method 2 Environmental preparation

Refer to method 1, you also need to install tomcat, this test environment installed the Apache Tomcat/9.0.0.M19 version, the tomcat installation directory is / home/tomcat.

Install maven

Reference method 1

Installation

Download the jenkins.war package at wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war

Put the package in the webapps directory of tomcat, and then start tomcat.

Firewall Settin

Iptables-I INPUT-m state-- state NEW-m tcp-p tcp-- dport 8080-j ACCEPT

Service iptables save

Service iptables restart

Access address

Http://192.168.10.76:8080/jenkins/

Upgrade

After Jenkins is installed, the upgrade is relatively simple. If it is installed in yum or apt-get mode, you can upgrade it directly through the relevant commands. Because the server is abroad, so the online installation will be slow, so we will upgrade directly through the war package.

Upgrade steps:

1. Download the latest version of the war package of jenkins. Generally, you can download it through these links:

Http://mirror.xmission.com/jenkins/war-stable/

Http://ftp.yz.yamagata-u.ac.jp/pub/misc/jenkins/war-stable/

Https://updates.jenkins-ci.org/download/war/

Https://mirrors.tuna.tsinghua.edu.cn/jenkins/

2. Stop the jenkins service and back up jenkins's original war package and jenkins home directory data

3. Upload the latest war package to the jenkins server and start jenkins

Reference documentation:

Https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions

Https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins

Http://www.ilanni.com/?p=12545

Tags: Upgrade method address environment method directory preparation reference service can pass command server version firewall fire prevention first next variable backup data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno Apple Shulou Tech Info MariaDB