Reuse job in different stages

Obaid Maroof May 4, 2017

I have a job (with a script task) defined in Stage A to deploy the artifacts to QA environment. The inline script which deploys the artifacts to the destination server is parameterized. Now in the next stage, I want to deploy the artifacts to my integration environment.

I was wondering if I could (re)use the same job in this new Stage to deploy the artifacts to the higher environments (integration in this case)? 

2 answers

2 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 4, 2017

In Bamboo 6, the feature called Bamboo Specs lets you define the plan in a textual format. You can then very easily reuse the job between stages.

Obaid Maroof May 4, 2017

Thanks Przemyslaw Bruski. Is it possible to export an existing job/stage/plan as a code?

tien tran March 14, 2018

@Obaid Maroof It seems that have no option to export/import stages/job as code, let's say on Bamboo 6. However, there's the same function named View plan as Java specs. Just choose plan that need to export. Then look on option list from right-top action menu, we can choose the function to export entire plan configuration. Take a look inside and we'll see all configurations for stages and jobs.

Thanks

1 vote
Jobin Kuruvilla [Adaptavist]
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.
May 4, 2017

I am afraid you have to recreate the job in the other stage as well. There is no way to share the jobs or clone the jobs. 

A best practice is to have a build job that generates the artifact and then have a deployment project with environments defined under it. 

Obaid Maroof May 4, 2017

I appreciate your approach with having a deployment project with different environments defined. But then I was missing the functionality of having a fully automated pipeline which starts from triggering the build and end up in deploying it to the prod environment (obviously with some manual stages in between). As far as I know, deployment project is kind of an always manual step. Let me know if I am missing something obvious here.

Jobin Kuruvilla [Adaptavist]
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.
May 4, 2017

You can adda trigger in the deployment environment. So, a full cycle is always possible. Check out https://confluence.atlassian.com/bamboo/triggers-for-deployment-environments-342098622.html 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events