英文:
Checkout before stages in YAML
问题
我正在进行阶段性的检出以下载存储库。
stages:
- stage: dev
jobs:- deployment: DeploySQLObjects
displayName: "部署 SQL 对象"
environment: "Synapse_DEV"
strategy:
runOnce:
deploy:
steps:
- checkout: self
- deployment: DeploySQLObjects
- stage: test
....... - stage: prod
.......
是否可以在所有阶段之前执行检出,并让所有阶段都使用这个检出?我不太确定如何做。我只看到了没有阶段的步骤示例。
英文:
Im doing a checkout in my stages to download the repo.
stages:
- stage: dev
jobs:
- deployment: DeploySQLObjects
displayName: "Deploy SQL objects"
environment: "Synapse_DEV"
strategy:
runOnce:
deploy:
steps:
- checkout: self
- stage: test
.......
- stage: prod
.......
Is it possible do to the checkout before all stages and let all stages use this checkout?
Im not quite sure how to do it. Ive only seen examples with steps without stages
答案1
得分: 2
如果您正在使用Azure托管的构建代理,每个作业将使用新的构建实例。在这种情况下,您不能使用一个检出步骤...
如果您正在使用自托管的构建代理,您可以通过git命令将一个检出阶段添加到可共享的文件夹,并在其他作业中使用它。
英文:
If you are using Azure Hosted build agents, each job will use a new build instance. In this case, you can not use one checkout step...
If you are using Self Hosted build agents, you may add one checkout stage to some shareable folder through git commands and use it for other jobs.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论