我们有一个大型存储库,因此我们可以从Classic管道仅进行差异检出中获利。当管道之前已进行完整的检出时,这意味着可以节省大量时间。
我开始将这些管道从Classic转换为YML,并认识到YML checkout任务不同于Classic Checkout任务。
git version
git version 2.26.2.windows.1
git lfs version
git-lfs/2.10.0 (GitHub; windows amd64; go 1.12.7; git a526ba6b)
git init "D:\AzureDevOpsData\agents\MyAgent\_work\20\s"
Initialized empty Git repository in D:/AzureDevOpsData/agents/MyAgent/_work/20/s/.git/
git remote add origin https://MyUrl.com/MyCol/MyProj/_git/MyRepo
git config gc.auto 0
git config --get-all http.https://MyUrl.com/MyCol/MyProj/_git/MyRepo.extraheader
git config --get-all http.proxy
git -c http.extraheader="AUTHORIZATION: bearer ***" -c http.proxy="http://www-cache.de:3128" fetch --force --tags --prune --progress --no-recurse-submodules origin
remote: Azure Repos
git version
git version 2.26.2.windows.1
git lfs version
git-lfs/2.10.0 (GitHub; windows amd64; go 1.12.7; git a526ba6b)
git config --get remote.origin.url
git clean -ffdx
git reset --hard HEAD
HEAD is now at c349f0e90c0 MyCommit
git config gc.auto 0
git config --get-all http.https://MyUrl.com/MyCol/MyProj/_git/MyRepo.extraheader
git config --get-all http.proxy
git -c http.extraheader="AUTHORIZATION: bearer ***" -c http.proxy="http://www-cache.de:3128" fetch --force --tags --prune --progress --no-recurse-submodules origin
remote: Azure Repos
如何实现YML结帐与经典结帐一样的行为?
元信息
Version: 18.170.30525.1 (Azure DevOps Server 2020)
OnPrem
Self-Hosted-Agents (Windows)
Yaml支持增量结帐。这是一个简单的示例:
trigger:
- master
pool: Default
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
第一次运行:
第二次运行:
检查以下内容:
通常,为了使自托管代理的性能更快,请不要清理存储库。在这种情况下,为了获得最佳性能,请通过禁用要构建的任务或工具的任何“清理”选项来确保您也在逐步构建。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句