Centos安装和卸载Jenkins

一、安装git

yum install git

 

二、安装Jenkins

  1.命令安装

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins

  2.下载后安装

wget https://pkg.jenkins.io/redhat/jenkins-2.156-1.1.noarch.rpm
rpm -ivh jenkins-2.156-1.1.noarch.rpm

 

三、配置权限、用户和端口 

vim /etc/sysconfig/jenkins

#配置端口
JENKINS_PORT="8080"

#配置用户
$JENKINS_USER="root"

# 修改权限
chown -R root:root /var/lib/jenkins 
chown -R root:root /var/cache/jenkins 
chown -R root:root /var/log/jenkins

 

 

 

四、重启

# 重启
service jenkins restart
ps -ef | grep jenkins

#启动
systemctl start jenkins

 

五、进入界面继续安装

  1.输入密码

#执行命令查看密码
cat /var/lib/jenkins/secrets/initialAdminPassword

Centos安装和卸载Jenkins

 

  2.安装推荐插件

Centos安装和卸载Jenkins

 

  3.等待安装

Centos安装和卸载Jenkins

  4.创建管理员账号和密码

Centos安装和卸载Jenkins

 

  5.完成安装

Centos安装和卸载Jenkins

 

六、卸载Jenkins

systemctl stop jenkins.service

yum remove jenkins

rm -rf /etc/sysconfig/jenkins.rpmsave
rm -rf /var/cache/jenkins/
rm -rf /var/lib/jenkins/
rm -rf /var/log/jenkins
rm -rf /usr/lib/jenkins

 

Centos安装和卸载Jenkins

上一篇:从Java8到Java17


下一篇:图形化编程实例分享图形化编程,小动画制作,厨具店