I have below code
stages:
- build
variables:
TARGET:
description: "Select target (ABC, XYZ)"
value: "none"
options:
- none
- ABC
- XYZ
ENABLE_ABC: "0"
ENABLE_XYZ: "0"
before_script:
- echo "Selected target: $TARGET"
- |
if [ "$TARGET" == "ABC" ]; then
export ENABLE_ABC="1"
elif [ "$TARGET" == "XYZ" ]; then
export ENABLE_XYZ="1"
fi
- echo "Enable ABC: $ENABLE_ABC"
- echo "Enable XYZ: $ENABLE_XYZ"
build:
stage: build
script:
- echo "Selected target: $TARGET"
- >
if [ "$ENABLE_ABC" == "1" ]; then
echo "ABC target is enabled"
fi
- >
if [ "$ENABLE_XYZ" == "1" ]; then
echo "XYZ target is enabled"
fi
I try to use option(TARGET) or directly with api trigger to enable both ENABLE_* to control this pipeline, but I always got
“before_script config should be a string or a nested array of strings up to 10 levels deep”