在Azure DevOps服务中,我们可以在不同环境之间共享VM吗? [英] In Azure DevOps Servvices, can we share a VM among different environment?

查看:49
本文介绍了在Azure DevOps服务中,我们可以在不同环境之间共享VM吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个DEV服务器,其中部署了多个应用程序.我想使用Azure DevOps管道自动化这些应用程序的部署,因此,我现在正在寻找构建多阶段管道.

I currently have a DEV server where several application are deployed. I want to automate the deployment of these applications using Azure DevOps pipelines, and thus I am now looking to the build multi-stage pipelines.

据我了解,我们现在应该使用环境而不是部署组的创建.

As far as I understand, we should now use the creation of environments, and not the deployment groups.

但是,在项目中设置环境(指定VM资源)意味着执行PowerShell脚本,该脚本将为每个项目创建一个代理,一个Windows服务和一个环境"部署组.因此,如果我有一个包含10个项目的服务器,它将下载10倍的代理,并在同一服务器上安装10个Windows服务.

However setting up an environment in a project (specifying a VM resource) implies the execution of the PowerShell script, which will create one agent, one windows service, and one "environment" deployment group for each project. Thus if I have a single server with 10 project, this will download 10 times the agent, install 10 windows services on the same server.

我了解并行执行作业部署的兴趣,但这对我来说似乎有些过分.

I understand the interest for parallelizing the job deployment, but this seems a bit overkill to me.

我有什么想念的吗?我们可以为几个项目共享一个环境VM资源(以及底层环境代理)吗?

Is there something am I missing ? Can we share an environemnt VM resource (and thus the underlying environment agent) for several projects ?

谢谢!

推荐答案

我有什么想念的吗?我们可以共享一个环境虚拟机吗多个资源(以及基础环境代理)项目?

Is there something am I missing ? Can we share an environemnt VM resource (and thus the underlying environment agent) for several projects ?

对不起,但尚不支持在不同环境之间共享VM.

Sorry but sharing VM among different environments is not supported yet.

您似乎有10个团队项目,以下建议可能会有所帮助,具体取决于我们无法在环境之间共享VM:

It seems that you have 10 team projects, here're some suggestions which may help depending on that we can't share VM among environments:

  1. 为每个项目指定资源,这意味着我们必须执行10次上述操作.然后,每个Team项目都应该有自己的CI/CD管道.(不是您最初想要的)

使用一个Team项目中的一个多级管道从10个项目中获取回购,然后为它们执行CI/CD工作.这样,我们使用一个管道来构建和部署10个存储库,因此我们只需要在当前项目中使用Environment.

Use one multistage pipeline from one Team project to fetch repos from the ten projects and then do CI/CD job for them. In this way, we use one pipeline to build and deploy ten repos, so we only need to use Environment in current project.

这样,我们只需为当前项目指定一次VM资源.我们可以使用十个阶段或十个工作来部署这十个项目.但这会使yaml文件变得复杂且难以维护.任何工作或阶段中的任何错误都可能使整个流程失败,这也不是一个好的工作流程.(不推荐).

In this way, we only need to specify the VM resource for current project once. We can use ten stages or ten jobs for deployment of the ten projects. But this will make the yaml file complex and hard to maintain. Any error in any job or stage could fail the whole pipeline, also it's not a good workflow. (Not recommended).

您可以检查以下博客:共享项目中部署组的数量.您可以考虑暂时使用经典CI/CD管道,以便可以使用部署组,而不是环境.并且支持在不同的部署组之间共享VM.

You can check this blog : Sharing of Deployment Groups across projects. You can consider using classic CI/CD pipelines temporarily so that you can use the deployment groups, not the environments. And sharing a VM among different Deployment Groups is supported.

由于目前尚不支持您想要的内容,因此我们必须使用临时解决方法.就像提到的博客一样:

Since what you want is not supported for now, we have to use a temporary workaround. And just like the blog mentioned:

我们收到的一大反馈是,这仅部分解决了客户在多个应用程序之间共享其IaaS机器(部署目标)的情况.

我同意支持在环境之间共享VM是一个好主意,因此我建议您可以在我们的

I agree it's a good idea to support sharing VM among environments, so I suggest you can post a feature request(Suggest a feaure) in our User Voice forum to share your feedback.

以上所有希望为您提供帮助.干杯!

Hope all above makes help for you. Cheers!

这篇关于在Azure DevOps服务中,我们可以在不同环境之间共享VM吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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