gpt4 book ai didi

yaml - 使用 GitLab CI 如何禁用一项作业的存储库克隆?

转载 作者:行者123 更新时间:2023-12-03 16:54:58 33 4
gpt4 key购买 nike

我需要加快工作“部署”。它不需要项目源,但只需要工件。

如何为唯一的工作禁用项目克隆?

典型 .gitlab-ci.yml (伪)看起来像:

image: gcc

build:
stage: build
script:
- ./configure
- mkdir build && cd $_
- cmake ..
- make -sj8
artifacts:
paths:
- "build/*.elf"

deploy:
image: artifactory
variables:
- DO_NOT_CLONE: 1 ## WANT THIS OPTION
stage: deploy
script:
- push_artifacts build/*.elf

最佳答案

check out 变量 GIT_STRATEGY :

variables:
GIT_STRATEGY: none

从文档:

none also re-uses the project workspace, but skips all Git operations (including GitLab Runner’s pre-clone script, if present). It is mostly useful for jobs that operate exclusively on artifacts (e.g., deploy).



https://docs.gitlab.com/ee/ci/yaml/#git-strategy

关于yaml - 使用 GitLab CI 如何禁用一项作业的存储库克隆?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56324070/

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