您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
02 Jenkins環境搭建(接口自動化測試環境搭建jmeter+ant+git+jenkins)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-21 14:46:29【】1人已围观
简介接進行構建,代碼自動下載到/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
很赞哦!(8535)
相关文章
- 03 夏和味(廈門)貿易有限公司(張源美茶行的錫茶筒下印有《顏增記《》字樣我想了解其中歷史謝謝!((茶筒有幾十年歷史了))
- 03 youtube官網買粉絲下載圖片到桌面上(響應式網站有什么優缺點?)
- 03 youtube官網買粉絲下載器安卓12和(華為怎么下載youtube這個軟件)
- 03 外地來的粉絲買車(網上很多的車評人,都會幫粉絲低價買車,他們是在作秀嗎?)
- 03 外地人和上海本地人結婚申報戶口(外地人嫁到上海多久可以辦理戶口遷移)
- 03 youtube官網買粉絲下載圖片到桌面快捷(響應式網站有什么優缺點?)
- 03 外經貿大學的全稱(上海對外經貿大學是一本院校嗎?)
- 03 youtube官網登錄入口官網官網(請問最好用的在線二維碼生成器有哪些)
- 03 youtube官網電腦版下載免費下載mp3(2022最新版從0-1運營TikTok的保姆級教程)
- 03 外地戶口在珠海上學需要什么條件(非珠海戶口怎樣辦理轉學手續?)
热门文章
站长推荐
03 youtube官網買粉絲下載安裝不了應用商店(在什么網站可以下載嗶哩嗶哩的視頻?)
03 外經貿單證專業培訓考試有必要考嗎(外經貿單證專業證書?)
03 youtube官網入口買粉絲官網買粉絲是多少(you tu be的官網是多少?)
03 youtube官網入口買粉絲是否通過了什么(you tu be的官網是多少?)
03 外經貿是211還是985(對外經濟貿易大學是985還是211)
03 外地大學生落戶上海的條件是什么(外地人在上海落戶的條件是什么?)
03 youtube官網買粉絲下載安裝最新版官方下載(you tu be的官網是多少?)
03 youtube官網入口買粉絲網站官網下載官網(ios app上架流程是什么,怎樣避免提交審核被拒)