jenkins持续集成交付
- 一、jenkins介绍
- 二、jenkins的安装部署
- 1、下载jenkins
- 2、安装jenkins
- 3、修改插件下载地址
- 4、初始化jenkins
一、jenkins介绍
持续集成交付, CI/CD
偏开发、项目编译、部署、更新
二、jenkins的安装部署
1、下载jenkins
[root@jenkins ~]# wget https://mirrors.aliyun.com/jenkins/redhat-stable/jenkins-2.452.2-1.1.noarch.rpm
2、安装jenkins
[root@jenkins ~]# yum install -y fontconfig jdk-17.0.10_linux-x64_bin.rpm jenkins-2.452.2-1.1.noarch.rpm
[root@jenkins ~]# java -version
java version "17.0.10" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+11-LTS-240, mixed mode, sharing)
[root@jenkins ~]# systemctl enable --now jenkins
Created symlink from /etc/systemd/system/multi-user.target.wants/jenkins.service to /usr/lib/systemd/system/jenkins.service.
[root@jenkins ~]#
[root@jenkins ~]# netstat -tunlp | grep java
tcp6 0 0 :::8080 :::* LISTEN 18755/java
3、修改插件下载地址
[root@jenkins jenkins]# cat /var/lib/jenkins/hudson.model.UpdateCenter.xml
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json</url>
</site>
</sites>
[root@jenkins jenkins]#
[root@jenkins jenkins]# systemctl restart jenkins
4、初始化jenkins
[root@jenkins ~]# sed -i 's/https:\/\/updates.jenkins.io\/download/http:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' /var/lib/jenkins/updates/default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' /var/lib/jenkins/updates/default.json
[root@jenkins ~]# systemctl restart jenkins