一、环境准备
#jdk软件包、Jenkins软件包、插件安装包 [root@jenkins ~]# ls -l total 399028 -rw-r--r-- 1 root root 170023183 Aug 14 2018 jdk-8u181-linux-x64.rpm -rw-r--r-- 1 root root 74141787 Aug 13 2018 jenkins-2.99-1.1.noarch.rpm -rw-r--r-- 1 root root 164431230 Aug 14 2018 plugins.tar.gz
二、部署安装Jenkins和Jdk
1.安装Jenkins和jdk
[root@jenkins ~]# rpm -ivh jdk-8u181-linux-x64.rpm warning: jdk-8u181-linux-x64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:jdk1.8-2000:1.8.0_181-fcs ################################# [100%] Unpacking JAR files... tools.jar... plugin.jar... javaws.jar... deploy.jar... rt.jar... jsse.jar... charsets.jar... localedata.jar... [root@jenkins ~]# rpm -ivh jenkins-2.99-1.1.noarch.rpm warning: jenkins-2.99-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY Preparing... ################################# [100%] Updating / installing... 1:jenkins-2.99-1.1 ################################# [100%]
2.配置Jenkins
[root@jenkins ~]# vim /etc/sysconfig/jenkins [root@jenkins ~]# grep '^JENKINS_USER' /etc/sysconfig/jenkins JENKINS_USER="root"
3.启动Jenkins
[root@jenkins ~]# systemctl start jenkins [root@jenkins ~]# netstat -lntp |grep java tcp6 0 0 :::8080 :::* LISTEN 19124/java
三、web界面访问设置
提示:如果一直卡在正在启动,请稍后,断开本地网络重连试试!
1.查看默认密码
#根据提示查看Administrator密码 [root@jenkins ~]# cat /var/lib/jenkins/secrets/initialAdminPassword 92969dd116fa49969a88224a2144c1c6 [root@jenkins ~]#
2.跳过插件安装
3.重新设置Jenkins密码
四、Jenkins插件安装
1.解压插件包到plugins目录
[root@jenkins ~]# cp /root/plugins.tar.gz /var/lib/jenkins/ [root@jenkins ~]# cd /var/lib/jenkins/ [root@jenkins /var/lib/jenkins]# tar xf plugins.tar.gz [root@jenkins /var/lib/jenkins]# ls -l plugins |wc -l 191 #设置权限 [root@jenkins /var/lib/jenkins]# chown -R root:root plugins #重启Jenkins [root@jenkins /var/lib/jenkins]# systemctl restart jenkins
`