azure-devopsantazure-pipelineswarear

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.


Solution

  • 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'