您好,登錄后才能下訂單哦!
**思路:
1.搭建Jenkins需要的環境
2.選擇安裝Jenkins的方式
流程如下:
環境(git、maven、java)
jdk安裝: 提前把jdk包下載好再上傳 /usr/local
rpm -qa |grep openjdk
rpm -e --nodeps 刪除自帶的jdk包
(wget -O /usr/local/jdk-8u191-linux-x64.tar.gz http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u231-linux-x64.tar.gz )(wget 方式下載默認是不接受協議,故不采取)
cd /usr/local
tar -xvf jdk-8u231-linux-x64.tar.gz
vi /etc/profile
export JAVA_HOME= /usr/local/jdk1.8.0_231
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
source /etc/profile
maven安裝:(mvn -v 查看版本)
wget -O /usr/local/apache-maven-3.6.1-bin.tar.gz http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
cd /usr/local
tar -zxvf apache-maven-3.6.1-bin.tar.gz
vi /etc/profile
export MAVEN_HOME=/usr/local/apache-maven-3.6.1
export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
source /etc/profile
git安裝
yum install -y git (git --version)查看版本
jenkins安裝(選擇yum安裝)
cd /etc/yum.repos.d/
wget http://pkg.jenkins.io/redhat/jenkins.repo
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum install -y jenkins
systemctl start jenkins
最后通過打開瀏覽器輸入ip:8080進行安裝
啟動jenkins報錯:
Starting Jenkins bash: /usr/bin/java: No such file or directory
解決方法:
vim /etc/init.d/jenkins
在此處加入
candidates="
/setup/tools/jdk1.8.0_144/bin/java #此處為加入的java路徑
vim /etc/sysconfig/jenkins
do
[ -x "$JENKINS_JAVA_CMD" ] && break
JENKINS_JAVA_CMD="$candidate" #此處為$candidate
done
systemctl daemon-reload
systemctl start Jenkins
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。