jenkins搭建

二次信任 提交于 2021-02-15 17:29:06

环境

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!