[TOC]
安装 jenkins(需要先安装 jdk)
(1).导入镜像
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
(2).导入公钥
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
(3).安装 jenkins
yum install jenkins
(4).修改配置文件(也可以不修改,默认 8080)
vi /etc/sysconfig/jenkins
#自定义一个port
JENKINS_PORT="8091"
(5).启动
#启动
systemctl start jenkins
#查询状态
systemctl status jenkins
#停止
systemctl stop jenkins
#重启
systemctl restart jenkins
(6).访问浏览器(ip:端口)端口就是配置文件修改的那个,没有改的话默认是 8080
初次使用需要设置密码
cat /var/lib/jenkins/secrets/initialAdminPassword
然后直接选推荐安装的插件,或者直接下一步就完事儿了!
卸载 jenkins
[root@centos7 ~]# rpm -e jenkins
warning: /etc/sysconfig/jenkins saved as /etc/sysconfig/jenkins.rpmsave
warning: /etc/init.d/jenkins saved as /etc/init.d/jenkins.rpmsave
[root@centos7 ~]# systemctl stop jenkins
Failed to stop jenkins.service: Access denied
See system logs and 'systemctl status jenkins.service' for details.
Failed to get load state of jenkins.service: Access denied
[root@centos7 ~]# rpm -ql jenkins
package jenkins is not installed
[root@centos7 ~]# find / -iname jenkins | xargs -n 1000 rm -rf
[root@centos7 ~]#
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于