Monday, 8 January 2018

Deploying Two Deployment Group Targets on Same Machine

Deployment groups are the recommended approach to use with VSTS for setting up release management based automated deployments. Can two team projects of same VSTS account with two deployment groups, have same machine as the target? Was a question in a forum and below steps describe how to achieve it.


If the script from the VSTS to setup executed as it is, when the second deployment group target is deployed the first one gets overridden. So there will be target attached to only one deployment group with the default PowerShell script execution to create deployment group target.

You can use steps below to achieve multiple deployment group targets in azure VM or any single machine.

1. Copy the target registration PowerShell script to a notepad. Then replace the

$env:SystemDrive\'vstsagent'

with a local path of your preference for agent for example

'g:\vstsagentprojX'

This will make the agent installed for project X deployment group setup in g:\vstsagentprojX.

enter image description here

2. Replace

--agent $env:COMPUTERNAME

in the script with project specific name for example

--agent chamindac.projx

enter image description here

3. Then register the agent for Project X deployment group and it will be configured in the specified folder,

enter image description here

and with a unique service name since you have provided a project specific name for agent.

enter image description here

4. Follow steps similar to the other project and change its PowerShell script to have the

$env:SystemDrive\'vstsagent'

replace with project specific path for local folder say

'g:\vstsagentprojQ'

Then change --agent $env:COMPUTERNAME to a project specific name such as

--agent chamindac.projq

Then run the script to create the deployment group agent for the second project.

enter image description here

This will create two agent services with unique names in the same machine. enter image description here

You should have two targets in two team project deployment groups, online.

enter image description here

No comments:

Popular Posts