Jenkins是一個(gè)非常出色的持續(xù)集成服務(wù)器,,本文主要介紹在CentOS系統(tǒng)中Jenkins的基本安裝配置方法,供參考,。 一. 軟件包:1. 下載apache-maven-2.2.1-bin.tar 二. 安裝
本文假設(shè)操作用戶為gistech。 1. 安裝jdk,,參考《CentOS系統(tǒng)中安裝JDK1.6》,。 修改tomcat配置文件 $ vi /home/gistech/tomcat/conf/server.xml
修改8080端口的Connector節(jié)點(diǎn),,增加如下配置 URIEncoding="UTF-8"
3. 安裝maven $ tar -zvxf apache-maven-2.2.1-bin.tar.gz
2) 移動(dòng)到其他目錄 $ mv apache-maven-2.2.1 /home/gistech/maven 3) 配置環(huán)境變量 $ cd /home/gistech
$ vi .bash_profile
添加如下內(nèi)容 MAVEN_HOME=$HOME/maven PATH=$PATH:$HOME/bin:$MAVEN_HOME/bin export MAVEN_HOME export PATH
使環(huán)境變量生效 $ source .bash_profile
4) 驗(yàn)證是否安裝成功 $ mvn -v
5) 配置maven $ cd maven/conf
$ vi settings.xml
修改配置文件示例如下: <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven./SETTINGS/1.0.0" xmlns:xsi="http://www./2001/XMLSchema-instance" xsi:schemaLocation="http://maven./SETTINGS/1.0.0 http://maven./xsd/settings-1.0.0.xsd"> <localRepository>/home/gistech/~m2</localRepository> <servers> <server> <username>admin</username> <password>password</password> </server> </servers> <mirrors> <mirror> <!-- This sends everything else to /public --> <id>nexus</id> <mirrorOf>central</mirrorOf> <url>http://192.168.120.247:8081/nexus/content/repositories/public</url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <!-- Enable snapshots for the built in central repo to direct --> <!-- all requests to nexus via the mirror --> <repositories> <repository> <id>central</id> <url>http://192.168.120.247:8081/nexus/content/repositories/public</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://192.168.120.247:8081/nexus/content/repositories/public</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <!-- make the profile active all the time --> <activeProfile>nexus</activeProfile> </activeProfiles> <pluginGroups> <!-- define the sonatype plugin group, so the nexus plugins will work without typing the groupId --> <pluginGroup>org.sonatype.plugins</pluginGroup> </pluginGroups> </settings>
其中l(wèi)ocalRepository節(jié)點(diǎn)表示私服中下載的jar包存放路徑,根據(jù)實(shí)際存放的路徑修改,。 $ mv jenkins.war /home/gistech/tomcat/webapps
2) 配置環(huán)境變量 JENKINS_HOME=$HOME/tomcat/webapps/jenkins
export JENKINS_HOME
使環(huán)境變量生效 source .bash_profile
3) 啟動(dòng)tomcat,,使用http://localhost:8080/jenkins訪問jenkins 三,、jenkins的基本配置1、全局配置 單擊首頁左邊的“系統(tǒng)管理”,,進(jìn)入“系統(tǒng)設(shè)置”,,在這里對jenkins進(jìn)行全局設(shè)置
如0 * * * * 表示的就是每個(gè)小時(shí)的第 0 分鐘執(zhí)行一次構(gòu)建,。 分類: 運(yùn)維與基礎(chǔ)架構(gòu)
|
|