-
1. 装置 java
yum install -y java
-
2. 装置 git
yum install -y git
-
3. 引入 jenkins 源到 yum 并装置
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
-
4. 批改配置并启动
vim /etc/sysconfig/jenkins
批改项
JENKINS_USER="root" JENKINS_PORT="8888"
启动
service jenkins start
拜访
http://www.xxx.com:8888/
-
5. 常见问题
如果界面提醒 Jenkins 正在启动, 请稍后…或者提醒
Please wait while Jenkins is getting ready to work…vim /var/lib/jenkins/hudson.model.UpdateCenter.xml
替换 url 变成
<?xml version='1.1' encoding='UTF-8'?> <sites> <site> <id>default</id> <url>https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json</url> </site> </sites>
重启 jenkins 服务