1.首先安装jdk
2.启用jenkins库
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
rpm--import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3.安装
yum install jenkins
4.修改配置
vim /etc/sysconfig/jenkins
JENKINS_USER="root"
JENKINS_PORT="8000"
一定要改的配置:
vim /usr/lib/systemd/system/jenkins.service
User=root
Group=root
Environment="JENKINS_PORT=8000"
systemctl daemon-reload
5.配置java软连接
which java
/usr/local/jdk/jdk1.8.0_291/bin/java
ln -s /usr/local/jdk/jdk1.8.0_291/bin/java /usr/bin/java
6.启动
systemctl start jenkins
systemctl enable jenkins
systemctl restart jenkins
systemctl status jenkins
7.配置防火墙
firewall-cmd --permanent --zone=public --add-port=8000/tcp
firewall-cmd --reload
8.页面登录
查看管理员密码:
cat /var/lib/jenkins/secrets/initialAdminPassword
9.卸载jenkins
rpm -e jenkins
rpm -ql jenkins
find / -iname jenkins | xargs -n 1000 rm -rf
10.后续页面配置
(16条消息) gitlab+Jenkins自动化搭建部署_机灵的小小子的博客-CSDN博客_gitlab+jenkins
强烈推荐这篇文章,保姆级教程:
(16条消息) 还在手动发包?手把手教你 Jenkins 自动化部署SpringBoot_lililidahaoren的博客-CSDN博客_jenkins自动部署springboot