Jenkins 2.346.3安装部署

DevOps Jenkins评论8,226字数 4653阅读15分30秒阅读模式

长期支持版本

每 12 周从常规版本流中选择一个LTS(长期支持)版本作为该时间段的稳定版本。它可以从redhat-stableyum 存储库安装。

Jenkins 2.346.3安装部署

Centos7.9安装Jenkins

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install fontconfig java-11-openjdk
sudo yum install jenkins
sudo systemctl daemon-reload

启动Jenkins

[root@devops ~]# sudo systemctl daemon-reload
[root@devops ~]# sudo systemctl enable jenkins
Created symlink from /etc/systemd/system/multi-user.target.wants/jenkins.service to /usr/lib/systemd/system/jenkins.service.
[root@devops ~]# sudo systemctl start jenkins
[root@devops ~]# sudo systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
   Active: active (running) since 一 2022-09-05 12:00:26 CST; 12s ago
 Main PID: 16609 (java)
   CGroup: /system.slice/jenkins.service
           └─16609 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=%C/jenkins/war --httpPort=8080

9月 05 12:00:04 devops jenkins[16609]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
9月 05 12:00:04 devops jenkins[16609]: *************************************************************
9月 05 12:00:04 devops jenkins[16609]: *************************************************************
9月 05 12:00:04 devops jenkins[16609]: *************************************************************
9月 05 12:00:25 devops jenkins[16609]: 2022-09-05 04:00:25.550+0000 [id=50]        INFO        h.m.DownloadService$Downloadable#load: Obtained t...Installer
9月 05 12:00:25 devops jenkins[16609]: 2022-09-05 04:00:25.553+0000 [id=50]        INFO        hudson.util.Retrier#start: Performed the action c...ttempt #1
9月 05 12:00:25 devops jenkins[16609]: 2022-09-05 04:00:25.556+0000 [id=50]        INFO        hudson.model.AsyncPeriodicWork#lambda$doRun$1: Fi...21,884 ms
9月 05 12:00:25 devops jenkins[16609]: 2022-09-05 04:00:25.988+0000 [id=31]        INFO        jenkins.InitReactorRunner$1#onAttained: Completed...alization
9月 05 12:00:26 devops jenkins[16609]: 2022-09-05 04:00:26.007+0000 [id=23]        INFO        hudson.lifecycle.Lifecycle#onReady: Jenkins is fu...d running
9月 05 12:00:26 devops systemd[1]: Started Jenkins Continuous Integration Server.
Hint: Some lines were ellipsized, use -l to show in full.

防火墙

[root@devops ~]#  firewall-cmd --zone=public --add-port=8080/tcp --permanent
success
[root@devops ~]# firewall-cmd --reload 
success
[root@devops ~]# setenforce 0
[root@devops ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

Ubuntu 22.04 LTS安装

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt update
sudo apt install openjdk-11-jdk
sudo apt-get install jenkins

启动Jenkins

devops@jenkins:~$ sudo systemctl enable jenkins
Synchronizing state of jenkins.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable jenkins
devops@jenkins:~$ sudo  systemctl start jenkins
devops@jenkins:~$ sudo  systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-09-05 09:23:06 UTC; 4min 2s ago
   Main PID: 6650 (java)
      Tasks: 41 (limit: 4534)
     Memory: 1.2G
        CPU: 1min 2.443s
     CGroup: /system.slice/jenkins.service
             └─6650 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080

Sep 05 09:22:32 jenkins jenkins[6650]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Sep 05 09:22:32 jenkins jenkins[6650]: *************************************************************
Sep 05 09:22:32 jenkins jenkins[6650]: *************************************************************
Sep 05 09:22:32 jenkins jenkins[6650]: *************************************************************
Sep 05 09:23:06 jenkins jenkins[6650]: 2022-09-05 09:23:06.012+0000 [id=29]        INFO        jenkins.InitReactorRunner$1#onAttained: Completed initialization
Sep 05 09:23:06 jenkins jenkins[6650]: 2022-09-05 09:23:06.058+0000 [id=22]        INFO        hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
Sep 05 09:23:06 jenkins systemd[1]: Started Jenkins Continuous Integration Server.
Sep 05 09:23:10 jenkins jenkins[6650]: 2022-09-05 09:23:10.401+0000 [id=45]        INFO        h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
Sep 05 09:23:10 jenkins jenkins[6650]: 2022-09-05 09:23:10.403+0000 [id=45]        INFO        hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
Sep 05 09:23:10 jenkins jenkins[6650]: 2022-09-05 09:23:10.406+0000 [id=45]        INFO        hudson.model.AsyncPeriodicWork#lambda$doRun$1: Finished Download metadata. 38,725 ms
devops@jenkins:~$

快速配置

Jenkins 2.346.3安装部署

Jenkins 2.346.3安装部署Jenkins 2.346.3安装部署Jenkins 2.346.3安装部署

继续阅读
DevOps
  • 本文由 发表于 2022年9月3日 21:40:36
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
Jenkins是什么? Jenkins

Jenkins是什么?

Jenkins是什么?我们先来以初学者的角度来简单的介绍下Jenkins。然后讲解Jenkins的应用场景以及Jenkins的特点。如果你已经了解Jenkins,那么你可以选择性的跳过本次的章节。...
评论  0  访客  0

发表评论