It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is there a way to get a Deployment Project to kick off the build it's dependent on when running on a schedule?

I want to have a scheduled daily build that builds and deploys to our dev environment and I'd like to be able to reuse the build for things other than just the daily build. Because of this I'd like to be able to have the deployment job kicked off from a scheduled trigger and have it automatically run the dependent build plan. I've tried doing this and it looks like the deployment project grabs the last sucessful build plan's artifacts which is not the desired behavior.

1 answer

1 accepted

0 votes
Answer accepted

You could trigger it with the API but you'd also need to be waiting around for it. I can't think of a straight forward way to handle what you seem to be asking for so I'll list off a few ways to get it done which you can probably mix and match a bit.

Two plans - Same configuration except different time triggers each with their own deployment project that is triggered off the build.

Two triggers on the same build, if you could redeploy the last successful build if the last build(s) failed and have a known time limitation of the build then you could have two build triggers and each with their own accompaning deployment triggers that are (build time) apart from the build triggers. You could also build in checks to prevent needless redeploys.

And a complicated way mainly by excess logs, setup two triggers on the build and have each deployment project trigger off the build. The first job of the deployment project would check some parameter; bamboo variable, artifact, timestamp, time, etc.; and either do the work or not. Not doing the work can't cancel the deploy though, you'd either have to report successfully doing nothing or report a failure which won't go to the next steps.

More complicated, less logs. Build has two triggers, deployments have none. Last stage of the plan will use same/similar check parameter as previous example and manually trigger the deployment(s) of its choosing. The call would need to be async to an external script/process and have a short delay to ensure the build is complete before the deployment is fired off. This is the most complicated but will write/leave the cleanest results to view, the UI will show which deployment(s) was called from each build and you only have a single plan to configure.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

444 views 2 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you