当前位置:网站首页>Jenkins installation and deployment process
Jenkins installation and deployment process
2020-11-06 21:40:20 【Architects who can drive】
linux Environment building jenkins The process
1、 download jenkins package 、jdk、maven package 、tomcat Package or jboss
2、 Unpack the installation jdk, Set the environment variable
3、 Unpack the installation maven package , Set up maven-home environment variable
4、 Unpack the installation tomcat Environmental Science ,tomcat With jdk Consistent with the environment variable
5、 Decompression deployment jenkins,
Example press will jenkins Put it in tomcat Next , And start up tomcat Formal startup jenkins
Or consider deploying to jboss Next , Prepare relevant container resources
Log in after startup jenkins website , Such as http://172.22.12.224:8080/jenkins/
Login account password
Download plug-ins , Go to administration plug-ins , In advanced, configure the agent and port according to the network
(1) Download plug-ins : JDK Parameter Plugin、Maven Integration plugin、Publish Over SSH、Subversion Plug-in
(2) Configure global variables :jenkins- System settings -Global Tool Configuration
(a)jdk install , Set a name , And linux Upper jdk route
jdk1.7.0_75
/root/jenkins/jdk1.7.0_75
(b) maven install , Set a name , With the prepared maven route
apache-maven-2.2.1
/root/jenkins/apache-maven-2.2.1
(c) Something to pay attention to ,maven modify setting Content , Include private server address 、 agent 、 Store download package location ( Depending on the specific project , Our project mvn2.2.1 Talent )
(3)jenkins- System management - System settings
(a) Set up Jenkins URL http://172.22.12.224:8080/jenkins/
(b) Set up Publish over SSH - Passphrase land jenkins Password
(c) SSH Servers Remote server login information ( Account password and initial path of remote server )
(d) Test login successful
6、 Create a configuration
( One ) Create a configuration
1、 choose “ newly build ” Get into , Enter a configuration name ( It's difficult to revise )
2、 choice “ Construct a maven” project ( Take this as an example )
3、 Click on OK
( Two ) Edit the configuration
1、 Source control
(1)Repository URL Input svn Code address
(2)Credentials To configure svn Account password
2、Pre Steps After downloading the code , Before compiling code to package , During this period, the process ( We can do differential deployment , Modify some files and so on )
3、Build
(1)Root POM:pom.xml
(2)Goals and options:clean install -Dmaven.test.skip=true
(3) senior
Settings file And Global Settings file You can select global configuration parameters
4、Post Steps
( One ) Add one Send files or execute commands over SHH
( Two ) To configure SSH Publishers
1、SSH SERVER Select the initial server
2、Transfers:
Source files =falcon-controller/target/falcon-controller.war
Remove prefix=falcon-controller/target/
Remote directory =/
3、Exec command ( Execute the script , distinguish tomcat Deployment and jboss Deploy , One out of two )
#tomcat Deploy
serverName=tomcat-8390
serverTemp=/opt/app/jenkins/temptomcat/tomcat-8390/temp
serverWork=/opt/app/jenkins/temptomcat/tomcat-8390/work
serverBin=/opt/app/jenkins/temptomcat/tomcat-8390/bin
deployPath=/opt/app/jenkins/temptomcat/tomcat-8390/webapps/
copyPath=/opt/app/jenkins/tmp
warName=falcon-controller.war
warFile=falcon-controller
#shutdown
cd $serverBin
ps -ef | grep -v grep | grep tomcat-8390 | awk '{print $2}' | xargs kill -9
#delete
rm -rf $deployPath$warName
rm -rf $deployPath$warFile
rm -rf $serverTemp
mkdir $serverTemp
rm -rf $serverWork
mkdir $serverWork
#copy
cp $copyPath/$warName $deployPath
#run
cd $serverBin
nohup ./startup.sh &
# Decide if you can access
STATUS_CODE=0
echo $STATUS_CODE
while [[ $STATUS_CODE != 200 ]]
do
STATUS_CODE=`curl -o /dev/null -s -w %{http_code} http://172.22.12.224:8380/falcon-controller/test.html`
# This address is tomcat Address after startup , According to my own definition
done
#-----------------------------------------------------------------------------------------------------------------------
#jboss Deploy
serverName=falconA-API
serverTemp=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/temp
serverWork=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/work
serverBin=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/bin
deployPath=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/deploy/
copyPath=/opt/app/jenkins/tmp
warName=falcon-controller.war
warFile=falcon-controller
#shutdown
cd $serverBin
ps -ef | grep -v grep | grep falconServer-web | awk '{print $2}' | xargs kill -9
#delete
rm -rf $deployPath$warName
rm -rf $deployPath$warFile
rm -rf $serverTemp
mkdir $serverTemp
rm -rf $serverWork
mkdir $serverWork
#copy
cp $copyPath/$warName $deployPath
export JAVA_HOME=/opt/app/jdk/jdk1.6.0_31
export CLASSPATH=$JAVA_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
#run
cd $serverBin
nohup ./startfalconServer-web.sh &
# Decide if you can access
STATUS_CODE=0
echo $STATUS_CODE
while [[ $STATUS_CODE != 200 ]]
do
STATUS_CODE=`curl -o /dev/null -s -w %{http_code} http://172.22.12.224:8380/falcon-controller/test.html`
done
7、 Build immediately ( This is the boot configuration )
1、 stay Building history Build History Find history in , Click the small down arrow on the right , Click on Console Output You can see the compiled log
2、 The front circular picture is blue , That is, the construction is successful
linux Environment building jenkins The process
1、 download jenkins package 、jdk、maven package 、tomcat Package or jboss
2、 Unpack the installation jdk, Set the environment variable
3、 Unpack the installation maven package , Set up maven-home environment variable
4、 Unpack the installation tomcat Environmental Science ,tomcat With jdk Consistent with the environment variable
5、 Decompression deployment jenkins,
Example press will jenkins Put it in tomcat Next , And start up tomcat Formal startup jenkins
Or consider deploying to jboss Next , Prepare relevant container resources
Log in after startup jenkins website , Such as http://172.22.12.224:8080/jenkins/
Login account password
Download plug-ins , Go to administration plug-ins , In advanced, configure the agent and port according to the network
(1) Download plug-ins : JDK Parameter Plugin、Maven Integration plugin、Publish Over SSH、Subversion Plug-in
(2) Configure global variables :jenkins- System settings -Global Tool Configuration
(a)jdk install , Set a name , And linux Upper jdk route
jdk1.7.0_75
/root/jenkins/jdk1.7.0_75
(b) maven install , Set a name , With the prepared maven route
apache-maven-2.2.1
/root/jenkins/apache-maven-2.2.1
(c) Something to pay attention to ,maven modify setting Content , Include private server address 、 agent 、 Store download package location ( Depending on the specific project , Our project mvn2.2.1 Talent )
(3)jenkins- System management - System settings
(a) Set up Jenkins URL http://172.22.12.224:8080/jenkins/
(b) Set up Publish over SSH - Passphrase land jenkins Password
(c) SSH Servers Remote server login information ( Account password and initial path of remote server )
(d) Test login successful
6、 Create a configuration
( One ) Create a configuration
1、 choose “ newly build ” Get into , Enter a configuration name ( It's difficult to revise )
2、 choice “ Construct a maven” project ( Take this as an example )
3、 Click on OK
( Two ) Edit the configuration
1、 Source control
(1)Repository URL Input svn Code address
(2)Credentials To configure svn Account password
2、Pre Steps After downloading the code , Before compiling code to package , During this period, the process ( We can do differential deployment , Modify some files and so on )
3、Build
(1)Root POM:pom.xml
(2)Goals and options:clean install -Dmaven.test.skip=true
(3) senior
Settings file And Global Settings file You can select global configuration parameters
4、Post Steps
( One ) Add one Send files or execute commands over SHH
( Two ) To configure SSH Publishers
1、SSH SERVER Select the initial server
2、Transfers:
Source files =falcon-controller/target/falcon-controller.war
Remove prefix=falcon-controller/target/
Remote directory =/
3、Exec command ( Execute the script , distinguish tomcat Deployment and jboss Deploy , One out of two )
#tomcat Deploy
serverName=tomcat-8390
serverTemp=/opt/app/jenkins/temptomcat/tomcat-8390/temp
serverWork=/opt/app/jenkins/temptomcat/tomcat-8390/work
serverBin=/opt/app/jenkins/temptomcat/tomcat-8390/bin
deployPath=/opt/app/jenkins/temptomcat/tomcat-8390/webapps/
copyPath=/opt/app/jenkins/tmp
warName=falcon-controller.war
warFile=falcon-controller
#shutdown
cd $serverBin
ps -ef | grep -v grep | grep tomcat-8390 | awk '{print $2}' | xargs kill -9
#delete
rm -rf $deployPath$warName
rm -rf $deployPath$warFile
rm -rf $serverTemp
mkdir $serverTemp
rm -rf $serverWork
mkdir $serverWork
#copy
cp $copyPath/$warName $deployPath
#run
cd $serverBin
nohup ./startup.sh &
# Decide if you can access
STATUS_CODE=0
echo $STATUS_CODE
while [[ $STATUS_CODE != 200 ]]
do
STATUS_CODE=`curl -o /dev/null -s -w %{http_code} http://172.22.12.224:8380/falcon-controller/test.html`
# This address is tomcat Address after startup , According to my own definition
done
#-----------------------------------------------------------------------------------------------------------------------
#jboss Deploy
serverName=falconA-API
serverTemp=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/temp
serverWork=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/work
serverBin=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/bin
deployPath=/opt/app/jboss-eap-5.2A/jboss-as/server/falconServer-web/deploy/
copyPath=/opt/app/jenkins/tmp
warName=falcon-controller.war
warFile=falcon-controller
#shutdown
cd $serverBin
ps -ef | grep -v grep | grep falconServer-web | awk '{print $2}' | xargs kill -9
#delete
rm -rf $deployPath$warName
rm -rf $deployPath$warFile
rm -rf $serverTemp
mkdir $serverTemp
rm -rf $serverWork
mkdir $serverWork
#copy
cp $copyPath/$warName $deployPath
export JAVA_HOME=/opt/app/jdk/jdk1.6.0_31
export CLASSPATH=$JAVA_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
#run
cd $serverBin
nohup ./startfalconServer-web.sh &
# Decide if you can access
STATUS_CODE=0
echo $STATUS_CODE
while [[ $STATUS_CODE != 200 ]]
do
STATUS_CODE=`curl -o /dev/null -s -w %{http_code} http://172.22.12.224:8380/falcon-controller/test.html`
done
7、 Build immediately ( This is the boot configuration )
1、 stay Building history Build History Find history in , Click the small down arrow on the right , Click on Console Output You can see the compiled log
2、 The front circular picture is blue , That is, the construction is successful
版权声明
本文为[Architects who can drive]所创,转载请带上原文链接,感谢
边栏推荐
- C++ 数字、string和char*的转换
- C++学习——centos7上部署C++开发环境
- C++学习——一步步学会写Makefile
- C++学习——临时对象的产生与优化
- C++学习——对象的引用的用法
- C++编程经验(6):使用C++风格的类型转换
- Won the CKA + CKS certificate with the highest gold content in kubernetes in 31 days!
- C + + number, string and char * conversion
- C + + Learning -- capacity() and resize() in C + +
- C + + Learning -- about code performance optimization
猜你喜欢
-
C + + programming experience (6): using C + + style type conversion
-
Latest party and government work report ppt - Park ppt
-
在线身份证号码提取生日工具
-
Online ID number extraction birthday tool
-
️野指针?悬空指针?️ 一文带你搞懂!
-
Field pointer? Dangling pointer? This article will help you understand!
-
HCNA Routing&Switching之GVRP
-
GVRP of hcna Routing & Switching
-
Seq2Seq实现闲聊机器人
-
【闲聊机器人】seq2seq模型的原理
随机推荐
- LeetCode 91. 解码方法
- Seq2seq implements chat robot
- [chat robot] principle of seq2seq model
- Leetcode 91. Decoding method
- HCNA Routing&Switching之GVRP
- GVRP of hcna Routing & Switching
- HDU7016 Random Walk 2
- [Code+#1]Yazid 的新生舞会
- CF1548C The Three Little Pigs
- HDU7033 Typing Contest
- HDU7016 Random Walk 2
- [code + 1] Yazid's freshman ball
- CF1548C The Three Little Pigs
- HDU7033 Typing Contest
- Qt Creator 自动补齐变慢的解决
- HALCON 20.11:如何处理标定助手品质问题
- HALCON 20.11:标定助手使用注意事项
- Solution of QT creator's automatic replenishment slowing down
- Halcon 20.11: how to deal with the quality problem of calibration assistant
- Halcon 20.11: precautions for use of calibration assistant
- “十大科学技术问题”揭晓!|青年科学家50²论坛
- "Top ten scientific and technological issues" announced| Young scientists 50 ² forum
- 求反转链表
- Reverse linked list
- js的数据类型
- JS data type
- 记一次文件读写遇到的bug
- Remember the bug encountered in reading and writing a file
- 单例模式
- Singleton mode
- 在这个 N 多编程语言争霸的世界,C++ 究竟还有没有未来?
- In this world of N programming languages, is there a future for C + +?
- es6模板字符
- js Promise
- js 数组方法 回顾
- ES6 template characters
- js Promise
- JS array method review
- 【Golang】️走进 Go 语言️ 第一课 Hello World
- [golang] go into go language lesson 1 Hello World