Reputation: 764
I have a situation where i need to use multiple value parameter or using extended-choice-parameter for Jenkins where we can select multiple options for my parameter. I have different protractor test suites {Suite1, Suite2, Suite3, Suite4} which i am using as parameter of build for user to select which suite they want to execute. If they select multiple suite in option, how should i read those values in my shell script? Currently i am using $Suite to read value but i am not sure what should i use to read multiple values selected. Can someone please help?
Upvotes: 0
Views: 833
Reputation: 5742
One option is:
execute-shell block:
#!/bin/sh
SUITS="{"
if [ "${S1}" = "test-1" ]; then
SUITS="${SUITS}test-1 "
fi
if [ "${S2}" = "test-2" ]; then
SUITS="${SUITS}test-2 "
fi
SUITS="${SUITS}}"
# SUITS="{test-1 test2- }"
cat "SUITS=${SUITS}" > suits.file
Then inject the file using the EnvInject plugin and SUITS will be available in the workspace
Upvotes: 1