-1

I have setup a monorepo for my microfrontends application. I am new to devops and so I read this article and figured out how to create separate pipelines for each mfe. The final step is where I am a bit confused. When a build completes it generates an artifact which is then sent to the app service. My question is how do I get access those artifacts (from each of my remotes) in the release pipeline? The structure of the monorepo is like this:

- packages
   - container
      - container-pipeline.yml
   - mfe1
      - mfe1-pipeline.yml
   - mfe2
      - mfe2-pipeline.yml

How do I create the release pipeline so that changes to any mfe trigger the builds for that pipeline only, but the artifacts get updated. Since this project is fairly new, I'm open to any suggestions.

getnot
  • 21
  • 3

1 Answers1

0

First, use build pipeline to generate artifact.

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'
  
- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(Build.BinariesDirectory)'
    includeRootFolder: true
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    replaceExistingArchive: true
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

Second, deploy based on the artifact of build pipeline.

enter image description here

Bowman Zhu-MSFT
  • 4,776
  • 1
  • 9
  • 10
  • 1
    I'm trying to build multiple applications, as part of one. This method works when my application is a monolith. My question was, how do I get access to all the artifacts in one place? Ideally only the application with a change should be deployed and that's what I'm looking for. – getnot Sep 16 '21 at 17:25