/
How to add Environment trigger to a deployment project using Bamboo CLI

How to add Environment trigger to a deployment project using Bamboo CLI

This article explains how to add Environment trigger to a deployment project using Bamboo Command Line Interface (BCLI)Deployment triggers are set as part of the environment configuration for a deployment project.

Instructions

Use addEnvironmentTask action to add a trigger to a deployment project. Use deployment triggers for automatic management of how and when Bamboo starts deployment projects. 

Execute the following action to add a trigger to the deployment project:

./acli.sh --action addEnvironmentTrigger --deploymentProject "Deployment for mknew test001" --environment "DEV1" --type "Scheduled" --description "scheduled trigger" --schedule "0 0 1 ? * *"

The output of the CLI action is as shown below:

Trigger 'scheduled trigger' with id 1 added to environment 'DEV1' in deployment project 'Deployment for mknew test001'.



The parameters used with the action are:

  • --deploymentProject value refers to the name or ID of the deployment project.
  • --environment  value refers to the environment name.
  • --type value refers to the type of the triggers.
  • --description value refers to the trigger description.
  • --schedule value refers to the time. 

It is recommended to test the action in a non-production environment before running in productionor run the action with --simulate parameter to verify the behavior before deploying.

Related content