我正在尝试根据它自己的执行进度创建一个动态的 gitlab 管道。例如,我有 2 个环境,并且每个环境的部署将根据before_script 中脚本的执行启用/禁用。它对我不起作用,似乎管道启动后无法更改管道变量值。有什么建议?(请参阅下面我的 gitlab-ci.yml)
variables:
RELEASE: limited
stages:
- build
- deploy
before_script:
- export RELEASE=${check-release-type-dynamically.sh}
build1:
stage: build
script:
- echo "Do your build here"
## DEPLOYMENT
deploy_production_ga:
stage: update_prod_env
script:
- echo "deploy environment for all customers"
allow_failure: false
only:
- branches
only:
variables:
- $RELEASE == "general_availability"
deploy_production_limited:
stage: update_prod_env
script:
- echo "deploy environment for limited customers"
allow_failure: false
only:
- branches
only:
variables:
- $RELEASE == "limited"
Run Code Online (Sandbox Code Playgroud) continuous-integration continuous-deployment gitlab gitlab-ci