Summary
Creates a new trigger.Requirements and validations:
-
One of following combinations must be specified: [
pipelineName
], [releaseName
], [catalogName
,catalogItemName
], [applicationName
,processName
,environmentName
], [applicationName
,processName
,environmentName
,environmentTemplateName
], [procedureName
]. -
The
triggerType
,pluginKey
andpluginParameters
arguments must be provided. The plugin must exist and must be promoted. Webhook metadata properties must be present. Plugin parameters must match the associated plugin procedure. -
If triggersType =
webhook
then theserviceAccountName
argument must be provided. -
Application triggers:
-
processName
must be provided and must exist. -
snapshot
,environmentProjectName
,environmentTemplateName
,environmentTemplateProjectName
, and all rolling deploy arguments must be provided. -
environmentName
must be provided.
-
-
Provide
environmentTemplateProjectName
only ifenvironmentTemplateName
is provided. -
Provide only one of [
environmentName
,environmentProjectName
] and [environmentTemplateName
,environmentTemplateProjectName
] application triggers. -
Provide
tierResourceCount
forenvironmentTemplateName
only. -
Provide
stageToRun
for pipeline and release triggers only. -
Provide
pipelineParameter
for release triggers only. -
The
actualParameters
argument must match the formal parameters of the triggered object. -
Provide
serviceAccountName
,webhookName
, andwebhookSecret
for webhook triggers only.
projectNameStringrequiredThe name for the project that must be unique among all projects. triggerNameStringrequiredThe name of the trigger. accessTokenPublicIdStringoptionalPublic identifier of the access token. actualParameterArrayoptionalActual parameters passed to the invoked object. applicationNameStringoptionalThe name of the application that owns the trigger and the process that should be run. credentialNameStringoptionalThe name of the credential to use for impersonation. descriptionStringoptionalComment text describing this object that is not interpreted at all by CloudBees CD/RO. enabledBooleanoptionalTrue to enable the task. environmentNameStringoptionalThe name of the environment used to determine where to run the process. environmentProjectNameStringoptionalName for the project to which the environment or environment template belongs to. environmentTemplateNameStringoptionalThe name of the environment template used to determine the environment where to run the process. environmentTemplateProjectNameStringoptionalName for the project to which the environment template belongs to. insertRollingDeployManualStepBooleanoptionalTrue to indicate a manual step to inject after each phase or batch. pipelineNameStringoptionalThe name of the pipeline to run. pipelineParameterArrayoptionalPipeline parameters used by a release schedule to override the default parameters configured in the release. pluginKeyStringoptionalThe key of the plugin to be used for trigger integration with 3rd-party system. pluginParameterArrayoptionalList of plugin parameters. procedureNameStringoptionalThe name of the procedure that owns the process to run. processNameStringoptionalThe name of the application process to invoke. quietTimeMinutesStringoptionalSpecify how long in minutes should pass since last trigger event before the trigger will run. releaseNameStringoptionalThe name of the release to run. rollingDeployEnabledBooleanoptionalPerform rolling deployment. rollingDeployManualStepAssigneeArrayoptionalA list of assignees who receive the notification when rolling deploy iteration completes. rollingDeployManualStepConditionStringoptionalDefines run condition on manual step created during rolling deployment. Possible values: "always" , "failure" , "success" rollingDeployPhaseArrayoptionalOne or more rolling deploy phases to be used for deployment. runDuplicatesBooleanoptionalSpecify whether a trigger should be run if the previously triggered process is still running. scmSyncNameStringoptionalThe name of the scmSync trigger belong to. serviceAccountNameStringoptionalThe name of the service account associated with a webhook trigger. snapshotNameStringoptionalThe name of the snapshot to be used to invoke the application process. stagesToRunArrayoptionalOne or more stages to run in a pipeline. tierResourceCountArrayoptionalResource count per resource template tier. triggerTypeStringoptionalA type of trigger. Possible values: "polling" , "webhook" webhookNameStringoptionalWebhook name. webhookSecretStringoptionalWebhook secret. webhookSecretCredentialNameStringoptionalWebhook secret credential name. webhookSecretCredentialProjectNameStringoptionalWebhook secret credential project name. |
Usage
Perl
$cmdr->createTrigger( "test-projectName", # projectName "test-triggerName" # triggerName # optionals );
ectool
ectool createTrigger \ "test-projectName" `# projectName` \ "test-triggerName" `# triggerName` \ # optionals
Examples
Perl
Pipeline example
$cmdr->createTrigger("qe proj", "qe trigger 1", {pipelineName =>"qe pipeline name", triggerType =>"webhook", pluginKey=>"EC-Github", pluginParameter =>[ {pluginParameterName =>"repositories", value =>"test/testrepo"}], serviceAccountName =>"qe service name", webhookSecret =>"push"});