Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,033
Community Members
 
Community Events
168
Community Groups

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

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

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

Atlassian Community Events