findAll(connection)
create()
clone()
update()
removeStep(step)
activate()
deactivate()
delete()
clobber()
getProjectId()
getName()
getActive()
getBuildClass()
getEnvironmentId()
getRunLimit()
getLevel()
getMaxThread()
getSelectorId()
getSticky()
getTag()
getTagSync()
getStartNotify()
getPassNotify()
getFailNotify()
getPassChain()
getFailChain()
getGeoId()
getSteps()
getStep(step)
getBuilds()
inUse()
setName(projectName)
setActive(isActive)
setBuildClass(className)
setEnvironmentId(envGroupId)
setRunLimit(runLimit)
setLevel(accessGroupId)
setMaxThread(maxThreads)
setSelectorId(selectorId)
setSticky(isSticky)
setTag(tagFormat)
setTagSync(projectId)
setStartNotify(accessGroupId)
setPassNotify(accessGroupId)
setFailNotify(accessGroupId)
setPassChain(projectId)
setFailChain(projectId)
setGeoId(geoId)
BuildForge::Services::DBO::Project
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing projects $allProjects = BuildForge::Services::DBO::Project->findAll($conn); $oldproject = BuildForge::Services::DBO::Project->findById($conn, $pid); $oldproject2 = BuildForge::Services::DBO::Project->findByName($conn, 'MyProject');
# Getter / setter functions $id = $oldproject->getProjectId(); $name = $oldproject->getName(); $isActive = $oldproject->getActive(); $class = $oldproject->getBuildClass(); $envId = $oldproject->getEnvironmentId(); $maxRuns = $oldproject->getRunLimit(); $accessGroupId = $oldproject->getLevel(); $maxThreads = $oldproject->getMaxThread(); $selectorId = $oldproject->getSelectorId(); $isSticky = $oldproject->getSticky(); $tagFormat = $oldproject->getTag(); $tagSyncProjectId = $oldproject->getTagSync(); $startNotifyAccessGroupId = $oldproject->getStartNotify(); $failNotifyAccessGroupId = $oldproject->getFailNotify(); $passNotifyAccessGroupId = $oldproject->getPassNotify(); $allSteps = $oldproject->getSteps(); $step1 = $oldproject->getStep(2); $step2 = $oldproject->getStep($stepUID); $allProjectBuilds = $oldproject->getBuilds(); $isProjectInUseByOtherObjects = $oldproject->inUse(); $passChainId = $oldproject->getPassChain(); $failChainId = $oldproject->getFailChain(); $geoId = $oldproject->getGeoId(); $oldproject->setName('New Project Name'); $oldproject->setActive(1); $oldproject->setBuildClass('ClassName'); $oldproject->setEnvironmentId($envId); $oldproject->setRunLimit(5); $oldproject->setLevel($accessGroupId); $oldproject->setMaxThread(10); $oldproject->setSelectorId('SelectorName'); $oldproject->setSticky(1); $oldproject->setTag('BF_$B'); $oldproject->setTagSync($pid); $oldproject->setStartNotify($accessGroupId); $oldproject->setFailNotify($accessGroupId); $oldproject->setPassNotify($accessGroupId); $oldproject->setPassChain($projectId); $oldproject->setFailChain($projectId); $oldproject->setGeoId($geoId); $oldproject->update(); # Project creation, updating, deletion $newproject = new BuildForge::Services::DBO::Project($conn); $newproject->setName('New Build Project'); $newproject->setBuildClass('ClassName'); $newproject->setLevel($accessGroupId); $newproject->create(); $newproject2 = $newproject->clone(); $newproject->setName('Duplicate'); $newproject2->create();
$newproject->setName('Different Name'); $newproject->update(); $newproject->deactivate(); $newproject->activate(); $step = new BuildForge::Services::DBO::Step($conn); $step->setDescription('Step Name'); $step->setCommandText('echo hi'); $newproject->addStep($step); $newproject->copyStep(0, 1); $newproject->moveStep(1, 0); $newproject->removeStep(1); $newproject->removeStep($step->getUid()); $newproject->removeStep($step); $oldproject->delete(); $newproject->clobber(); $conn->logout; $conn->close;
Project allows you to create, access, and delete BuildForge Project projects.
Returns a new instance of a Project object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The name of the project.
The access group ID (from $accessGroup->getLevel())
of the access group this
project belongs to. Users not in the class can not view, edit, or use this
project.
The class ID (from $class->getName())
of the class that new builds of the
project belong to by default.
The selector ID (from $selector->getSelectorId())
of the selector that
new builds of the project belong to by default. If this is left blank,
the project is actually a library and will appear in that section of the
GUI.
The tag format for builds of this project. By default, this is set to 'BUILD_$B'.
The environment ID (from $envGroup->getEnvGroupId())
for the environment
group that is applied to builds of this project.
When this evaluates to true, the project is active (the default). When this evaluates to false, the project is inactive and cannot be executed until it is activated.
The access group ID (from $accessGroup->getLevel())
for the access group which
gets notified when a build of the project is kicked off. Set this to 0 (the default) to have
no such notification sent.
The access group ID (from $accessGroup->getLevel())
for the access group which
gets notified when a build of the project completes successfully. Set this to 0 (the default) to have
no such notification sent.
The access group ID (from $accessGroup->getLevel())
for the access group which
gets notified when a build of the project fails. Set this to 0 (the default) to have
no such notification sent.
The maximum number of threaded steps the project is allowed to start simultaneously. The default value of 0 allows unlimited threads to be run.
The maximum number of simultaneous builds of this project allowed to be running. The default value of 0 allows unlimited concurrent builds.
The project ID (from $project->getProjectId())
of the project this project is tag
synced to (or 0, the default, for no tag syncing). Normally, auto-increment tag
variables increase whenever a build of a project starts up. When project A is
tag synced to project B, however, if a build of either project A _or_ project B occurs,
any tag variables that they share that are auto-increment increase.
If this evaluates to true, steps that use the project default selector will all run on the same server. If this evaluates to false (the default), each such step will be chosen from the available servers in the project selector, and so may or may not use the same servers.
The project ID (from $project->getProjectId())
of a project to get kicked off if a
build of this project completes successfully. If this is set to 0 (the default),
no project gets kicked off.
The project ID (from $project->getProjectId())
of a project to get kicked off if a
build of this project fails. If this is set to 0 (the default),
no project gets kicked off.
For GDD-aware projects only, this is the geo ID of the console on which the project runs by default. If this is set to the empty string (the default), it assumes the system is a non-GDD-aware system.
findAll(connection)
Returns a reference to an array of BuildForge::Services::DBO::Project objects
corresponding to all projects in the database that the user has access to.
These objects will not contain their Step subobjects. To get the steps, use
BuildForge::Services::DBO::Project->findById()
or findByName()
with the project's ID/name.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::Project object corresponding to the given projectId, or undef if no such project exists.
A connected BuildForge::Services::Connection object.
The ID of the desired project (from $project->getProjectId()).
Returns the BuildForge::Services::DBO::Project object corresponding to the given project name, or undef if no such project exists.
A connected BuildForge::Services::Connection object.
The name of the desired project (from $project->getName()).
create()
Creates an entry for the project in the database with the current object settings.
clone()
Returns a BuildForge::Services::DBO::Project object that is a copy of the current project. The new project copy will not exist in the database unless created with $copy->create().
update()
Updates the database with the current project settings.
Adds a step to the project in the database.
The BuildForge::Services::DBO::Step object to be added to the project.
The optional location at which to add the new step. 0 makes the step the first step, 1 makes it the second, etc. If left unset, the step is added at the end of the step list.
Moves a step within the step list.
The index of the step to be moved. 0 moves the first step, 1 the second step, etc.
The index of the location to move the step to. 0 makes it the first step, 1 the second step, etc.
Copies a step within the step list.
The index of the step to be copied. 0 copies the first step, 1 the second step, etc.
The index of the location to copy the step to. 0 makes the copy the first step, 1 the second step, etc.
removeStep(step)
Removes a step from the step list.
This may either be the index of the step to be deleted (0 to delete the first step, 1 the second, etc.), the step ID of the step to be deleted (from $step->getUid()), or the BuildForge::Services::DBO::Step to be removed.
activate()
Activates the project within the database.
deactivate()
Deactivates the project within the database. Deactivated projects cannot be run until they are activated.
delete()
Deletes the project from the database. This will only work if there are no current builds of the project existing in the database.
clobber()
Starts a clobber project action. After it is called, the engine will clobber the project by deleting it and all its project from the database when all builds of the project are complete and when the engine has resources available to do so. The function will return when the clobbering has been readied to occur - it may be some time after that before the project is actually clobbered.
getProjectId()
Returns the ID of the project.
getName()
Returns the name of the project.
getActive()
Returns 1 if the project is active or 0 if it is inactive.
getBuildClass()
Returns the class ID (from $class->getName())
of the class that new builds of the
project belong to by default.
getEnvironmentId()
Returns the environment ID (from $envGroup->getEnvGroupId())
for the environment
group that is applied to builds of this project, or 0 if no environment is
assigned.
getRunLimit()
Returns the maximum number of simultaneous builds of this project allowed to be running. The default value of 0 allows unlimited concurrent builds.
getLevel()
Returns the access group ID (from $accessGroup->getLevel())
of the access group this
project belongs to. Users not in the class can not view, edit, or use this
project.
getMaxThread()
Returns the maximum number of threaded steps the project is allowed to start simultaneously. The default value of 0 allows unlimited threads to be run.
getSelectorId()
Returns the selector ID (from $selector->getSelectorId())
of the selector that
new builds of the project belong to by default. If this is an empty string,
the project is actually a library and will appear in that section of the
GUI.
getSticky()
If this returns 1, steps that use the project default selector will all run on the same server. If this returns 0, each such step will be chosen from the available servers in the project selector, and so may or may not use the same servers.
getTag()
Returns the tag format for builds of this project.
getTagSync()
Returns the project ID (from $project->getProjectId())
of the project this project is tag
synced to (or 0 for no tag syncing). Normally, auto-increment tag
variables increase whenever a build of a project starts up. When project A is
tag synced to project B, however, if a build of either project A _or_ project B occurs,
any tag variables that they share that are auto-increment increase.
getStartNotify()
Returns the access group ID (from $accessGroup->getLevel())
for the access group which
gets notified when a build of the project is kicked off or 0 if
no such notification is sent.
getPassNotify()
Returns the access group ID (from $accessGroup->getLevel())
for the access group which
gets notified when a build of the project completes successfully or 0 if
no such notification is sent.
getFailNotify()
Returns the access group ID (from $accessGroup->getLevel())
for the access group which
gets notified when a build of the project fails or 0 if
no such notification is sent.
getPassChain()
Returns the project ID (from $project->getProjectId())
of a project to get kicked off if a
build of this project completes successfully or 0 if no such project is kicked off.
getFailChain()
Returns the project ID (from $project->getProjectId())
of a project to get kicked off if a
build of this project fails or 0 if no such project is kicked off.
getGeoId()
This returns the geo ID of the console on which the project runs by default. It returns the empty string for non-GDD-aware projects.
getSteps()
Returns a reference to an array of BuildForge::Services::DBO::Step objects for all the steps in the project.
getStep(step)
Returns the BuildForge::Services::DBO::Step object for the requested step.
This may either be the index of the step to be returned (0 for the first step, 1 the second, etc.), or the step's step ID (from $step->getUid()).
getBuilds()
Returns a reference to an array of BuildForge::Services::DBO::Build objects for all builds of the project.
inUse()
If the project is linked to by other objects (for example, if a class is set to kick off this project when builds of the class are purged), returns 'YES', indicating that it cannot be deleted. If the project is not being linked by other objects, but another project or step does chain the project, returns 'CHAIN'. Otherwise, returns 'NO'.
setName(projectName)
Sets the name of the project. $project->update()
must be run
before changes are replicated in the database.
The new project name.
setActive(isActive)
Sets whether or not the project is active. If it is inactive, it cannot be
executed until it is activated. $project->update()
must be run
before changes are replicated in the database.
The project becomes active if this evaluates to true or inactive if this evaluates to false.
setBuildClass(className)
Sets the class that new builds of the project belong to by default. $project->update()
must be run
before changes are replicated in the database.
The class ID (from $class->getName()).
setEnvironmentId(envGroupId)
Sets the environment group that is applied to builds of this project. $project->update()
must be run
before changes are replicated in the database.
The environment group ID (from $envGroup->getEnvGroupId()).
setRunLimit(runLimit)
Sets the maximum number of simultaneous builds of this project allowed to be running.
$project->update()
must be run before changes are replicated in the database.
The number of allowed builds. Setting it to 0 allows unlimited concurrent builds.
setLevel(accessGroupId)
Sets the access group this project belongs to. Users not in the class can not view,
edit, or use this project. $project->update()
must be run
before changes are replicated in the database.
The access group ID (from $accessGroup->getLevel()).
setMaxThread(maxThreads)
Sets the maximum number of threaded steps the project is allowed to start simultaneously.
$project->update()
must be run before changes are replicated in the database.
The maximum number of threads. Setting it to 0 allows unlimited threads to be run.
setSelectorId(selectorId)
Sets the selector that new builds of the project belong to by default. $project->update()
must be run
before changes are replicated in the database.
The selector ID (from $selector->getSelectorId()). If this is set to 0, the project is actually a library and will appear in that section of the GUI.
setSticky(isSticky)
Sets whether or not the project is sticky. If it is sticky, steps that use the
project default selector will all run on the same server. If not, each such step
will be chosen from the available servers in the project selector, and so may or may
not use the same servers. $project->update()
must be run before changes are
replicated in the database.
The project becomes sticky if this evaluates to true and unsticky if this evaluates to false.
setTag(tagFormat)
Sets the tag format for builds of this project. $project->update()
must be run
before changes are replicated in the database.
The new tag format.
setTagSync(projectId)
Sets the project this project is tag
synced to (or 0, the default, for no tag syncing). Normally, auto-increment tag
variables increase whenever a build of a project starts up. When project A is
tag synced to project B, however, if a build of either project A _or_ project B occurs,
any tag variables that they share that are auto-increment increase. $project->update()
must be run before changes are replicated in the database.
The project ID (from $project->getProjectId())
of the synced project.
setStartNotify(accessGroupId)
Sets the access group which gets notified when a build of the project is
kicked off. $project->update()
must be run before changes are replicated
in the database.
The access group ID (from $accessGroup->getLevel()), or 0 to have no such notification sent.
setPassNotify(accessGroupId)
Sets the access group which gets notified when a build of the project
completes successfully. $project->update()
must be run
before changes are replicated in the database.
The access group ID (from $accessGroup->getLevel()), or 0 to have no such notification sent.
setFailNotify(accessGroupId)
Sets the access group which gets notified when a build of the project fails.
$project->update()
must be run before changes are replicated in the database.
The access group ID (from $accessGroup->getLevel()), or 0 to have no such notification sent.
setPassChain(projectId)
Sets the project to get kicked off if a build of this project completes successfully.
$project->update()
must be run before changes are replicated in the database.
The project ID (from $project->getProjectId())
to be started, or 0 for no project
to get started.
setFailChain(projectId)
Sets the project to get kicked off if a build of this project fails.
$project->update()
must be run before changes are replicated in the database.
The project ID (from $project->getProjectId())
to be started, or 0 for no project
to get started.
setGeoId(geoId)
For GDD-aware projects only, this sets the geo ID of the console on which the project
runs by default. $project->update()
must be run before changes are replicated in the database.
The ID of the console to use. If this is set to the empty string, it assumes the system is a non-GDD-aware system.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.