大家好,我是walker
一个从文科自学转行的程序员~
爱好编程,偶尔写写编程文章和生活
欢迎关注公众号【I am Walker】,回复“电子书”,就可以获得200多本编程相关电子书哈~
我的gitee:https://gitee.com/shen-chuhao/walker.git 里面很多技术案例!
1、确保jdk已经安装,至少是java8以上,如果没有安装,可以参考https://blog.csdn.net/Think_and_work/article/details/122842622?spm=1001.2014.3001.5502
关注"I am Walker",回复"jenkins"获取
http://mirrors.jenkins-ci.org/redhat/
在这里可以选择自己想要的版本
rpm -ivh jenkins-2.174-1.1.noarch.rpm
[root@localhost jenkins]# rpm -ivh jenkins-2.174-1.1.noarch.rpm
warning: jenkins-2.174-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:jenkins-2.174-1.1 ################################# [100%]
[root@localhost develop]# whereis java
java: /opt/env/jdk1.8.0_202/bin/java
vim /etc/init.d/jenkins
下拉到candidates这个变量,然后将java的安装路径添加进去
service jenkins start
默认的端口是8080
访问http://ip:8080即可,ip是自己虚拟机的ip
第一次进入比较缓慢,等待进入,之后进入到这个页面,需要获取管理员的密码
(1)复制该地址,然后读取该地址的内容即可,里面就是我们需要的密码
(2)点击继续,进入到插件安装界面,一般新手的推荐选择“安装推荐的插件”
就会装载这些插件了。
本次的安装教程就到此为止了,后续的教程会继续发上。
Issued certificate has expired.
[root@localhost kit]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
--2022-02-11 09:17:59-- https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 151.101.2.133, 151.101.66.133, 151.101.130.133, ...
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.2.133|:443... connected.
ERROR: cannot verify pkg.jenkins.io's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
Issued certificate has expired.
To connect to pkg.jenkins.io insecurely, use `--no-check-certificate'.
解决方式:
sudo yum install -y ca-certificates
y
[root@localhost kit]# rpm -ivh jenkins-2.213-1.1.noarch.rpm
warning: jenkins-2.213-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY
Preparing... ################################# [100%]
stat: cannot stat ‘/var/cache/jenkins’: No such file or directory
stat: cannot stat ‘/var/log/jenkins’: No such file or directory
stat: cannot stat ‘/var/lib/jenkins’: No such file or directory
error: %pre(jenkins-2.213-1.1.noarch) scriptlet failed, exit status 1
error: jenkins-2.213-1.1.noarch: install failed
原因:
因为在之前已经安装过jenkins,新建了jenkins文件,将其删除即可