ǰλ: ҳ > >

Jenkinsʹ---*

ʱ:

?


Java8


?


2Jenkeinswarjenkins.war


wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war


?


?


3زJenkeinsӦ÷Tomcat?ѹtar.gztomcatΪִкͶдȨ


????һȨޣchmod u+x *.sh(.sh ļ ִȨޣ磺tomcatlogsĿ¼ҪдȨޣbinĿ¼Ҫ


????ִȨޡ


?


4Maven


????????wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip


????b


װMaven ?[jenkinsʱMaven],ѹapache-maven-3.2.5-bin.zipװ·,Maven


?


ͼ


export MAVEN_HOME=/opt/apache-maven-3.2.5


export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin


?


5TomcatеIJҪ


?޸server.xmlļеıַΪUTF-8,˿ںźͻһ޸,ͼ


????


?


6jenkins.warjenkins.warTomcat webapp £binĿ¼tomcatɡ


?


7tomcat/binĿ¼£ ?./startup.sh & ?tomcat


ʣ1**.**.**:8080/jenkins ͼ????? ??


8??JenkinsĿĬϴ·jenkinsʱĬϻûĿ¼»ᴴ.jenkinsĿ¼


????????jenkinsĿϢ磺rootȨJenkins /root ´ ?.jenkins Ŀ¼


???????? ʱݺͻָ.jenkinsĿ¼ɣͼ


????????????????


?


9ϵͳʱԶ.jenkins/optд?.jenkins?


޸·jenkinsĬ·/etc/profile ļJENKINS_HOME


export JENKINS_HOME=/opt/.jenkins; ?ͼ


???


?


10tomcat ҵ


??


???


?


11?Զװ


???


?


12ע᣺


????


?


13ϵͳã


???


?


14ɺԿ jenkinsĿ¼? /opt/.jenkins ? ͼ


???


?


??15ָ


????JENKINS_HOME·?.jenkinsĿ¼ɡJenkinsã ? ? ? ?


??????????????????ðȫ?? [ϵͳ > Configure Global Security]


????????????ðȫԡͼ


???


16û/ ? jenkins Ȩ ,ͼϣ


17עjenkinsʻͼ


????


18ûȨ ?[עûûȨ޵½]


????19ûȨ?[ϵͳ > û]


??ùԱ?jenkins?½עûӦ û/飬ReadȨ޼ɵ½ͼ


????20Jenkins??[ϵͳ > ϵͳ]


??JDKmaven,git


??


??



ʼ֪ͨ===ע⣺뿪SMTP˿????


װһĿпѡûпѡ ?>߼>ȡ


?1. SVN(Subversion Plugin)


?????????δװѡSubversion Pluginװɡ


?2. GIT(밲װGit Plugin)?Git PluginCredentials PluginGit Client PluginSCM API Plugin?


? ????????δװѡ?Git Pluginװɡ


?3. Զ̲ ?·£


??????????http://mirror.bit.edu.cn/jenkins/plugins/deploy/1.10/deploy.hpi



Jenkins->ϵͳ->->߼ ϴѡdeploy.hpiļϴδװ


?? ѡDeploy to container Pluginװɡ


4 .븲ʲEmma װ( Emma Plugin ? Emma Coverage Column )


5. CheckstyleװStatic Analysis UtilitiesCheckstyle PluginEzWall Plugin


? SVN(밲װSubversion Plug-in)ùԴ


GIT(밲װ Git Plugin) CredentialsȨ ͼ



?


?


JobһɷĿ



?


ùƵ


1Poll SCM:仯󹹽ͼ? ?



2Build periodically



?


עcron-style﷨


? ?MINUTE ? HOUR ? DOM ? MANTH ? DOW


? ?MINUTE0-59???HOUR0-23????DOM1-31?? MONTH1-122?? DOW0-7 0,7DZʾ мַ


? ?1* ʾڸֶпֵֵܳ


? ?2Ҳʹַ-巶ΧDOWֶ϶1-5ʾһ


? ?3ʹбܷŶһһΧMINUTEֶ϶ */5? ʾÿӵ˼


? ?4ʹöŷָһֶαʾһϵЧֵHOUR ֶζ 12,18 ʾ1218


?


ԶԶ𣨱밲װDeploy to container Plugin


1.ԶԶ


:



????


?


WAR/EAR files : ҪWAR/EARԴ


Context path : ?


tomcat£? ?


?


tomcatɫ



?


?


?


עԶwartomcatΪ״̬Զ


:


? 1.jenkinstomcatʱjenkinsϴʱͼ


? ?ҪΪtomcatڴ̫СÿһҪ*һΣ*ڴͲϴʣİ


catalina.shڴͿ.cygwinǰӣ


? JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=512m"


jenkinsķʡhttp://ip:8090/jenkins/


ע⣺뿪ŷǽ˿


1iptables


? 鿴iptalbes״̬service iptables status


??رiptablesservice iptables stop


3 ӷǽ


????????????iptablesservice iptables start


??? *ǽЧ


????????????鿴ǽǷЧiptables -nL --line-number



?


?


?


?


?


?


?


?


?


?


?


?


?



ӣ