安装
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo;\
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key;\
yum install jenkins
更改端口(可选)
sed -i '/JENKINS_PORT=/c\JENKINS_PORT="7070"' /etc/sysconfig/jenkins
更改JENKINS_JAVA_CMD(可选)
sed -i '/JENKINS_JAVA_CMD=/c\JENKINS_JAVA_CMD="/usr/java/jdk1.8.0_181-amd64/bin/java"' /etc/sysconfig/jenkins
配置防火墙
firewall-cmd --add-port=7070/tcp --permanent;\
firewall-cmd --reload
启动
systemctl daemon-reload;\
systemctl enable jenkins;\
systemctl start jenkins;\
systemctl status jenkins
查看初始密码
cat /var/lib/jenkins/secrets/initialAdminPassword
初始化选择插件
安装主题(可选)
- 系统管理-管理插件-安装Simple Theme Plugin
-
系统管理-系统设置-配置Theme
常用插件
- 按Tag构建:Git Parameter Plugin
- 彩色日志输出:AnsiColor Plugin
- 磁盘使用量显示:Disk Usage Plugin