[英]Can I change gitlab-ci.yml file mid execution?
這是我們簡化的 gitlab-ci.yml
stages:
- build
- deploy
# fetch home repo that'll run the pipeline processes
before_script:
- git clone git@git.org:home_repo/home_repo.git
- cd home_repo
build:
stage: build
needs: []
resource_group: $CI_PROJECT_NAME'_build'
script:
- ./pipeline.sh build
deploy_environment1:
stage: deploy
needs: [build]
resource_group: deploy_environment1
script:
- ./pipeline.sh deploy env1
deploy_environment2:
stage: deploy
needs: [build]
resource_group: deploy_environment2
script:
- ./pipeline.sh deploy env2
添加 5-10 個環境會大大增加規模。 我們該如何處理呢?
可能的解決方案 1:有一項工作將創建所有可用環境的列表並部署到它們。 但是,我們不會對每個部署的進展情況有一個很好的管道視圖。
deploy_environments:
stage: deploy
needs: [build]
resource_group: deploy_environments
script:
- ./pipeline.sh deploy to_all
可能的解決方案 2: before_script
獲取所有環境的列表並根據需要插入盡可能多deploy_environment
作業定義。 但我們不知道該怎么做。 因此標題中的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.