Jenkins的安裝與配置


資源下載:

--jenkins的war包

  首先從http://jenkins-ci.org/下載最新的jenkins版本,最新版本為1.594,下載的文件載體為jenkins.war;

  Jenkins為免費開源軟件,並且更新速度穩定,每周一次更新。所以網站上會提供有2個版本,一個最新版本,一個老但穩定的版本。可自行選擇。

  這里我下載的的版本是2.32.1.war

--ant

  下載地址:http://ant.apache.org/

  這里我下載的是:apache-ant-1.9.8-bin.tar.gz

--maven

  下載地址: http://maven.apache.org/

  這里我下載的是:apache-maven-3.3.9-bin.zip

--jdk

   1.7.80

--tomcat

    7.0.72

 

環境變量設置

[tomcat@wls12c ~]$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[tomcat@wls12c ~]$ ant -version
Apache Ant(TM) version 1.9.8 compiled on December 25 2016

 

Jenkins的啟動

  方式一:直接用命令啟動

Command Line Parameter

Description

--httpPort=$HTTP_PORT

Runs Jenkins listener on port $HTTP_PORT using standard http protocol. The default is port 8080. To disable (because you're using https), use port -1.

--httpListenAddress=$HTTP_HOST

Binds Jenkins to the IP address represented by $HTTP_HOST. The default is 0.0.0.0 — i.e. listening on all available interfaces. 
For example, to only listen for requests from localhost, you could use: --httpListenAddress=127.0.0.1

--httpsPort=$HTTP_PORT

Uses HTTPS protocol on port $HTTP_PORT

--httpsListenAddress=$HTTPS_HOST

Binds Jenkins to listen for HTTPS requests on the IP address represented by $HTTPS_HOST.

--prefix=$PREFIX 

Runs Jenkins to include the $PREFIX at the end of the URL. 
For example, to make Jenkins accessible at http://myServer:8080/jenkins, set --prefix=/jenkins

--ajp13Port=$AJP_PORT

Runs Jenkins listener on port $AJP_PORT using standard AJP13 protocol. The default is port 8009. To disable (because you're using https), use port -1.

--ajp13ListenAddress=$AJP_HOST

Binds Jenkins to the IP address represented by $AJP_HOST. The default is 0.0.0.0 — i.e. listening on all available interfaces.

--argumentsRealm.passwd.$ADMIN_USER

Sets the password for user $ADMIN_USER. If Jenkins security is turned on, you must log in as the $ADMIN_USER in order to configure Jenkins or a Jenkins project. NOTE: You must also specify that this user has an admin role. (See next argument below).

--argumentsRealm.roles.$ADMIN_USER=admin

Sets that $ADMIN_USER is an administrative user and can configure Jenkins if Jenkins' security is turned on. See Securing Jenkins for more information.

-Xdebug -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n

Sets debugging on and you can access debug on $DEBUG_PORT.

-%m-%d_%H-%M"`.log

Logging to desired file

-XX:PermSize=512M -XX:MaxPermSize=2048M -Xmn128M -Xms1024M -Xmx2048M

referring to these options for Oracle Java 

以9090端口啟動

java -jar jenkins.war --httpPort=9090

 

 方式二、在Web容器中運行

 Jenkins可以運行在標准的Web服務器中,支持Tomcat、Jboss、WebLogic中,只需要將Jenkins.war放置到相應目錄,啟動服務就可以進行訪問;推薦采用這個方式運行,方便配置和遷移。

 

Jenkins的訪問

  驗證jenkins是否運行正常,通過訪問http://192.168.0.80:9090

這里有一個臨時密碼需要輸入,在/home/tomcat/.jenkins/secrets/initialAdminPassword里面

輸入密碼進入:

 

這里選擇把建議的插件全裝上去

--設置用戶名和密碼

保存,進入主界面

 


免責聲明!

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



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