【问题标题】:Shallow fetch for repository存储库的浅获取
【发布时间】:2019-01-17 08:13:24
【问题描述】:

我有一个使用模板的 Azure 管道 (yaml),我正在尝试弄清楚如何设置被克隆的实际存储库的提取深度。

resources:
  repositories:
    - repository: templates
      type: git
      name: 'DevOps/CICD'
      ref: refs/heads/develop
    - repository: self # sic!
      fetchDepth: 1
      clean: true`

支持获取深度(vscode 扩展),但我似乎无法在上面找到任何广泛的documentation..

【问题讨论】:

  • 只是一个评论,以防到目前为止它被遗漏,当你使用模板时,它不会检查你引用的 repo,它只是引用那些 yaml 文件。接受的答案提到进行实际结帐,这将使您可以访问您引用模板的其他非 yaml 文件,但有两种不同的东西????

标签: continuous-integration azure-devops azure-pipelines


【解决方案1】:

把它放在steps 下对我有用:

steps:
  - checkout: self
    fetchDepth: 1
    clean: true
  - task: NuGetCommand@2
  ...

结果:

2019-01-17T09:21:45.1133753Z ##[command]git -c http.extraheader="AUTHORIZATION: Bearer ***" fetch --tags --prune --progress --no-recurse-submodules --depth=1 原点

【解决方案2】:

【讨论】:

  • 谢谢!知道应该在哪里设置吗? (在 yaml 层次结构中)
  • 很确定这是层次结构的根,所以在第一级
  • nvm,在steps下找到它
  • 不知道为什么它会被低估,也许如果你需要直接在阶段检查一些东西
  • 它不必是存储库,它可以只是 repo(适用于许多构建)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-28
  • 2019-03-02
  • 2020-07-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多