作者:wangxuan1992_273_361 | 来源:互联网 | 2023-07-27 19:56
这篇文章主要介绍“centos6.7下jenkins的搭建方法”,在日常操作中,相信很多人在centos6.7下jenkins的搭建方法问题上存在疑惑,小编查阅了各式资
这篇文章主要介绍“centos6.7下jenkins的搭建方法”,在日常操作中,相信很多人在centos6.7下jenkins的搭建方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”centos6.7下jenkins的搭建方法”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
环境
OS:centos6.7
搭建
yum install curl libcurl git epel-release nss-devel ...
# 下载maven 3.6.3
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
解压到/usr/local/apache-maven
# 下载jdk 1.8
# https://download.oracle.com/otn/java/jdk/8u261-b12/a4634525489241b9a9e1aa73d9e118e6/jdk-8u261-linux-x64.tar.gz?AuthParam=1599714260_f6a69fe9c91c354923bb894d5b9d2aab
解压到/usr/local/jdk
# 添加环境变量
# /etc/profile.d/java.sh
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=${JAVA_HOME}/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
# /etc/profile.d/maven.sh
export MAVEN_HOME="/usr/local/apache-maven"
PATH=$PATH:$MAVEN_HOME/bin
# 安装 jenkins
# 方法一
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
# 方法二
https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/2.256/jenkins.war
启动jenkins java -jar jenkins.war
# 方法三
下载tomcat apache-tomcat-7.0.105
解压到 /usr/local/apache-tomcat
放入 /usr/local/apache-tomcat/webapps/jenkins.war
启动jenkins /usr/local/apache-tomcat/bin/startup.sh
# jenkins 插件源替换 ~/.jenkins/updates/default.json
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json
sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
到此,关于“centos6.7下jenkins的搭建方法”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程笔记网站,小编会继续努力为大家带来更多实用的文章!