Template Script Methods

Many project configuration options are available to the templates screen. This page seeks to list all of the available methods and enough information to use them in your templates. 

General Project Methods

Project.setProjectPath(String pProjectPath)
Project.setProjectName(String pProjectName)
Project.setDeployPriority(Integer pDeployPriority)
Project.setDeployPriorityScope(String pDeployPriorityScope)
Project.setDescription(String pDescription)
Project.addProperty(String pPropertyName, Object pPropertyValue)
Project.setActive(String pActive)
Project.setActive(boolean pActive)

Workflow Methods

Project.setBuildWorkflowName(String pBuildWorkflowName)
Project.setDeployWorkflowName(String pDeployWorkflowName)

Instance Methods

//All these methods take instance Codes, not Names as the methods suggest.
Project.setBuildInstanceName(String pBuildInstanceName)
Project.addDeployInstances(String... pDeployInstances)
Project.addDeployInstances(String pDeployInstances)
Project.addDeployInstances(String pDeployInstances, String pDelimiter)
Project.addDeployInstanceName(String pDeployInstanceName)

SCM Methods

SCM Type

PERF (Perforce) support was added in 4.0.2, and updated in 4.0.3.

CCUCM (ClearCase) support was added in 4.0.3

Setting the SCM Type for the Projects
Project.setSCMType("SCM Type")
Valid Strings for the "SCM Type" are SVN, GIT, TFS, CVS, PERF, CCUCM


Or, use one of these methods instead:
Project.setSVNForSCM()
Project.setGITForSCM()
Project.setTFVCForSCM()
Project.setCVSForSCM()
Project.setPERFForSCM()
Project.setCCUCMForSCM()

Stream Settings

Add additional project streams if necessary. These streams are what the int pSequenceNumber in the SCM details section below refer to.


Project.createStreamFromMainStream(String pStreamName)

Project.createStream(String pStreamName, String pVersionSyntaxScript)
Project.createStream(String pStreamName, String pVersionSyntaxScript, String pDescription)
Project.createStream(String pStreamName, String pVersionSyntaxScript, String pDescription, String pAttribute1, String pAttribute2, String pAttribute3) 

SCM Details

Next, configure the SCM details for your selected SCM Type. Choose one of the methods that contains the options that you need to configure for your projects from the list.

If SCM Defaults are setup under Administration → Defaults, these may be unnecessary.

SCM TypeSupported Methods
SVN
Project.addSVNConfig(int pSequenceNumber, String pInstanceCode)
Project.addSVNConfig(int pSequenceNumber, String pInstanceCode, String pTrunkPathScript, String pBranchPathScript, String pTagPathScript, String pCheckoutDirectory)
GIT
Project.addGITConfig(int pSequenceNumber, String pInstanceCode)
Project.addGITConfig(int pSequenceNumber, String pInstanceCode, String pBranchPathScript, String pTagPathScript, String pCheckoutDirectory, String pSparseCheckoutFoldersScript)
TFVC
Project.addTFVCConfig(int pSequenceNumber, String pInstanceCode)
Project.addTFVCConfig(int pSequenceNumber, String pInstanceCode, String pMainPathScript, String pBranchPathScript, String pLabelNameScript, String pCheckoutFolderScript)
PERF

Project.addPERFConfig(int pSequenceNumber, String pInstanceCode)
Project.addPERFConfig(int pSequenceNumber, String pInstanceCode, String pMainPathScript, String pBranchPathScript, String pLabelNameScript, String pCheckoutFolderScript)
CVS
Project.addCVSConfig(int pSequenceNumber, String pInstanceCode)
Project.addCVSConfig(int pSequenceNumber, String pInstanceCode, String pModuleNameScript, String pBranchNameScript, String pTagScript, String pCheckoutFolderScript)
CCUCM
Project.addCCUCMConfig(int pSequenceNumber, String pInstanceCode)
Project.addCCUCMConfig(int pSequenceNumber, String pInstanceCode, String pProjectVobScript, String pVobPathsScript, String pStreamScript, String pLabelNameScript, String pCheckoutFolderScript)



Continuous Integration Methods

//These methods add Continuous Integration into your project.
putYourVariableNameHere = Project.addPollSCMTrigger(int pIntervalMinutes, String pStreamName, String pEnvironmentName)
putYourVariableNameHere = Project.addScheduledBuildTrigger(String pCronExpression, String pStreamName, String pEnvironment)
putYourVariableNameHere = Project.addScheduledDeployTrigger(String pCronExpression, String pStreamName, String pEnvironment)
putYourVariableNameHere = Project.addPostBuildTrigger(String pStreamName, String pEnvironment)

// The following methods are available on the object returned from the methods above so inputs and Flexfields can be added to the trigger.
putYourVariableNameHere.addFlexField(String pFlexFieldName, String pValue)
putYourVariableNameHere.addInput(String pInputName, String pValue) 

//For example, to add a Poll SCM trigger with a FlexField and an input, you would write code like this. trigger1 is a variable, its name isn't important, but must match.
trigger1 = Project.addPollSCMTrigger(5, "trunk", "DEV01")
trigger1.addFlexField("Change_Number", "Built by CI Poll SCM")
trigger1.addInput("input", "Built by CI Poll SCM")
The following macros are not currently supported in the footer:
  • style