【发布时间】:2018-11-23 08:49:03
【问题描述】:
我正在尝试根据自己的执行进度创建一个动态 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"
【问题讨论】:
标签: continuous-integration gitlab gitlab-ci continuous-deployment