Add support for optionally setting Plan level variables

Issue #3 resolved
repo owner created an issue

No description provided.

Comments (10)

  1. Gilberto Torrezan

    I need Plan level variables to use them as part of the release version name on deployment projects. It would be nice to call my releases ${bamboo.maven.artifactId}-${bamboo.maven.version} instead of plain "release-number".

  2. David Ehringer reporter

    Hi @gilberto_torrezan

    I understand what you are trying to do as we have the same need. But I don't think Plan variables are going to provide you accurate values except in fairly specific use cases. If you allow for concurrent builds in a plan or utilize stages in a way that allows multiple non-complete plans, you could end up with inaccurate version numbers if you source them from Plan variables (since Plan variables are shared across all builds).

    A few people are trying to figure out how to most appropriately use Bamboo variables for releases here: https://confluence.atlassian.com/display/BAMBOO/How+deployment+releases+work?focusedCommentId=406225314#comment-406225314 Depending on this, I'll update the plugin as needed.

  3. admin

    Hi,

    I'm not sure to understand. Like @gilberto_torrezan , I would like to extract my Maven version number to use it with the new deployment project in Bamboo. An option to grant a job level variable to a plan level variable would do the job in my case. My build plans are quite simple, I don't have concurrent build or anything like this. Maybe this option can be labelled with a warning ?

  4. David Ehringer reporter

    Hi @gilberto_torrezan and @paul_menager,

    I've added support for Plan level variables in version 1.3.0 of the plugin, which has just been published to the Marketplace. Let me know how this works for you.

  5. guillaume Dupéré

    It does not work for me ...(Using bamboo 5.1) I have added a plan that checks out a pom.xml , read the version and put it in pom.version variable. In the same plan and even in the same job , I am trying to use ${bamboo.pom.version} and it does not get picked up...

    DO you guys have the same problem ?

  6. Eddie Webbinaro

    @eagleyes - use "job" level to share the value with tasks inside that job. I think Plan level variables are not available for use during the build, but are exposed after the build completes for visibility in the metadata tab and use in Deployment projects.

  7. David Ehringer reporter

    @eagleyes I'm assuming that the problems you are having are more related to the nature of how Plan variables work. As Eddie mentioned, you aren't going to be able to access a newly created Plan variable within the context of the job that you create it. Also, Plan variables are effectively locked (at least from my experience) for the entire execution of a specific build and for downstream things like linked Deployment Projects. This means that when the build kicks off, the Plan variables become set in stone. Any new Plan variables you set or any changes to Plan variables that you make within the context of that build will not take effect until the next build executes.

    This behavior along with some of what I mentioned above are some of reasons why I was originally hesitant to add support in the plugin for Plan variables since the behavior of Plan variables in general (outside of the context of this plugin) isn't necessary what you might expect in all scenarios.

  8. Log in to comment