Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make bamboo job variables mandatory?

Tags:

bamboo

I want to set up a bamboo job where it must be run manually and some variables must be set. Is there some way to do this? As things are, the person has to remember to use Run Customized and set the variables.

like image 497
bmargulies Avatar asked Oct 21 '15 11:10

bmargulies


People also ask

How do you pass a variable in Bamboo?

In your Bamboo environment, select the settings gear from the top-right corner of your Bamboo web interface and select Global Variables. The Global Variables page opens. For Variable Name, enter SRCCLR_API_TOKEN_PASSWORD . For Value, paste the API token you copied when creating the token.

How do I set a global variable in Bamboo?

To access the Global variables page:From the top navigation bar select > Build resources > Global variables. Add, update, or delete the global variables, as desired: Add a new variable once you have entered the key and value for it. Updates to existing rows will be saved as you move between cells in the table.

What is Bamboo build working directory?

The Working Directory is where Bamboo temporarily puts the checked-out files it is building. The location of this directory was specified using the Setup Wizard, can be viewed as described in Bamboo's system information, and can be changed as described below.


1 Answers

You may use a script to validate the value given to a variable, and declare the variable with a default value that should be overridden.

  • Plan variable= myvar, value= to-override
  • Bash script:

    if [[ "${bamboo.myvar}" = 'to-override' ]]; then
        echo "You have to override this variable"
        exit 1
    fi
    

This may be the first job of the first stage in your pipeline, that runs where ie. bash is available.

like image 113
Raffi Avatar answered Oct 11 '22 23:10

Raffi