jenkins
2019-01-26 14:03:21 0 举报
AI智能生成
Jenkins安装步骤
作者其他创作
大纲/内容
准备应用服务器
安装配置git
安装 git yum install git
git config --global user.name ""
git config --global user.email ""
生成公私钥 ssh-keygen -t rsa -C ""
生成的公钥在 /root/.ssh/id_rsa.pub
验证和coding的ssh通讯 ssh -T -p 443 git@git-ssh.coding.net
安装配置maven
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">wget <a href="http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz">http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz</a></span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">tar zxvf apache-maven-3.5.4-bin.tar.gz</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">vim ~/.bashrc</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export MAVEN_HOME=/usr/local/maven/apache-maven-3.5.4</span></p><br><p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export MAVEN_BIN=$MAVEN_HOME/bin</span></p><br><p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export PATH=$MAVEN_BIN:$PATH</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">. ~/.bashrc</span></p><br>
安装配置jdk
<span style="font-family: "PingFang SC"; -webkit-text-stroke-color: rgb(68, 68, 68);">vim ~/.bashrc</span><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export JAVA_HOME=/usr/local/java/jdk1.8.0_51</span></p><br><p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export JAVA_BIN=$JAVA_HOME/bin</span></p><br><p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export JAVA_LIB=$JAVA_HOME/lib</span></p><br><p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export CLASSPATH=.:$JAVA_LIB/tools.jar:$JAVA_LIB/dt.jar</span></p><br><p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">export PATH=$JAVA_BIN:$PATH</span></p><br>
<span style="font-family: "PingFang SC"; -webkit-text-stroke-color: rgb(68, 68, 68);">. ~/.bashrc</span><br>
安装配置tomcat
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat-9/v9.0.10/bin/apache-tomcat-9.0.10.zip</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">在tomcat目录下配置可执行权限 chmod a+x -R *</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">vim conf/server.xml</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">bin/startup.sh</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">bin/shutdown.sh</span></p><br>
<p style="font-stretch: normal; line-height: normal; font-family: "PingFang SC"; -webkit-text-stroke-width: initial; -webkit-text-stroke-color: rgb(68, 68, 68);"><span style="font-kerning: none">tail -500f logs/catalina.out</span></p><br>
自动化部署任务
jenkins基础知识
下载地址jenkins.io
拷贝到远程服务器 scp Downloads/jenkins.war root@113.31.18.109:/usr/local
查看端口号占用情况 lsof -i:8080
清空jenkins配置 rm -rf /root/.jenkins
启动 nohup java -jar jenkins.war &
一键发布实战
0 条评论
下一页