CentOS7系統下搭建Jenkins環境


1. 安裝JDK

yum -y install java

2.安裝Ant

添加JPackage源

yum -y install wget
wget http://www.jpackage.org/jpackage50.repo -P /etc/yum.repos.d/

安裝Ant

yum -y install ant

3.安裝Maven

yum -y install maven

4.安裝Tomcat

yum -y install tomcat

設置tomcat編碼為UTF-8

# vi /etc/tomcat/server.xml

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8" />

5.安裝Jenkins

方法1:

下載jenkins.war到webapps目錄下

wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war -P /var/lib/tomcat/webapps/

設置tomcat自啟動,並啟動tomcat

chkconfig tomcat on
service tomcat start

訪問Jenkins主頁  http://localhost:8080/jenkins

方法2:

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key
yum install jenkins

設置jenkins自啟動,並啟動jenkins

chkconfig jenkins on
service jenkins start

jenkins默認端口是8080,如果端口已被別的程序占用,可在jenkins配置文件/etc/sysconfig/jenkins中修改jenkins端口號

JENKINS_PORT="8001"

如果還安裝有tomcat程序,還需修改AJP端口號

JENKINS_AJP_PORT="8010"

訪問Jenkins主頁  http://localhost:8001

5.JDK、Maven、Ant配置

6.插件管理

Jenkins能夠集成各式插件,如常用CI插件:deploy,junit,findbugs,pmd,checkstyle,clover, duplicate code,jmeter,selenium等

點擊 “系統管理” -> “管理插件”

點擊 “可選插件”,選擇需要的插件

然后點擊 “直接安裝”


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM