Jenkins自动化部署操作步骤

1、安装JAVA环境

yum install -y java-1.8.0-openjdk

2、添加Jenkins repo

wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo

rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key 

3、更新Jenkins repo cache

yum clean all

yum makecache

4、安装Jenkins

yum install jenkins -y

备注:yum install安装比较慢,到http://pkg.jenkins-ci.org/redhat-stable/ 中下载指定版本的安装包,再通过rpm来安装。

          wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.164.2-1.1.noarch.rpm rpm -ivh jenkins-2.164.2-1.1.noarch.rpm

5、启动Jenkins

systemctl start jenkins

# 检查Jenkins服务状态
sudo systemctl status jenkins

# 设置为开机自启动
sudo systemctl enable jenkins

# 启动Jenkins服务
sudo systemctl start jenkins

posted @ 2021-05-31 10:15  A仔的黑眼圈  阅读(312)  评论(0)    收藏  举报