Tải bản đầy đủ - 0 (trang)
Chapter 7. LuntBuild-A Web-Based Continuous Integration Server

Chapter 7. LuntBuild-A Web-Based Continuous Integration Server

Tải bản đầy đủ - 0trang

PMEase.[42]ThesourcecodeishostedonJavaForge.LuntBuild

alsohasacommercialcousin,calledQuickBuild,whichis

marketedbythesamecompany.Quickbuildisacommercial

opensourceproduct(thesourcecodeisprovidedatacost),

withsomeextrafeaturessuchasenhanceduserandgroup

management,andfunctionalityaimedatlargerorganizations

managingalargenumberofprojects.

[42]http://www.pmease.com/Home.page



Chapter7.LuntBuild—AWeb-Based

ContinuousIntegrationServer

AnIntroductiontoLuntBuild

InstallingLuntBuild

ConfiguringtheLuntBuildServer

AddingaProject

UsingProjectVariablesforVersionNumbering

BuildResultsDiagnostics

UsingLuntBuildwithEclipse

ReportingonTestCoverageinLuntbuildUsingCobertura

IntegratingLuntbuildwithMaven

Conclusion



7.1.AnIntroductiontoLuntBuild

LuntBuild[41]isanotheropensourceContinuousIntegrationtool

writteninJava.Itisquiteeasytoinstallandconfigure,andall

serveradministrationtasksaredoneviaasimplebut

convenientweb-basedadministrationconsole.Infact,LuntBuild

isdesignedtodomorethanjustmanagingthecontinuous

integrationprocess:italsoletsyoustoreandmanage

generatedartifacts,labelandpromoteversions,andmanage

dependenciesbetweenbuilds.Itsupportsawiderangeof

versioncontroltools,andnotificationscanbediffusedviaemail,

instantmessage(IM),andevenonablogsite.Indeed,itisone

ofthemostfeature-richoftheopensourceContinuous

Integrationtools.

[41]http://luntbuild.javaforge.com/



LuntBuildisproducedandmaintainedbyacompanycalled



PMEase.[42]ThesourcecodeishostedonJavaForge.LuntBuild

alsohasacommercialcousin,calledQuickBuild,whichis

marketedbythesamecompany.Quickbuildisacommercial

opensourceproduct(thesourcecodeisprovidedatacost),

withsomeextrafeaturessuchasenhanceduserandgroup

management,andfunctionalityaimedatlargerorganizations

managingalargenumberofprojects.

[42]http://www.pmease.com/Home.page



7.2.InstallingLuntBuild

InstallingandconfiguringLuntBuildisrelativelysimple,andyou

canhaveaserverupandrunninginlessthananhour.The

installationpackagecomesintheformofaself-installingjar

file.DownloaditfromtheLuntBuildwebsiteandrunthe

graphicalinstallationprogramasfollows:

$java-jarLuntBuild-1.5.2-installer.jar

Theinstallertakesyoustep-by-stepthroughtheinstallation

process.LuntBuildisaveryflexibletool,andcanbeconfigured

toworkwithmanyexternalwebserversanddatabases.Italso

worksjustfineallbyitselfasastandaloneapplication.During

theinstallationprocess,youcanchooseamongvarious

configurationoptions.Ifyouleavethefieldswiththeirdefault

values,LuntBuildwillinstallandconfigureafullyfunctional

standaloneinstallation.Foraproductionenvironment,youmay

wanttomodifysomeoftheoptions,suchasinstallingitonyour

ownwebapplicationserverorusingyourenterprisedatabase.

Someofthechoicesaredescribedbrieflyhere:

Customizingthewebserver



LuntBuildisaweb-basedapplication.Assuch,you

caneitherdeployitonyourfavoriteJavawebserver

(suchasApacheTomcat),orletLuntBuildrunits

ownstandalonewebJetty-basedwebserver.Ifyou

wanttodeployitontoyourownJ2EE-compliant

applicationserver,justspecifythewardeployment

directory,andLuntBuildwilldotherest.



Configuringthedatabase



LuntBuildusesarelationaldatabasetokeeptrackof

generatedartifacts,buildhistory,andsoon.By



default,LuntBuildusesanembeddedHSQLDB

database,butyoucanalsoconfigureittousean

externaldatabasesuchasMySQL,PostgreSQL,

Oracle,orMicrosoftSQLServer.



Configuringauthentication



IfyourcompanyhasanLDAP-baseduserdirectory,

youcanconfigureLuntBuildtouseitforloginsand

passwords.LuntBuildsupportssomequite

sophisticatedoptionsforLDAPintegration:

LuntBuildcanimportyourLDAPusersintothe

LuntBuilduserdirectorywhereyoucangivethem

LuntBuild-specificaccessrights,youcangiveallthe

LDAPusersread-onlyaccesstothesite,youcan

reserveprojectadministrationrightstoaselected

few,youcanmapLuntBuilduserIDsandemail

addressestoLDAPfields,andsoon.

Onceyou'vefinishedtheinstallation,youcanstarttheserver.

Gototheinstallationdirectory(herewehaveinstalleditina

directorycalledLuntBuildinourhomedirectory)andrunthe

LuntBuild.shscript:



$cd/usr/local/luntbuild-1.5.2

$bin/luntbuild.shlocalhost8080

bin/LuntBuild.shlocalhost8080

22:23:50.218EVENTStartingJetty/4.2.23

22:23:50.726EVENTStartedWebApplicationContext[/LuntBuild,Lu

LuntBuild:-->contextinitializationstarted

LuntBuild:-->contextinitializationfinished

22:23:57.583EVENTStartedSocketListeneron127.0.0.1:8080

22:23:57.583EVENTStartedorg.mortbay.jetty.Server@5ffb18

Andtostoptheserver,justrunthestop-LuntBuild.shscript,as



shownhere:

$cd/usr/local/luntbuild-1.5.2

$bin/stop-luntbuild.shlocalhost8889



7.3.ConfiguringtheLuntBuildServer

Onceyouhavestartedtheserver,youmanageeverythingvia

thewebadministrationconsole(theURLwillbesomethinglike

http://localhost:8080/LuntBuild).Logicallyenough,LuntBuild

requiresyoutoidentifyyourselfbeforeyoucandoanything

interesting(seeFigure7-1).WhenyoufirstinstallLuntBuild,

youcanuse"LuntBuild/LuntBuild"toconnectasan

administrator.Anonymoususersarealsoallowedtoviewcertain

partsofthesite,butcannotmodifyanything.

Figure7-1.ConnectingtotheLuntBuildadministration

console



TheLuntBuildadministrationwebsiteletsyouviewand

managedifferentaspectsofyourserverandoftheprojectsyou

manage(seeFigure7-2).Here,youcanmanagebuildprojects

andbuildhistory,useraccounts,serverconfiguration

properties,andperformotheradministrativetaskssuchas

backingupandrestoringbuildandartifacthistory.

Figure7-2.TheLuntBuildhomepage



Thefirstthingyouneedtodowhenyousetupyourserveristo

verifytheserverconfigurationproperties.Youdothisinthe

"Properties"tab(seeFigure7-3).Manyserverconfiguration

properties,suchastheserverURLandworkdirectories,use

sensibledefaultvalues,whicharewelldocumentedonthe

Propertiespage.Others,suchastheSMTPserverformail

notification,willneedtobeconfiguredifyouwanttousethese

notificationmethods.LuntBuildsupportsafairlylimitedrangeof

notificationmethods,includingSMTPemail,MSN,Jabber,

SameTime,andsomeblogsites.Touseanyoneofthese

methods,youwillneedtoprovideinformationonthehost

server,aswellasuseraccountandpassworddetails.

IfconfiguringoneoftheIMnotificationtypes(MSNorJabber),

youwillneedtocreateaspecialaccountfortheLuntBuild

server(e.g.,LuntBuild.mycompany@hotmail.com).Userswill

needtoaddthisaccounttotheirlistofcontactsintheirIM

clients.ThenuserssimplylogontotheirIMclientsasusual.

Touseblognotification,youwillneedtoprovideuseraccount

information,theURLoftheblogwebservice,andalsothetype

ofblog.Severalblogsitestodayletyousubmitpostsviaaweb

serviceinterface.Unfortunately,thereisnostandardinterface.

Atthetimeofthiswriting,LuntBuildsupportsthethreemain

bloggingapplicationprogramminginterfaces(API's):the

BloggerAPI(theoldeststandard,usedforsiteslike

http://www.blogger.com),theMetaweblogAPI(anextensionof

theBloggerAPI,usedforsiteslikehttp://www.jroller.comand



http://wordpress.com),andtheLiveJournalAPI(usedbythe

http://www.livejournal.comblogsite).

Figure7-3.Serverconfigurationproperties



Whenyouarehappywithyourserverconfiguration,youcanset

upsomeuseraccountsforyourteammembers.Youdothisin

the"Users"tab(seeFigure7-4).Useraccountmanagementat

thislevelisnotparticularlysophisticated,andusersare

basicallyseparatedintotwocategories:thosewhocancreate

projects,andthosewhocan't.Moredetaileduser-accessrules

aredefinedattheprojectlevel(see[clickhere]).

Figure7-4.Settingupuseraccounts



ConfiguringaLuntBuildserverusingthewebadministrationsite

issimpleandintuitive.Eveniftheywouldn'twinanyprizesfor

graphicaldesign,thescreensarefunctionalandwell

documented.Thenextstepistoaddsomeprojects.Andthe

judicioususeofdefaultvaluesandoptionalfieldsmeansthat

youcanbeoperationalinverylittletimeindeed!



7.4.AddingaProject

InLuntBuild,buildschedulesareorganizedaroundprojects.

LuntBuildprovidesarichsetoffunctionsformanagingproject

builds.

Youaddanewprojectinthe"Project"tab(seeFigure7-5)by

clickingonthe"NewProject"icon.LuntBuildletsyouconfigure

anumberofdifferentaspectsofyourproject(seeFigure7-6).

Don'tletthenumberofscreensputyouoff,though;the

screensareintuitiveandwelldocumented,andyoucangeta

simpleprojectupandrunninginverylittletime.

InLuntBuild,projectinformationandmanagementactivitiesare

organizedintofiveareas,eachrepresentedbyatab:

Basic



Thisiswhereyoudefinegeneralprojectdetails,

useraccessrights,andnotificationmethods.



VCSAdaptors



Versioncontrolsystems(alsoknownasSCM,or

SoftwareConfigurationManagement,systems).



Builders



TheBuilderspageletsyouconfigureoneormore

buildscriptsforthisproject.



Schedulers



Schedulersletyouspecifywhenthebuildscriptswill



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 7. LuntBuild-A Web-Based Continuous Integration Server

Tải bản đầy đủ ngay(0 tr)

×