安装环境
yum install java-1.8.0-openjdk -y
yum install java-devel
yum install -y git
安装
cd /tmp/
wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.263.1-1.1.noarch.rpm
rpm -ivh jenkins-2.263.1-1.1.noarch.rpm
rm -rf jenkins-2.263.1-1.1.noarch.rpm
vim /etc/sysconfig/jenkins
# 必要的!修改Jenkins运行用户为root
JENKINS_USER="root"
# 可选的!修改默认端口8080
JENKINS_PORT="6004"
systemctl enable/disable/start/restart/status/stop jenkins
systemctl start jenkins
systemctl enable jenkins
启动Jenkins服务后(jenkins启动或者重启都要好一会儿,稍等等就好了),进入/var/lib/jenkins/updates/目录,执行:
cd /var/lib/jenkins/updates/
copy default.json default.json.bak
# 替换国内源。
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn
原创文章,作者:站长,如若转载,请注明出处:https://wsppx.cn/158/%e7%bd%91%e7%bb%9c%e5%bc%80%e5%8f%91/devops/