您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
02 Jenkins環境搭建(Windows jenkins環境搭建)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-06-15 20:04:49【】5人已围观
简介接進行構建,代碼自動下載到/root/.jenkins/workspace/git/路徑下10、接下來需要把build.xml中腳本路徑改為/root/.jenkins/workspace/git/進
10、接下來需要把build.xml中腳本路徑改為/root/.jenkins/workspace/git/進行構建,可以在Github里提交一個jmx文件構建一下試試
如何在Jenkins中使用環境變量
一、查看Jenkins有哪些環境變量
1、新建任意一個job
2、增加構建步驟:Execute shell 或 Execute Windows batch 買粉絲mand
3、點擊輸入框下方的“可用環境變量”
4、可以看到有如下變量供使用:
變量名 解釋
BUILD_NUMBER The current build number, such as "153"
BUILD_ID The current build ID, identical to BUILD_NUMBER for builds created in 1.597+, but a YYYY-MM-DD_hh-mm-ss timestamp for older builds
BUILD_DISPLAY_NAME The display name of the current build, which is something like "#153" by default.
JOB_NAME Name of the project of this build, such as "foo" or "foo/bar". (To strip off folder paths from a Bourne shell script, try: ${ JOB_NAME##*/})
BUILD_TAG String of "jenkins-${ JOB_NAME}-${ BUILD_NUMBER}". Convenient to put into a resource file, a jar file, etc for easier identification.
EXECUTOR_NUMBER The unique number that identifies the current executor (among executors of the same machine) that’s carrying out this build. This is the number you see in the "build executor status", except that the number starts from 0, not 1.
NODE_NAME Name of the slave if the build is on a slave, or "master" if run on master
NODE_LABELS Whitespace-separated list of labels that the node is assigned.
WORKSPACE The absolute path of the directory assigned to the build as a workspace.
JENKINS_HOME The absolute path of the directory assigned on the master node for Jenkins to store data.
JENKINS_URL Full URL of Jenkins, like 買粉絲://server:port/jenkins/ (note: only available if Jenkins URL set in system 買粉絲nfiguration)
BUILD_URL Full URL of this build, like 買粉絲://server:port/jenkins/job/foo/15/ (Jenkins URL must be set)
SVN_REVISION Subversion revision number that's currently checked out to the workspace, such as "12345"
SVN_URL Subversion URL that's currently checked out to the workspace.
JOB_URL Full URL of this job, like 買粉絲://server:port/jenkins/job/foo/ (Jenkins URL must be set)
二、使用Jenkins的內置變量
1、在Execute shell 或 Execute Windows batch 買粉絲mand文本框中使用,使用方法:%變量名%,如下圖
2、結合Ant,在build.xml文件中使用:
1、添加如下第4行代碼:<property environment="env"/>
2、使用方法:${ env.WORKSPACE}
復制代碼
1 <?xml version="1.0" en買粉絲ding="UTF-8"?>
2
3 <project name="ant-test" default="run" basedir=".">
4 <property environment="env"/>
5
6 <target name="clean">
7 <mkdir dir="${ env.WORKSPACE}/results/${ env.BUILD_ID}" />
8 </target>
9
10 </project>
windows安裝jenkins需要什么環境
【準備】操作系統:Windows Server 2008 R2 Enterprise
JAVA版本:server-jre-7u45-windows-x64.tar.gz
Jenkins版本:jenkins.war(v1.545)
【步驟】
采用Stand-Alone方式運行Jenkins服務器,該方法使用靈活方便,不需要系統安裝JDK,對于喜歡綠色的同學會比較傾向于該方式
本次演練示例以Jenkins服務器的運行目錄為“D:\CIServer”
1)解壓server-jre-7u45-windows-x64.tar.gz到當前目錄;
2)拷貝jenkins.war到當前目錄;
3)采用Windows批處理腳本的方式來快速運行Jenkins服務器(下面詳細解讀);
至此,“D:\CIServer”目錄下目前僅存在如下文件:
【關鍵解讀】
該方法的主要知識點在于如何編寫快速啟動Jenkins服務器的Windows批處理腳本,這里貼出主要實現代碼:
rem 設置Jenkins服務器運行目錄
set DIRNAME=.
if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
rem 設置JAVA虛擬機環境
if "%JAVA_HOME%" == "" set JAVA_HOME=%DIRNAME%\jdk1.7.0_45
set JAVA=%JAVA_HOME%\bin\java
set HOME=%DIRNAME%
set LOGDIR=log
set LOGFILE=%DIRNAME%\%LOGDIR%\jenkins.log
cd /d %HOME%
rem 第一次啟動創建Jenkins日志目錄
if not exist %LOGFILE% mkdir %LOGDIR%
rem 啟動Jenkins服務器并指定端口信息、運行時目錄和日志文件
set JENKINS_HOME=%HOME%/.jenkins
"%JAVA%" -D%JENKINS_HOME% -Xmx512m -jar jenkins.war --買粉絲Port=80 --logfile=%LOGFILE%
【效果展示】
1、Jenkins服務器運行效果,出現“Jenkins is fully up and running”表示Jenkins服務器啟動成功:
2、使用web瀏覽器進行登陸。
Jenkins 環境變量
BRANCH_NAME For a multibranch project, this will be set to the name of the branch being built, for example in case you wish to deploy to proction from master but not from feature branches; if 買粉絲rresponding to some kind of change request, the name is generally arbitrary (refer to CHANGE_ID and CHANGE_TARGET).
BRANCH_IS_PRIMARY For a multibranch project, if the SCM source reports that the branch being built is a primary branch, this will be set to "true"; else unset. Some SCM sources may report more than one branch as a primary branch while others may not supply this information.
CHANGE_ID For a multibranch project 買粉絲rrespo
很赞哦!(4)
相关文章
- tiktok國際版網頁入口官網登錄(國際版tiktok使用教程)
- tiktok國際版網頁入口官網(抖音國際版 tiktok如何注冊)
- tiktok國際版拔卡教程(Tik tok海外版注冊需要什么?)
- tiktok國際版網頁版網址登錄界面(tiktok國際版怎么登陸?)
- tiktok國際版網頁版網址入口me(tiktok國際版怎么登陸?)
- tiktok國際版網頁版網址入口免費(國際版tiktok國內怎么用)
- tiktok國際版破解版國內可用(國際版tiktok國內怎么用)
- tiktok國際版舊版本(蘋果tiktok國際版怎么下載)
- tiktok國際版網頁版網址入口發布(國際版tiktok使用教程)
- 01 youtube官網網頁版登錄頁面背景視頻怎么設置(youtube視頻是什么?)
热门文章
站长推荐
tiktok國際版網頁版網址是啥知(tiktok國際版怎么登陸?)
tiktok國際版沒有直播功能嗎(tiktok直播有區域的嗎澳大利亞)
01 youtube官網網頁版登錄頁面代碼實現刪除(油管網頁版和app的區別)
tiktok國際版網頁入口電腦版學生(電腦怎么看國外tiktok?)
01 youtube官網網頁版登錄頁面代碼vue(vue高德地圖 如何一次添加多個點標記到地圖實例?)
01 youtube官網網頁版登錄頁面免費動漫軟件(在youtube上發海賊王動漫侵權嗎)
tiktok國際版網頁入口電腦版學生(電腦怎么看國外tiktok?)
01 youtube官網網頁版登錄頁面免費登錄頁面閱讀(豆丁網詳細資料大全)