Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there is a way to run a job/task when a git branch is deleted?

Ben D'Herville
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 18, 2022

We have a build plan (configured by bamboo yml file) that copies files to AWS S3.  If a branch build runs it creates these files but we'd like to remove them when the branch is deleted.  

We previously used gitlab and it had this ability but I haven't been able to find any hook or trigger in bamboo that would run a job/task just before the branch plan is deleted.  Any ideas on how to do it?

1 answer

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2022

Hello @Ben D'Herville

Bamboo will not trigger any actions once a Plan branch is deleted. Instead, it will disable the Plan branch immediately and queue a branch deletion according to the Plan configuration.

Data that is generated outside of Bamboo premises such as files on S3 buckets will not be touched by Bamboo.

We recommend you set an external script that will run the cleanup on your buckets on a daily basis (or even more/less often depending on your requirement). That script can be run as a different Plan from Bamboo based on a scheduled trigger or even outside of Bamboo scope as a cron job.

Best regards,

 

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events