1、下载 JDK并解压
下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
sudo scp /Users/yylc-ios/Downloads/jdk-8u211-linux-x64.tar.gz nightelf@10.20.16.146:/home/nightelf
tar -xvf jdk-8u211-linux-x64.tar.gz
vim /etc/profile 写入
export JAVA_HOME=/home/nightelf/jdk1.8.0_211
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
查看版本号
java -version
2、下载tomcat和下载jenkins.war包 并把包放在tomcat中运行
tomcat下载地址:wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.21/bin/apache-tomcat-9.0.21.tar.gz
jenkins下载地址:wget http://mirrors.jenkins.io/war/latest/jenkins.war
tar -xvf apache-tomcat-9.0.21.tar.gz
mv jenkins.war tomcat9/webapps/
sh tomcat9/bin/startup.sh
安装git
apt-get install git
3、安装下载maven
下载地址:http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
tar -xvf apache-maven-3.6.1-bin.tar.gz
vim /etc/profile 写入
export M2_HOME=/home/nightelf/maven3
export CLASSPATH=$CLASSPATH:$M2_HOME/lib
export PATH=$PATH:$M2_HOME/bin
vim maven的conf/setting.xml配置增加阿里云源
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
4、然后开始安装jenkins
访问yourIP:8080会要求让你填入密码 cat /root/.jenkins/secrets/initialAdminPassword
16f3d68613dd474194d85ab050d66fef
选择从右边项选择插件安装
安装
publish-over-ssh
git-parameter
maven-integara
如果报错An error occurred during installation: No such plugin: cloudbees-folder
请看:https://www.cnblogs.com/Charles-Yuan/p/9589284.html
安装配置
选择全局配置:
jdk:/home/nightelf/jdk1.8.0_211
git:/usr/bin/git
maven:/home/nightelf/maven3
另外一种安装:
https://www.cnblogs.com/qwangxiao/p/10970705.html
参考资料:
网友评论