grm*_*mbl 4 continuous-integration azure-devops azure-pipelines
我有一个使用模板的 Azure Pipeline (yaml),我试图弄清楚如何设置被克隆的实际存储库的提取深度。
resources:
repositories:
- repository: templates
type: git
name: 'DevOps/CICD'
ref: refs/heads/develop
- repository: self # sic!
fetchDepth: 1
clean: true`
Run Code Online (Sandbox Code Playgroud)
支持获取深度(vscode 扩展),但我似乎找不到任何关于它的详细文档..
Cra*_*own 11
另一种选择是将浅层提取设置添加到VariablesYAML 管道的部分中:
variables:\n Agent.Source.Git.ShallowFetchDepth: 1\nRun Code Online (Sandbox Code Playgroud)\nAzure Pipelines 将自动识别此设置并--depth=1在识别时将其用作参数git fetch。
请注意,这仅适用于 2022 年 9 月之前创建的管道 \xe2\x80\x93 在该日期之后创建的管道将自动获取深度为 1 的管道,因此不需要显式配置。
\n把它放在steps对我有用的下面:
steps:
- checkout: self
fetchDepth: 1
clean: true
- task: NuGetCommand@2
...
Run Code Online (Sandbox Code Playgroud)
结果是:
2019-01-17T09:21:45.1133753Z ##[command]git -c http.extraheader="AUTHORIZATION:bearer ***" fetch --tags --prune --progress --no-recurse-submodules --depth =1 原点
这是您正在寻找的链接:https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema ?view=vsts&tabs=schema#checkout
该属性确实是 fetchDepth 。
| 归档时间: |
|
| 查看次数: |
3183 次 |
| 最近记录: |