How exclude Deployment Group Target from Release on the fly

大城市里の小女人 提交于 2021-02-08 10:01:45

问题


I have a Deployment Group with X number of servers.
I've created and set up my Release Pipeline to work as expected.
When I run it, it deploys to all servers under my Deployment group. (I do filter by specific Tags but that's irrelevant)

What I need now, is to be able to filter/exclude servers on the fly during deployments (for example: deploy only on the first server and leave the rest unchanged)

Something like the below (screenshot taken from Octopus which supports this functionality)

I'm trying to migrate a few Release Definitions from Octopus to Azure Pipelines and this is blocking me.


回答1:


Since this is not supported by Azure Pipelines, I ended up using a workaround:

  1. Create a Pipeline Variable that contains my 4 server names.

  2. Add a Custom condition on my steps
    'and(succeeded(), contains(variables['IncludedServers'],variables['Agent.MachineName']))

3.Edit the variable, if necessary, when creating a release

I do want to improve a few things, like the contains expression so that there are no problems with false positives when I have substrings.

It's not perfect, because of the possibilities of typos but it's probably an acceptable workaround. Hopefully Microsoft will add official support for this.

I'm adding the feature request link again here, upvote if you find this useful.
Allow users to Exclude Deployment Targets from Release on the fly




回答2:


How deploy Release on subset of Deployment Group servers

Generally, we use machine tags to limit deployment to specific sets of target servers.

The tags you assign allow you to limit deployment to specific servers when the deployment group is used in a Deployment group job.

In addition, you can also disable targets in the Deployment pools of Organization Settings.

Update:

Here is the uservoice on allowing users to Exclude Deployment Targets from Release on the fly. Anyone interested in this can vote for it and track it.



来源:https://stackoverflow.com/questions/60512309/how-exclude-deployment-group-target-from-release-on-the-fly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!