gpt4 book ai didi

gitlab - 如何从 GitLab 13 ci 构建过程中排除 master 分支?

转载 作者:行者123 更新时间:2023-12-05 07:07:48 25 4
gpt4 key购买 nike

我希望在添加标签时为所有分支运行构建过程。除了 master 分支。

deploy_qas:
stage: deploy
script:
- echo "Implatado em QAS"
environment:
name: qas
url: https://env.br
only:
- tags
except:
- master

这样不行。

我正在使用 GitLab 13 ce。

最佳答案

新的 Gitlab 语法使用 rules .

only and except are not being actively developed. rules is the preferred keyword to control when to add jobs to pipelines.

使用规则的解决方案:

deploy_qas:
stage: deploy
script:
- echo "Implatado em QAS"
environment:
name: qas
url: https://env.br
rules:
- if: $CI_COMMIT_BRANCH == 'master'
when: never
- if: $CI_COMMIT_TAG
# `when: always` is implied here

关于gitlab - 如何从 GitLab 13 ci 构建过程中排除 master 分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62023625/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com