Hi,
The global variables:
section of my .gitlab-ci.yml
file has a variable HOST_NAME
with a list of values in options:
as showing below:
variables:
HOST_NAME:
description: Select a host name to deploy
value: web-dev-01
options:
- web-dev-01
- web-dev-02
- web-dev-03
- web-prod-01
- web-prod-02
- web-prod-03
deploy:
stage: deploy
script:
- echo "Deploying $HOST_NAME"
Now, when I run the pipeline, the HOST_NAME
variable shows the default value web-dev-01
and other 6 server names become available in the drop-down list of this variable, whichever branch I run from.
I’d like to make the values available like below:
-
When running from
dev
branch, the default value of theHOST_NAME
should showweb-dev-01
and drop-down should show the first 3 server names (ending withdev-xx
). -
When running from
master
branch, the default value of theHOST_NAME
should showweb-prod-01
and drop-down should show the last 3 server names (ending withprod-xx
).
Is it possible? If so, would you please show how?