1. 程式人生 > 其它 >jenkins 2.3 gitlabhook 和 ruby-runtime 外掛 安裝失敗

jenkins 2.3 gitlabhook 和 ruby-runtime 外掛 安裝失敗

1. gitlabhook 和 ruby-runtime 外掛 下載地址

gitlabhook :https://updates.jenkins-ci.org/download/plugins/ruby-runtime/
ruby-runtime :https://updates.jenkins-ci.org/download/plugins/gitlab-hook/

2. 匯入

方法一:

把下載的 xxx.hpi 放入/var/lib/jenkins/plugins,讓後重啟jenkins

<root@jenkins plugins># pwd
/var/lib/jenkins/plugins
<root@jenkins plugins># ls |grep ruby-runtime
ruby-runtime
ruby-runtime.bak
ruby-runtime.jpi
<root@jenkins plugins># ls |grep gitlab
gitlab-hook
gitlab-hook.bak
gitlab-hook.jpi
gitlab-plugin
gitlab-plugin.jpi

方法二:

可是我匯入之後還有問題:

提示:ruby-runtime: java.lang.RuntimeException: unsupported Java version: 11

原來我之前安裝jenkins的時候是選擇的是java11, 現在換成java8 就可以了。按官方的文件選擇java11 坑真多

[root@jenkins-server ~]# tar xf jdk-8u191-linux-x64.tar.gz
[root@jenkins-server ~]# ls
anaconda-ks.cfg jdk1.8.0_191
apache-maven-3.6.1-bin.tar.gz jdk-8u191-linux-x64.tar.gz
apache-tomcat-8.5.40.tar.gz
[root@jenkins-server ~]# mv jdk1.8.0_191 /usr/local/jdk
[root@jenkins-server ~]# ls /usr/local/jdk
bin lib src.zip
COPYRIGHT LICENSE THIRDPARTYLICENSEREADME-JAVAFX.txt
include man THIRDPARTYLICENSEREADME.txt
javafx-src.zip README.html
jre release
[root@jenkins-server ~]# tail -2 /etc/profile
export JAVA_HOME=/usr/local/jdk
export PATH=${JAVA_HOME}/bin:$PATH
[root@jenkins-server ~]# source /etc/profile
[root@jenkins-server ~]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

#修改/etc/rc.d/init.d/jenkins,新增java
84 /usr/local/jdk/bin/java
#修改/etc/sysconfig/jenkins,新增java
19 JENKINS_JAVA_CMD="/usr/local/jdk/bin/java"

# 重啟
[root@jenkins-server ~]# systemctl daemon-reload
[root@jenkins-server ~]# systemctl restart jenkins
new