Mr. code
Mr. code

Reputation: 157

Including the build of one repo to another repo in Azure DevOps

I have a repo in Azure devops which is using 'ant all' command to build an ear file. This ear file contain should a war file built from another repo in the azure. How can I include this war file in the build?

Thanks.

Upvotes: 1

Views: 1490

Answers (2)

Krzysztof Madej
Krzysztof Madej

Reputation: 40779

If your war file is built from code hosted in another repo and not is a part of the repo itself. You can publish pipeline artifact and download it in your next pipeline. Here you have doc article about this. And here description of the task itself.

In short to publish you should add code like this:

steps:
- publish: $(System.DefaultWorkingDirectory)/bin/WebApp
  artifact: WebApp

and to download:

# Download artifacts from a specific pipeline.
- task: DownloadPipelineArtifact@2
  inputs:
    source: 'specific'
    project: 'FabrikamFiber'
    pipeline: 12
    runVersion: 'latest'

Upvotes: 2

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31083

If you mean the war file is already in another repo in the same organization, you could check multiple checkout, by using multiple checkout steps in your pipeline, you can fetch and check out other repositories in addition to the one you use to store your YAML pipeline.

steps:
- checkout: git://MyProject/MyRepo # Azure Repos Git repository in the same organization
- checkout: self

Upvotes: 1

Related Questions