长期支持版本
- 每 12 周从常规版本流中选择一个LTS(长期支持)版本作为该时间段的稳定版本。它可以从redhat-stableyum 存储库安装
wget -O /etc/yum.repos.d/jenkins.repo \ https://pkg.jenkins.io/redhat-stable/jenkins.repo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key yum install java-11-openjdk -y yum install jenkins -y systemctl daemon-reload
启动服务
[root@i-fyy01ayy ~]# systemctl enable jenkins Synchronizing state of jenkins.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable jenkins Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /usr/lib/systemd/system/jenkins.service. [root@i-fyy01ayy ~]# systemctl start jenkins [root@i-fyy01ayy ~]# 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 Thu 2022-11-03 14:38:36 CST; 3s ago Main PID: 22794 (java) Tasks: 44 (limit: 49450) Memory: 2.2G CGroup: /system.slice/jenkins.service └─22794 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 Nov 03 14:38:14 i-fyy01ayy jenkins[22794]: Please use the following password to proceed to installation: Nov 03 14:38:14 i-fyy01ayy jenkins[22794]: 927c5b4bd8f74e3093174e2b48999c88 Nov 03 14:38:14 i-fyy01ayy jenkins[22794]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword Nov 03 14:38:14 i-fyy01ayy jenkins[22794]: ************************************************************* Nov 03 14:38:36 i-fyy01ayy jenkins[22794]: 2022-11-03 06:38:36.166+0000 [id=28] INFO jenkins.InitReactorRunner$1#onAttained: Co> Nov 03 14:38:36 i-fyy01ayy jenkins[22794]: 2022-11-03 06:38:36.235+0000 [id=22] INFO hudson.lifecycle.Lifecycle#onReady: Jenkin> Nov 03 14:38:36 i-fyy01ayy systemd[1]: Started Jenkins Continuous Integration Server. Nov 03 14:38:37 i-fyy01ayy jenkins[22794]: 2022-11-03 06:38:37.385+0000 [id=46] INFO h.m.DownloadService$Downloadable#load: Obt> Nov 03 14:38:37 i-fyy01ayy jenkins[22794]: 2022-11-03 06:38:37.385+0000 [id=46] INFO hudson.util.Retrier#start: Performed the a> Nov 03 14:38:37 i-fyy01ayy jenkins[22794]: 2022-11-03 06:38:37.388+0000 [id=46] INFO hudson.model.AsyncPeriodicWork#lambda$doRu> lines 1-19/19 (END)
Unlocking Jenkins
When you first access a new Jenkins instance, you are asked to unlock it using an automatically-generated password.
- Browse to
http://localhost:8080
(or whichever port you configured for Jenkins when installing it) and wait until the Unlock Jenkins page appears. - From the Jenkins console log output, copy the automatically-generated alphanumeric password (between the 2 sets of asterisks).
Note:- The command:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
will print the password at console. - If you are running Jenkins in Docker using the official
jenkins/jenkins
image you can usesudo docker exec ${CONTAINER_ID or CONTAINER_NAME} cat /var/jenkins_home/secrets/initialAdminPassword
to print the password in the console without having to exec into the container.
- The command:
- On the Unlock Jenkins page, paste this password into the Administrator password field and click Continue.
Notes:- You can always access the Jenkins console log from the Docker logs (above).
- The Jenkins console log indicates the location (in the Jenkins home directory) where this password can also be obtained. This password must be entered in the setup wizard on new Jenkins installations before you can access Jenkins’s main UI. This password also serves as the default administrator account’s password (with username "admin") if you happen to skip the subsequent user-creation step in the setup wizard.
继续阅读
评论