Hudson配置说明.docx

上传人:b****6 文档编号:3868210 上传时间:2022-11-26 格式:DOCX 页数:14 大小:25.31KB
下载 相关 举报
Hudson配置说明.docx_第1页
第1页 / 共14页
Hudson配置说明.docx_第2页
第2页 / 共14页
Hudson配置说明.docx_第3页
第3页 / 共14页
Hudson配置说明.docx_第4页
第4页 / 共14页
Hudson配置说明.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

Hudson配置说明.docx

《Hudson配置说明.docx》由会员分享,可在线阅读,更多相关《Hudson配置说明.docx(14页珍藏版)》请在冰豆网上搜索。

Hudson配置说明.docx

Hudson配置说明

Hudson配置项说明

Description

Thisdescriptionisplacedontheprojecttoppagesothatvisitorscanknowwhatthisjobisabout.YoucanuseanyHTMLtagshere.

DiscardOldBuilds

ThiscontrolsthediskconsumptionofHudsonbymanaginghowlongyou'dliketokeeprecordsofthebuilds(suchasconsoleoutput,buildartifacts,andsoon.)Hudsonofferstwocriteria:

Drivenbyage.YoucanhaveHudsondeletearecordifitreachesacertainage(forexample,7daysold.)

Drivenbynumber.YoucanhaveHudsonmakesurethatitonlymaintainsuptoNbuildrecords.Ifanewbuildisstarted,theoldestrecordwillbesimplyremoved.

Hudsonalsoallowsyoutomarkanindividualbuildas'Keepthislogforever',toexcludecertainimportantbuildsfrombeingdiscardedautomatically.

Thisbuildisparameterized

WhenyouareusingHudsonforvariousautomations,it'ssometimesconvenienttobeableto"parameterize"abuild,byrequiringasetofuserinputstobemadeavailabletothebuildprocess.Forexample,youmightbesettingupanon-demandtestjob,wheretheusercansubmitazipfileofthebinariestobetested.

Thissectionconfigureswhatparametersyourbuildtakes.Parametersaredistinguishedbytheirnames,andsoyoucanhavemultipleparametersprovidedthattheyhavedifferentnames.

SeetheWikitopicformorediscussionsaboutthisfeature.

StringParameter

Definesasimpletextparameter,whereuserscanenterastringvalue,whichyoucanuseduringabuild,eitherasanenvironmentvariable,orthroughvariablesubstitutioninsomeotherpartsoftheconfiguration.

Notethatwhenthisfieldisexposedasanenvironmentvariable,itwillbealwaysintheuppercase(e.g.,theparameter"foo"wouldbeexposedas"FOO").InAntforexampleyouaccessitbytypingin${env.FOO}

DefaultValue

Specifiesthedefaultvalueofthefield,whichallowstheusertosavetypingtheactualvalue.

FileParameter

Acceptsafilesubmissionfromabrowserasabuildparameter.Theuploadedfilewillbeplacedatthespecifiedlocationintheworkspace,whichyourbuildcanthenaccessanduse.

Thisisusefulformanysituations,suchas:

1.Lettingpeopleruntestsontheartifactstheybuilt.

2.Automatingtheupload/release/deploymentprocessbyallowingtheusertoplacethefile.

3.Performdataprocessingbyuploadingadataset.

Filelocation

Specifiesthelocation,relativeintheworkspace,wheretheuploadedfilewillbeplaced(forexample,like"jaxb-ri/data.zip")

DisableBuild(Nonewbuildswillbeexecuteduntiltheprojectisre-enabled.)

Sometimes,you'dwanttotemporarilystopbuildingaproject.Forexample,maybeyouareinthemiddleofalargemigrationandyouknownewbuildsaregoingtofail.OrmaybeaprojectisbuilteveryhourbutyouknowthattheCVSserverwillbedownforthenext24hours.

Whenthisoptionisset,nonewbuildisperformedonthisproject.Thisallowsyoutodisablenewbuildswithoutchanginganyofthebuilddependencychainorchangingthenotificationsetup.

Tiethisprojecttoanode

Sometimesaprojectcanonlybesuccessfullybuiltonaparticularslave(ormaster).Ifso,thisoptionforcesHudsontoalwaysbuildthisprojectonaspecificcomputer.Otherwise,unchecktheboxsothatHudsoncanschedulebuildsonavailablenodes,whichresultsinfasterturn-aroundtime.

Thisoptionisalsousefulwhenyou'dliketomakesurethataprojectcanbebuiltonaparticularnode

AdvancedProjectOptions

Quietperiod

Ifset,anewlyscheduledbuildwaitsforthismanysecondsbeforeactuallybeingbuilt.Thisisusefulfor:

●CollapsingmultipleCVSchangenotificatione-mailsintoone(someCVSchangeloge-mailgenerationscriptsgeneratemultiplee-mailsinquicksuccessionwhenacommitspansacrossdirectories).

●Ifyourcodingstyleissuchthatyoucommitonelogicalchangeinafewcvs/svnoperations,thensettingalongerquietperiodwouldpreventHudsonfrombuildingitprematurely过早地andreportingafailure.

●Throttling分流builds.IfyourHudsoninstallationistoobusywithtoomanybuilds,settingalongerquietperiodcanreducethenumberofbuilds.

Ifnotexplicitlysetatproject-level,thesystem-widedefaultvalueisused.

Usecustomworkspace

ForeachjobonHudson,Hudsonallocatesaunique"workspacedirectory."Thisisthedirectorywherethecodeischeckedoutandbuildshappen.NormallyyoushouldletHudsonallocateandcleanupworkspacedirectories,butinseveralsituationsthisisproblematic,andinsuchcase,thisoptionletsyouspecifytheworkspacelocationmanually.

Oncesuchsituationiswherepathsarehard-codedandthecodeneedstobebuiltonaspecificlocation.(andyoucanfindonesuchdiscussionhere.)Whilethere'snodoubtthatsuchabuildisnotideal,thisoptionallowsyoutogetgoinginsuchasituation.

Anothersituationwherethisisusefuliswhenyouareusingthefree-styleprojecttypenottoperformasoftwarebuild,butexecutionofacertainbatchtask,perhapsasacron克隆replacement.Insuchcase,youcanusethisoptiontomaptherelevantdirectoryastheworkspace,sothatpeoplecanlookatfilesthroughtheHudsonwebUI,andyoucankickrelevantcommandsmoreeasily.

Ifyouareinadistributedbuildenvironment,unlessyoutieajobtoaspecificnode,Hudsonmaystillmovearound走来走去jobstodifferentslaves.Sometimesthisisdesirable,sometimesthisisnot.Also,youcanmapmultipleprojectstohavethesameworkspace,butifyoudoso,makesureconcurrentexecutionsofthosejobswon'thavenasty令人讨厌的interferancewitheachother.

SourceCodeManagement

CVSROOT

TheCVSconnectionstringHudsonusestoconnecttotheserver.Theformatisthesameas$CVSROOTenvironmentvariable(:

protocol:

user@host:

path)

Module(s)

TheCVSmodulename(s)inthegivenCVSROOTtocheckout.Multiplemodulescanbespecifiedbyseparatingthembyawhitespace.Ifyourmodulenamecontainswhitespace,youcanescapebywritingitas'\'.Forexample"foo\barzot"willspecifytwomodules"foobar"and"zot".

Branch

Thisisatag,notabranch

Ifset,HudsonwillrunCVSwith-rtobuildaparticularbranch.Ifleftempty,Hudsonwillbuildthetrunk.

Normally,Hudsonrunscvscheck-outandupdatewiththe-Ddateoptiontomakesureitgetsacoherentsnapshotoftherepositoryandbetterbuildreproducibility重复能力,butthisinterferes妨碍ifthebranchnamespecifiedhereisactuallyatagname.TellingHudsonthatthenameisatagwouldfixthisproblem.

高级选项

CVS_RSH

Ifset,HudsonwillrunCVSwiththeCVS_RSHenvironmentvariablesettothisvalue.Ifthisvalueisnotset,andthewebcontainerthatHudsonrunsinhasCVS_RSHsetinitsenvironmentvariable,thenCVSwillinherit继承it.

Legacy遗留问题mode(runCVSinawaycompatiblewitholderversionsofHudson<1.21)

Hudson1.20andearlierusedtocreateredundant多余的directoriesinsidetheworkspace.Forexample,iftheCVSmodulenameis"foo/bar",itfirstcreated"foo/bar"andthenputeverythingbelow.Withthisoptioncheckedoff,therewillbenomoresuchunnecessaryintermediatedirectories.

Thisaffectsotherpathspecifiers,suchasartifactarchivers---younowspecify"build/foo.jar"insteadof"foo/build/foo.jar".

Useupdate

Ifchecked,Hudsonwilluse'cvsupdate'wheneverpossibleforbuilds.Thismakesabuildfaster.Butthisalsocausestheartifactsfromthepreviousbuildtoremaininthefilesystemwhenanewbuildstarts,makingitnotatruecleanbuild.

BuildTriggers

Buildafterotherprojectsarebuilt

Setupatriggersothatwhensomeotherprojectsfinishbuilding,anewbuildisscheduledforthisproject.Thisisconvenientforrunninganextensivetestafterabuildiscomplete,forexample.

Thisconfigurationistheoppositeviewofthe"Buildotherprojects"sectioninthe"Post-buildActions".Updatingonewillchangetheotherautomatically.

PollSCM

ConfigureHudsontopollchangesinSCM.

NotethatthisisgoingtobeanexpensiveoperationforCVS,aseverypollingrequiresHudsontoscantheentireworkspaceandverifyitwiththeserver.Considersettingupa"push"triggertoavoidthisoverhead,asdescribedinthisdocument

Buildperiodically

Providesacron-likefeaturetoperiodicallyexecutethisproject.

ThisfeatureisprimarilyforusingHudsonasacronreplacement,anditisnotidealforcontinuouslybuildingsoftwareprojects.Whenpeoplefirststartcontinuousintegration,theyareoftensousedtotheideaofregularlyscheduledbuildslikenightly/weeklythattheyusethisfeature.However,thepointofcontinuousintegrationistostartabuildassoonasachangeismade,toprovideaquickfeedbacktothechange.TodothatyouneedtohookupSCMchangenotificationtoHudson..

So,beforeusingthisfeature,stopandaskyourselfifthisisreallywhatyouwant.

Build

Executeshell

Runsashellscript(defaultstosh,butthisisconfigurable)forbuildingtheproject.Thescriptwillberunwiththeworkspaceasthecurrentdirectory.Typeinthecontentsofyourshellscript.Ifyourshellscripthasnoheaderlinelike#!

/bin/sh—,thentheshellconfiguredsystem-widewillbeused,butyoucanalsousetheheaderlinetowritescriptinanotherlanguage(like#!

/bin/perl)orcontroltheoptionsthatshelluses.

Bydefault,theshellwillbeinvokedwiththe"-ex"option.Soallofthecommandsareprintedbeforebeingexecuted,andthebuildisconsideredafailureifanyofthecommandsexitswithanon-zeroexitcode.Again,addthe#!

/bin/...linetochangethisbehavior.

Asabestpractice,trynottoputalongshellscriptinhere.Instead,considerad

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高中教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1