skip to Main Content

Is there a way to use independently the outputs of a checkbox list in the Active Choices plugin on Jenkins ? (as in my example, I need to access to the selected check boxes one at a time

Here are a few screens to explain my problem :

Active Choices configuration in the job

The script

Checkboxes selected

Output

I would like to be able to access first to only the Debian_6, then only the Debian 6 32bits 🙂

Thanks !

2

Answers


  1. As the result is comma-separated, maybe you could split the output:

    # This is a way to split in bash
    osArr=(${OS//,/ })
    
    # And then access a result as
    os1=${osArr[0]}
    

    Or maybe iterate them in a for block

    for os in ${OS//,/ } ; do 
       echo "${os}"
    done
    
    Login or Signup to reply.
  2. You can store the comma separated values into an array and iterate them

    #!/bin/bash
    OS_selected=($(echo $OS | tr "," "n"))
    for values in ${OS_selected[@]}
    do
    echo $values
    done
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search