Azure DevOps:1个解决方案多个项目CI/CD [英] Azure DevOps: 1 Solution Multiple Projects CI/CD

查看:517
本文介绍了Azure DevOps:1个解决方案多个项目CI/CD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用CI/CD设置Azure DevOps.这可能无法实现,但我希望找到答案.

I just started setting Azure DevOps with CI/CD. This might not be possible but I hope to find answers.

我有6个项目的解决方案:

I have a solution with 6 projects:

  • Web Api项目(引用基础结构,存储库和模型项目)
  • 网站项目(调用Web Api获取数据并引用基础结构,存储库和模型项目)
  • Node.js项目(仅调用Web Api获取数据)
  • 基础设施项目(由Web Api和网站共享)
  • 存储库项目(由Web Api和网站共享)
  • 模型项目(由Web Api和网站共享)
  • Web Api project (references Infrastructure, Repositories, and Models projects)
  • Website project (calls the Web Api for data and references Infrastructure, Repositories, and Models projects)
  • Node.js project (only calls the Web Api for data)
  • Infrastructure project (shared by Web Api and Website)
  • Repositories project (shared by Web Api and Website)
  • Models project (shared by Web Api and Website)

在我开始搜索如何在CI/CD定义中将Web Api,Web站点和Node.js项目发布到他们自己的Azure App Service之前,

Before I start searching on how to publish the Web Api, Website, and Node.js projects to their own Azure App Service within the CI/CD definitions:

是否可以进行设置,以便仅部署某些项目?即:仅发布Node.js项目,或者仅发布Web Api和网站,而不发布Node.js.

还是我需要将事情保留在不同的解决方案中?

Or do I need to keep things in different solutions?

如果我将它们保留在单独的解决方案中,那么这对于源代码管理(Git)的共享项目(基础结构,存储库和模型)有何影响?如果我在Web Api解决方案中的模型和存储库"中添加代码,我是否要提交这些更改而不是Web Api Git存储库?这对引用相同Models和Repo项目的其他项目有何影响?这是Git子模块起作用的地方吗?

If I keep them in separate solutions, how does this affect the shared projects (Infrastructure, Repo, and Models) in reference to Source Control (Git)? If I add code to the Models and Repo in the Web Api solution, do I commit these changes not he Web Api Git repo? How does this affect the other projects that reference the same Models and Repo projects? Is this where Git submodules come into play?

更新1 (2019/3/8)

Update 1 (2019/3/8)

好像我可以使用路径过滤器(

Looks like I might be able to get this working in 1 solution using Path filters (https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops). Still interested in any further input.

推荐答案

希望这对其他人有帮助:

Hoping this helps others:

我通过使用

I solved this by using Path filters on the Build definition and it works flawlessly. I have created 1 build definition per project that needs to live or be hosted somewhere (in my example, I have 3 Build definitions: Web Api, Website, Node.js).

路径过滤器中使用正确的项目路径,只有正确的Builds旋转,并且任何未触及的项目都不会触发构建.每个构建都有自己的release,然后将指定的应用程序部署到其自己的目的地.

With the proper path to the project in the Path filter only the proper Builds spin up, and any projects untouched do not trigger a build. Each build has it's own release which then deploys the specified app to it's own destination.

这篇关于Azure DevOps:1个解决方案多个项目CI/CD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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