Jenkins配置jdk&git&Allure
Jenkins配置jdk
jdk 和 git 在Jenkins容器中默认已经安装。
进入Jenkins容器,找到容器内JAVA_HOME:
bash-5.1# java -version \openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7) OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode) bash-5.1# git version git version 2.32.0 bash-5.1# echo $PATH # 查看java_home路径即:/opt/java/openjdk /opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jenkins全局工具配置java jdk
将/opt/java/openjdk路径添加到Jenkins全局工具配置中:
配置git
容器环境从软连中过滤Git
bash-5.1# ls /usr/bin/git* /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-shell /usr/bin/git-upload-archive /usr/bin/git-upload-pack
将/usr/bin/git软连添加到管理 jenkins --->全局工具配置中的git选项中的git选项中:
配置**Allure Commandline
1、在插件中心下载allure插件
2、管理jenkins--->全局工具配置中的Allure Commandline