createTrigger

Back to index

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 and pluginParameters 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 the serviceAccountName 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 if environmentTemplateName is provided.

  • Provide only one of [environmentName, environmentProjectName] and [environmentTemplateName, environmentTemplateProjectName] application triggers.

  • Provide tierResourceCount for environmentTemplateName 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, and webhookSecret for webhook triggers only.

projectName
Stringrequired
The name for the project that must be unique among all projects.
triggerName
Stringrequired
The name of the trigger.
accessTokenPublicId
Stringoptional
Public identifier of the access token.
actualParameter
Arrayoptional
Actual parameters passed to the invoked object.
applicationName
Stringoptional
The name of the application that owns the trigger and the process that should be run.
credentialName
Stringoptional
The name of the credential to use for impersonation.
description
Stringoptional
Comment text describing this object that is not interpreted at all by CloudBees CD/RO.
enabled
Booleanoptional
True to enable the task.
environmentName
Stringoptional
The name of the environment used to determine where to run the process.
environmentProjectName
Stringoptional
Name for the project to which the environment or environment template belongs to.
environmentTemplateName
Stringoptional
The name of the environment template used to determine the environment where to run the process.
environmentTemplateProjectName
Stringoptional
Name for the project to which the environment template belongs to.
insertRollingDeployManualStep
Booleanoptional
True to indicate a manual step to inject after each phase or batch.
pipelineName
Stringoptional
The name of the pipeline to run.
pipelineParameter
Arrayoptional
Pipeline parameters used by a release schedule to override the default parameters configured in the release.
pluginKey
Stringoptional
The key of the plugin to be used for trigger integration with 3rd-party system.
pluginParameter
Arrayoptional
List of plugin parameters.
procedureName
Stringoptional
The name of the procedure that owns the process to run.
processName
Stringoptional
The name of the application process to invoke.
quietTimeMinutes
Stringoptional
Specify how long in minutes should pass since last trigger event before the trigger will run.
releaseName
Stringoptional
The name of the release to run.
rollingDeployEnabled
Booleanoptional
Perform rolling deployment.
rollingDeployManualStepAssignee
Arrayoptional
A list of assignees who receive the notification when rolling deploy iteration completes.
rollingDeployManualStepCondition
Stringoptional
Defines run condition on manual step created during rolling deployment.
Possible values: "always", "failure", "success"
rollingDeployPhase
Arrayoptional
One or more rolling deploy phases to be used for deployment.
runDuplicates
Booleanoptional
Specify whether a trigger should be run if the previously triggered process is still running.
scmSyncName
Stringoptional
The name of the scmSync trigger belong to.
serviceAccountName
Stringoptional
The name of the service account associated with a webhook trigger.
snapshotName
Stringoptional
The name of the snapshot to be used to invoke the application process.
stagesToRun
Arrayoptional
One or more stages to run in a pipeline.
tierResourceCount
Arrayoptional
Resource count per resource template tier.
triggerType
Stringoptional
A type of trigger.
Possible values: "polling", "webhook"
webhookName
Stringoptional
Webhook name.
webhookSecret
Stringoptional
Webhook secret.
webhookSecretCredentialName
Stringoptional
Webhook secret credential name.
webhookSecretCredentialProjectName
Stringoptional
Webhook 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"});

Procedure example

$cmdr->createTrigger("qe proj", "qe trigger 1", {procedureName =>"qe procedure", triggerType =>"webhook", pluginKey=>"EC-Github", pluginParameter =>[ {pluginParameterName =>"repositories", value =>"test/testrepo"}], serviceAccountName =>"qe service name", webhookSecret =>"push"});

ectool

Pipeline example

ectool createTrigger 'qe proj' 'qe trigger 1' --pipelineName 'qe pipeline' --triggerType 'webhook' --pluginKey 'EC-Github' --pluginParameter repositories='test/testrepo' --serviceAccountName 'qe service name' --webhookSecret 'push'

Procedure example

ectool createTrigger 'qe proj' 'qe trigger 1' --procedureName 'qe procedure' --triggerType 'webhook' --pluginKey 'EC-Github' --pluginParameter repositories='test/testrepo' --serviceAccountName 'qe service name' --webhookSecret 'push'