[root@node02 ~]# wget -O /etc/yum.repos.d/jenkins.repo RedHat/jenkins.repo
[root@node02 ~]# rpm --import
[root@node02 ~]# yum clean all
[root@node02 ~]# yum install jenkins
[root@node02 ~]#
配置Jenkins:
修改Jenkins的配置文件
[root@node02 ~]# vim /etc/sysconfig/jenkins #默认端口是8080
53 # Port Jenkins is listening on.
54 # Set to -1 to disable
55 #
56 JENKINS_PORT="8080"
57
58 ## Type: string
59 ## Default: ""
60 ## ServiceRestart: jenkins
61 #
62 # IP address Jenkins listens on for HTTP requests.
63 # Default is all interfaces (0.0.0.0).
64 #
65 JENKINS_LISTEN_ADDRESS=""
.
修改Jenkins的服务脚本
[root@node02 ~]# vim /etc/init.d/jenkins
.
64 # Search usable Java as /usr/bin/java might not point to minimal version required by Jenkins.
65 # see
66 candidates="
67 /etc/alternatives/java
68 /usr/lib/jvm/java-1.8.0/bin/java
69 /usr/lib/jvm/jre-1.8.0/bin/java
70 /usr/lib/jvm/java-1.7.0/bin/java
71 /usr/lib/jvm/jre-1.7.0/bin/java
72 /usr/bin/java
73 /data/jdk/jdk1.8.0_131/bin/java #添加内容--指定你的JAVA所在路径
74 "
75 for candidate in $candidates
76 do
77 [ -x "$JENKINS_JAVA_CMD" ] && break
78 JENKINS_JAVA_CMD="$candidate"
.
启动Jenkins服务:
[root@node02 ~]# service jenkins start
Starting Jenkins [ OK ]
[root@node02 ~]#
访问测试一下吧:
开始界面提示密码生成位置:
[root@node02 ~]# cat /var/lib/jenkins/secrets/initialAdminPassword
粘贴到输入框内即可
接下来,选择建议插件安装:
开始安装插件:
安装完成后,会提示创建用户:
欢迎界面:
接下来就可以创建任务了:
局域网内利用GitLab+Jenkins自动生成GitBook并发布(Nginx)
Linux+Git+Maven+Jenkins+Neuxs自动化编译环境搭建
CentOS6安装Jenkins