我是Azure DevOps的新手,希望从两个不同的存储库执行代码,并对每个回购程序执行不同的操作,例如:
Stages:
- stage: Data_Setup
jobs:
- job: Data_Setup // Want to perform this operation on repo1
timeoutInMinutes: 120
pool:
vmImage: ubuntu-20.04
continueOnError: true
steps:
- task: Gradle@2
inputs:
gradleWrapperFile: gradlew
tasks: cleanReports test aggregate
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- stage: Run_all_regression_tests // Want to perform this operation on repo2
jobs:
- job: Run_all_regression_tests
timeoutInMinutes: 100
pool:
vmImage: ubuntu-20.04
continueOnError: true
steps:
- task: Gradle@2
inputs:
gradleWrapperFile: gradlew
tasks: cleanReports createJar test aggregate
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)发布于 2022-04-05 13:07:03
添加了多个存储库,
resources:
repositories:当您想使用特定的存储库时,您可以在步骤中使用“签出”签出,如下所示(从Microsoft文档复制)
resources:
repositories:
- repository: MyGitHubRepo # The name used to reference this repository in the checkout step
type: github
endpoint: MyGitHubServiceConnection
name: MyGitHubOrgOrUser/MyGitHubRepo
- repository: MyBitbucketRepo
type: bitbucket
endpoint: MyBitbucketServiceConnection
name: MyBitbucketOrgOrUser/MyBitbucketRepo
- repository: MyAzureReposGitRepository # In a different organization
endpoint: MyAzureReposGitServiceConnection
type: git
name: OtherProject/MyAzureReposGitRepo
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- checkout: MyGitHubRepo
- checkout: MyBitbucketRepo
- checkout: MyAzureReposGitRepository
- script: dir $(Build.SourcesDirectory)
https://stackoverflow.com/questions/71751962
复制相似问题