rpm方式按照jenkins
1. jenkins rpm下载
[root@localhost software]# wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.361.4-1.1.noarch.rpm
该版本要使用jdk11
2. 创建jenkins安装需要的文件夹
[root@localhost software]# mkdir -p /var/cache/jenkins
[root@localhost software]# mkdir -p /var/log/jenkins
[root@localhost software]# mkdir -p /var/lib/jenkins
3. 安装jenkins
[root@localhost software]# rpm -ivh jenkins-2.361.4-1.1.noarch.rpm
4. 修改jenkins用户或者端口号
vim /etc/sysconfig/jenkins
JENKINS_USER=“jenkins”
JENKINS_PORT=“8080”
5. 重启jenkins
systemctl restart jenkins.service
6. jenkins第一次访问要输入的密码
/var/lib/jenkins/secrets/initialAdminPassword
yum方式安装jenkins
- 加入jenkins安装源
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
- 执行yum安装命令
yum -y install jenkins