1983

Bamboo Atlassian: How to share a variable between stages

I am relatively new to Bamboo. I have a question regarding stages implementation with shared variable. I have two stages: Stage 1: Set variable "Sample_build_number" Stage 2: Use variable "Sample_build_number"

Any help with this is very much appreciated.

Answer1:

You can write your variables to a simple property file in Stage 1, and share the property file as an artifact.

Sample_build_number=myvalue

In your Stage 2 job use the Inject Bamboo variables task to read the property file.

Your variable is available in later job steps as ${bamboo.inject.Sample_build_number}

Note this uses the Bamboo Inject Variables Plugin that is bundled in versions 5.7 and later. If you have an earlier version of Bamboo your administrator will need to download and install the plugin.

Recommend

  • switching branches in git - when will i get “You have local changes cannot switch branches.”? [dupli
  • Load properties from properties file and make them available throughout the job/pipeline - Jenkins d
  • Define global environment variables from inside a stage
  • Jenkins Multibranch Pipeline Scan infinite re-build
  • Series of if statements applied to data frame
  • How to render a texture with alpha?
  • 'unstash' is not putting anything in the next step of jenkins pipeline
  • gethostbyname dual network interfaces, select which one to use
  • copy artifacts build step using a dynamic project name alternatives
  • Get ObjectID from URL via REST API Java
  • How to auto-update versions only for dependencies within multi-module/reactor build?
  • using aspnet identity with custom tables
  • Dynamic Stage name in EaselJS
  • Is there any trick about translating BNF to Parsec program?
  • Git Merge Adds New File Instead of Conflict Markers - CONFLICT (rename/add)
  • Unable to install Git-core+svn by MacPorts
  • Django simple Captcha “No module named fields” error
  • Custom Tabgroup Appcelerator
  • Could not find rake using whenever rails
  • Database structure design with variable amounts of fields
  • The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid ver
  • Email format validation in mvc3 view
  • PHPUnit_Framework_TestCase class is not available. Fix… - Makegood , Eclipse
  • Projection media query: browser support and workarounds?
  • C# - Is there a limit to the size of an httpWebRequest stream?
  • Different response to non-authenticated users and AJAX calls
  • How do I fake an specific browser client when using Java's Net library?
  • How to get a value (ex: baseURL) in every Karate feature?
  • How would I use PHP exceptions to define a redirect?
  • How to add date and time under each post in guestbook in google app engine
  • How to extract text from Word files using C#?
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • coudnt use logback because of log4j
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • Checking variable from a different class in C#
  • Does armcc optimizes non-volatile variables with -O0?
  • Conditional In-Line CSS for IE and Others?