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

查看:33
本文介绍了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、网站和 Node.js 项目发布到它们自己的 Azure 应用服务之前:

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)

看起来我可以使用路径过滤器(https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops).仍然对任何进一步的输入感兴趣.

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.

推荐答案

希望对他人有所帮助:

我通过使用 路径过滤器 并且它完美地工作.我为每个需要在某处生存或托管的项目创建了 1 个构建定义(在我的示例中,我有 3 个 Build 定义:Web Api、网站、Node.js).

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天全站免登陆