One deployment plan or one deployment environment for multiple build plans

Aleksandr Sorokin February 18, 2019

I have multiple build plans for a variety of repos.

I want to use one deployment project and one environment for all of them

I've read this

https://community.atlassian.com/t5/Bamboo-questions/How-can-I-reference-multiple-build-plans-in-deployment-project/qaq-p/60451

However, when i tried this solution i bumped into the problem - no variables sharing between child plans. Also i should set up certain build plan for artifact download in child plan. So.. For me where is no solution

1 answer

0 votes
Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

no variables sharing between child plans. 

Save the variable in the first child plan into a file and set it as artifact. The second plan can download the artifact and use "Inject Bamboo variable" task to create the variable from first plan.

Aleksandr Sorokin February 26, 2019

you should specify certain plan from which artefacts could be downloaded (correct for version 6.6.1). As a result, you can't use this trick for multiple plans.

bamboo.png

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Can you clarify more on the reason?

Do you mean that child plan B could not download artifact from child plan A?

Aleksandr Sorokin February 26, 2019

bamboo2.png

Aleksandr Sorokin February 26, 2019

Plan A independent from Plan B.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Plan pipe could not download Artifact from Plan A and B?

Aleksandr Sorokin February 26, 2019

I need solution with one deployment project, so i can get one deployment environment.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Yes, Plan pipe should be able to download artifact from plan A and B. Then, generate artifacts again so that it can be downloaded in deployment environment.

Which part of it is not working?

Aleksandr Sorokin February 26, 2019

1. Plan A and Plan B builds independently. It is not a real problem in this case

2. Whose artefact I would get in Plan Pipe if I included tasks

  a. Download artifacts from Plan B

  b. Download artifacts from Plan A

  c. inject variables from file

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

If there are two Artifact Download tasks, Plan Pipe can download artifacts from both Plan A and Plan B.

Inject variable task is used to create variable from file. If Plan A and B variables are saved in file and set to be artifact, Plan Pipe can create variables from Plan A and B into Plan Pipe.

Aleksandr Sorokin February 26, 2019

Whose artefact file with variables I would get?

Could you tell me if where limit on tasks in one plan in case we have 200 plans

So it will looks like

1. Download Artefacts from Plan A

2. Download Artefacts from Plan B

3. Download Artefacts from Plan C

...

100. Download Artefacts from Plan FAA

101. Download Artefacts from Plan FAB

...

200. Inject variables from file "variables"

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

There is no limit in task. If there are 200 plans, it would be better to group it in different Plan Pipe, for example:

Plan Pipe A will download from Plan A-Z

Plan Pipe B will download from Plan BA-BZ

...

Final Plan Pipe will download from Plan Pipe A, Plan Pipe B, ...

Inject variable task is used to create variable from file. 

If Plan A save the important variable in a file A and Plan B save the important variable in a file B, the final Plan Pipe can use Script task to combine the data from file A and file B into a single file first before using the Inject variable task.

Aleksandr Sorokin February 26, 2019

Can we determine in child plan which plan triggered pipe plan?

For me it looks if we cant save variable in same file, in case it would be replaced by latest artefact downloading task, we should use script to choose the file which would be injected.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Can we determine in child plan which plan triggered pipe plan?

Do you mean if Bamboo will show which child plan trigger pipe plan or you want to control which child plan should trigger pipe plan?

Plan A is configured as the parent (dependency setting) of Plan Pipe so that after Plan A finish running, it will trigger Plan Pipe. Plan Pipe will show that it has been trigger by Plan A.

Setting up plan build dependencies

For me it looks if we cant save variable in same file, in case it would be replaced by latest artefact downloading task, we should use script to choose the file which would be injected.

You have to use a Script task to save the variable from Plan A into a file which mean you can decide which variable to save inside Plan A.

Aleksandr Sorokin February 26, 2019
Do you mean if Bamboo will show which child plan trigger pipe plan

I mean we should somehow determine from which plan i should inject variables.

I dont need all plans variables i need plan which triggered pipe plan and only its variables.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

You can use a Script task in a single Plan to save its variable so that it can be shared to the pipe plan then

Aleksandr Sorokin February 26, 2019

I get it but from which plan i should inject variables

Problem stay in pipe plan to determine whose variables i should inject.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

For example:

Plan A - use a Script task to save the variable into a file A. File A is set to be Artifact

Plan B - no need save variable so no extra Script task created to save it

Plan C - no need save variable so no extra Script task created to save it

...

Plan Pipe download Artifact File A from Plan A

Plan Pipe use Inject variable task to read from File A to create variable. The Inject variable task can be configured to read data from File A only.

Aleksandr Sorokin February 26, 2019

In my case

Plan A - use a Script task to save the variable into a file A. File A is set to be Artifact

Plan B - use a Script task to save the variable into a file B. File B is set to be Artifact

Plan C - use a Script task to save the variable into a file C. File C is set to be Artifact

...

Plan ABC - use a Script task to save the variable into a file ABC. File ABC is set to be Artifact

---------------------

some of this plans triggered Plan Pipe

----------------------

Plan Pipe download Artifact File A from Plan A

Plan Pipe download Artifact File B from Plan B

Plan Pipe download Artifact File C from Plan C

...

Plan Pipe download Artifact File ABC from Plan ABC

..

Plan Pipe use Inject variable task to read from File ???

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Inject variable task can be configured to read from a specific file name only. Since each plan have different file name, you can choose which file to be used.

Aleksandr Sorokin February 26, 2019

How we could determine which plan triggered pipe plan.

Is where some variable in Pipe Plan which contain a triggering plan name?

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

If the dependency setting is used to trigger Pipe Plan, the variable ${bamboo.DependencyTriggerReason.triggeringBuildResultKey} will show the related build that trigger it

Aleksandr Sorokin February 26, 2019

Thanks, i will try work around with ${bamboo.DependencyTriggerReason.triggeringBuildResultKey} key.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events