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

Ryan Vice January 27, 2014

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
Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2014

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
TAGS
AUG Leaders

Atlassian Community Events