How to make artifact from parent plan available to deployment project associated with child plan

I have the following scenario:

  1. A parent plan (P1) that downloads from source control, builds a web application project with MSBuild, runs unit tests with NUnit and creates Nuget packages that are defined as artifacts of the plan.
    Artifact (A) is a deployable Nuget package and has a copy pattern that matches the build info as: projectName.${bamboo.projectName.ReleasePrefix}.${bamboo.buildNumber}.nupkg
    Artifact (B) contains everything to run UI tests against the target application in artifact (A).
     
  2. When the parent plan (P1) completes successfully, it triggers a child plan (P2), which:

    • Stage#1: Downloads artifact (B) from parent plan. Publishes (B) to a test environment. Runs a suite of UI tests. This all runs on a remote agent specifically designated to do these tests.
    • Stage#2: Downloads artifact (A) from the parent plan (P1) and makes it available as an artifact of the child plan (P2). (well, it's supposed to).
     
  3. Deployment plan (D1) is triggered by the successful completion of plan (P2), the UI tests.
    It's job is to push the deployable artifact (A) to an OctopusDeploy nuget library and create a release on Octopus.

 

Here's the issue:

(P2) stage#2, download specific artifact, even though I've picked the specific named artifact from the list of shared artifacts on the parent plan, seems to be re-assessing the copy pattern at the time it attempts to download. As the copy pattern has a bamboo.buildNumber variable in it, the download is using the buildNumber from (P2), not the buildNumber of (P1) that was used in the naming of the original artifact's nuget package.

so the artifact in (P1) has a filename: "projectName.0.1.3.83.nupkg", but the stage#2 download seems to be looking for "projectName.0.1.3.94.nupkg".
Doesn't Bamboo keep a reference to the actual file that the specific artifact on the parent plan relates to? Or does it use the original plan's pattern match and substitute in its own values?


Is there a better way to achieve what I'm trying to do? 

 

 

2 answers

I might add, that plan (P1) also has plan (feature) branches, which need to be built in order to update feature stories on Jira with their build status, but only the primary branch needs to have the UI tests run against it, hence the child plan, linked only to the primary branch.

Do you need the variable-filled copy pattern in P2S2? Shouldn't you already only have the package you want in the directory you are dealing with? Could you use a simpler copy pattern of * projectName.*.nupkg or something there instead? (I assume you have dumped the available bamboo environment variables in P2S2 and didn't see anything for the parent's buildNumber?)

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,080 views 0 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot