Jenkins初級(jí)應(yīng)用之Invoke?Phing?targets插件配置
Invoke Phing targets這個(gè)插件主要是讀取xml形式包括自動(dòng)化測試打包部署的配置文件,然后根據(jù)流程走下來。用phing命令讀取并執(zhí)行xml配置文件,然后執(zhí)行定義的步驟。比如check、tar、phpunit操作。
本文用tar這個(gè)功能來介紹 Invoke Phing targets 插件,順便也介紹一下tar這個(gè)通用的功能,在我們?nèi)粘5淖詣?dòng)化構(gòu)建的應(yīng)用。
一、安裝插件
1、通過“系統(tǒng)管理”到“插件管理”到“可選插件”里面查找安裝。


二、配置 包括服務(wù)器的xml
1、build.xml(放在項(xiàng)目的根目錄下面)
<?xml version="1.0" encoding="UTF-8"?>
<project name="api" default="build">
<target name="build" depends="make_runtime,phpcs-ci,phploc,pdepend,phpcb,phpunit,phpdox,phpcpd"/>
<property name="version-m" value="1.1" />
<property name="version" value="1.1.0" />
<property name="stability" value="stable" />
<property name="releasenotes" value="" />
<property name="tarfile" value="${phing.project.name}.${buildnumber}.${buildid}.tar.gz" />
<property name="pkgfile" value="${phing.project.name}.${version}.tgz" />
<property name="distfile" value="dist/${tarfile}" />
<property name="tests.dir" value="test" />
<fileset id="api.tar.gz" dir=".">
<include name="test/**"/>
<include name="*.php"/>
<include name="*.xml"/>
</fileset>
<target name="check" description="Check variables" >
<fail unless="version" message="Version not defined!" />
<fail unless="buildnumber" message="buildnumber not defined!" />
<fail unless="buildid" message="buildid not defined!" />
<delete dir="dist" failonerror="false" />
<mkdir dir="dist" />
</target>
<target name="tar" depends="check" description="Create tar file for release">
<echo msg="Creating distribution tar for ${phing.project.name} ${version}"/>
<delete file="${distfile}" failonerror="false"/>
<tar destfile="${distfile}" compression="gzip">
<fileset refid="api.tar.gz"/>
</tar>
</target>
</project>
include表示打包的包含的文件,排除的文件可以用exclude標(biāo)簽。include一定要放在所有的exclude后面。全部文件用“**”表示,文件夾也要表明下面的文件,比如“test/**”。

定義tar動(dòng)作。
2、控制臺(tái)配置。
添加構(gòu)建步驟

配置屬性(這里是配置tar操作的例子)

三、立即構(gòu)建
點(diǎn)擊“立即構(gòu)建”,在工作副本目錄的根目錄就可以生成有build.xml定義的dist目錄,和由build.xml定義名字的打包文件。
以上就是Jenkins初級(jí)應(yīng)用之Invoke Phing targets插件配置的詳細(xì)內(nèi)容,更多關(guān)于Jenkins之Invoke Phing targets配置的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
Java獲取當(dāng)前時(shí)間并轉(zhuǎn)化為yyyy-MM-dd?HH:mm:ss格式的多種方式
這篇文章主要介紹了Java獲取當(dāng)前時(shí)間并轉(zhuǎn)化為yyyy-MM-dd?HH:mm:ss格式的多種方式,每種方式結(jié)合實(shí)例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧2024-03-03
Java用POI解析excel并獲取所有單元格數(shù)據(jù)的實(shí)例
下面小編就為大家?guī)硪黄狫ava用POI解析excel并獲取所有單元格數(shù)據(jù)的實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-10-10
Java While循環(huán) do-while循環(huán)用法
循環(huán)語句就是讓計(jì)算機(jī)根據(jù)條件做循環(huán)計(jì)算,在條件滿足時(shí)繼續(xù)循環(huán),條件不滿足時(shí)退出循環(huán),需要的朋友可以參考下2020-11-11
java結(jié)束當(dāng)前循環(huán)常用代碼
在?Java中,當(dāng)我們要結(jié)束一個(gè)循環(huán)時(shí),通常會(huì)使用循環(huán)變量的實(shí)現(xiàn)類來結(jié)束,但在實(shí)際開發(fā)中,我們經(jīng)常會(huì)遇到某個(gè)循環(huán)結(jié)束后需要進(jìn)行其他的操作的情況,在本文中給大家分享java結(jié)束當(dāng)前循環(huán)常用代碼,感興趣的朋友跟隨小編一起看看吧2023-06-06
MyBatis XML去除多余AND|OR前綴或逗號(hào)等后綴的操作
這篇文章主要介紹了MyBatis XML去除多余AND|OR前綴或逗號(hào)等后綴的操作,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-02-02

