Jenkins的安装步骤(centos7)
一、环境准备
1 安装JDK
1-1、下载jdk1.8.0到服务器/usr/java/
https://download.oracle.com/otn/java/jdk/8u261-b12/a4634525489241b9a9e1aa73d9e118e6/jdk-8u261-linux-x64.tar.gz?AuthParam=1602567440_c27e012fdb22fac4a4e1deb5f378a396
1-2、解压jkd到/usr/java/
#tar -zxvf jdk-8u261-linux-x64.tar.gz
1-3、配置jdk环境变量
打开:/etc/profile
#vim /etc/profile
·在profile文件末尾加入下面5行内容
JAVA_HOME=/usr/java/jdk1.8.0_261
JRE_HOME=/usr/java/jdk1.8.0_261/jre
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME CLASSPATH
到此,java安装完毕
2、安装jenkins
2-1、导入镜像,安装jenkins
#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
2-2、配置jenkins端口,默认8080
# vi /etc/sysconfig/jenkins
2-3、访问浏览器: http://localhost:8080
2-4、在服务器查看密码,复制到初始化的页面的密码
#cat /var/lib/jenkins/secrets/initialAdminPassword
到此,jenkins安装完毕
jenkins基本操作
sudo service jenkins start 启动
sudo service jenkins stop 停止
sudo service jenkins restart 重启