Azure DevOps-处理用于UI和Dotnet API层的单独代码存储库的单个版本 [英] Azure DevOps - Handling single release for separate code repositories for UI and Dotnet API layer

本文介绍了Azure DevOps-处理用于UI和Dotnet API层的单独代码存储库的单个版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有单独的现有代码存储库-一个用于Angular UI,一个用于.NET 4.7 API层.在手动过程中,在执行dotnet publish之后,将已编译的UI代码放置在wwwroot文件夹中,并将工件部署到Azure App服务.在尝试使用Azure DevOps实施CI时,我不得不为UI和BackEnd创建两个构建管道.在发布管道中,看来我必须解压缩工件,将UI工件的复制步骤写到wwwroot中,然后再次压缩它,然后再部署到App服务.

I have separate existing code repositories- One for Angular UI and one for .NET 4.7 API layer. In the manual process, The compiled UI code is placed in wwwroot folder after dotnet publish is executed, and the artifacts are deployed to an Azure App service. While trying to implement CI using Azure DevOps, I had to create two build pipelines for UI and BackEnd. In the release pipeline, it looks like I have to unzip the artifacts, write a copy step to UI artifacts into wwwroot and then again zip it before deploying to an App service.

我只能想象这不是最好的方法.鉴于我是Azure DevOps的新手,所以我想了解最佳实践,尤其是在处理相对较旧的代码时.如果现在可以的话,我会将UI和API层都保留在一个存储库中.处理此问题的最佳方法是什么?

I can only imagine this isnt the best approach. Given that I am new to Azure DevOps, I would like to know the best practices especially while handling relatively legacy code. I would have kept both the UI and API layer in a single repository if I could do that now. What is the best way to handle this?

更新-我可以在一个构建管道中构建多个存储库吗?根据文章- https://docs.microsoft.com/zh-CN/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops

UPDATE - Can I have multiple repositories built in a single build pipeline? Based on the article - https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops

谢谢,AK

推荐答案

是的,您可以就您的原始问题而言,您可以发布更改而无需压缩它们(将 zipAfterPublish 设置为false):

And in terms of your original question you can publish your changes and without zipping them (set zipAfterPublish to false):

- task: DotNetCoreCLI@2
  inputs:
    command: publish
    publishWebProjects: True
    arguments: '--configuration $(BuildConfiguration) --output output_folder'
    zipAfterPublish: False
    workingDirectory: backend/app/

,然后将您的 wwwroot 复制并压缩到wwwroot,将您的后端应用压缩到两个单独的存档中并发布它们.

and then copying your wwwroot and zipped wwwroot and your backend app into two separate archives and publishem them.

这篇关于Azure DevOps-处理用于UI和Dotnet API层的单独代码存储库的单个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆