Deployment Groups ion TFS 2018 - tfs

Do you need an agent for deployment group tfs 2018 or is it best practice to have a separate agent to deal with deployment to the different environments?

A Deployment Group is not a real group/agent/machine. It is a logical set of deployment target machines that have agents installed on each one.
Deployment groups represent the physical environments; for example, "Dev", "Test", "UAT", and "Production". In effect, a deployment group is just another grouping of agents, much like an agent pool.
Some advantage when using Deployment groups:
Specify the security context and runtime targets for the agents. As you create a deployment group, you add users and give them
appropriate permissions to administer, manage, view, and use the
group.
Let you view live logs for each server as a deployment takes place, and download logs for all servers to track your deployments down to
individual machines.
Enable you to use machine tags to limit deployment to specific sets of target servers.
As for using deployment group or separate agents with deployment to the different environments, it's based on your environment and team's decision.
More details about Deployment groups in TFS, please take a look at our official doc.

Related

When do we need to have slaves for Jenkins and when we do not?

I am a beginner user of Jenkins. I am trying to putting a development process onto the DevOps pipeline that includes Jenkins, GitHub, SonarQube, IBM UCD.
It is not a very complicated deployment process and it uses windows machine.
There are three environments, QA, DEV, and PROD.
I know that I need to install one IBM UCD agent for each of those three, but do I need to have three slaves in Jenkins as well , or just one master in Jenkins could do that deployment for three environments ? Which way is better ?
Usually for the complex deployment process companies are using "Master+Agent" scheme, but in your case there is no need to create some advanced Jenkins system with master and agents if you can build it on one host and you have not any additional projects or restrictions.
From official documentation:
It is pretty common when starting with Jenkins to have a single server which runs the master and all builds, however Jenkins architecture is fundamentally "Master+Agent". The master is designed to do co-ordination and provide the GUI and API endpoints, and the Agents are designed to perform the work. The reason being that workloads are often best "farmed out" to distributed servers. This may be for scale, or to provide different tools, or build on different target platforms. Another common reason for remote agents is to enact deployments into secured environments (without the master having direct access).
For additional information you can read the following articles: this and this.

Jenkins Parameterize choice for the Deploying Servers

I am working with Maven Project in Jenkins. Previously I configured maven build and Nexus Deployment. Now I want to deploy the project in deployment servers. There are four build environments called QA,Dev,Prod,Stress and each one have specific servers. Until this point I have made the selection properties using jenkins plugins.
The requirement is, when I select the deployment environment one by one as a example QA, I need to list down only QA servers, If it is stress I need to list down Stress Servers.
I am using extended choice parameter plugin.
Does anyone know how to do this?
In here I attach my deployment environment and servers.
I got the solution for this. I think this will be important to future readers. For achieving this, I used,
Active Choices Plugin
Below I attached snapshots of the configuration.

In TFS 2018, how do I set demands for a Deployment group?

I have a server setup using TFS 2018 that currently builds our software and triggers a release to deploy the binaries to my target system. I want to be able to only deploy the binaries to specific machines within a Deployment group based on the Capabilities each target has defined. I can see the capabilities for each target within my deployment group but no way to reference them.
I don't see an option to set Demands for the Deployment Group Phase in my Release Definition, only for a Build Agent.
How can I set Demands for my Deployment group?
Deployment groups don't have demands, but they do have tags. You can tag the machines in your deployment groups however you want, then specify that a Deployment Group phase should only run on a certain set of tags.
Since deployment groups don't have demands, but tags, you could try to use an agent phase on your release instead of a deployment group.
Release/build agents are the same, they share the same code base.
When you use an agent phase on a release pipeline, you can still use deployment tasks like to deploy IIS apps, they just will use WinRM, where you will be capable of remote deployments.
For instance, your deployment agent could be installed on server 1 and your target IIS in another server. With deployment groups, you only can deploy where the agent is installed.

Jenkins Distributed Builds: Build Farm for separation of build environments

I currently have one Jenkins master setup for our continuous integration project. Several different projects will need to be built using this Jenkins instance, each with different project dependencies as well as system dependencies.
From what I have read in the Jenkins documentation, a distributed build architecture can be implemented to provide different environments needed for builds/tests:
Jenkins supports the "master/slave" mode, where the workload of
building projects are delegated to multiple "slave" nodes, allowing a
single Jenkins installation to host a large number of projects, or to
provide different environments needed for builds/tests.
I'd like to take this approach in order to avoid taking down the continuous integration system for all projects in the event there is an issue with a single project's dependencies.
Instead, just the agent for the project with the environment that has an issue would be down, and our other projects could build/test without issue.
My approach for this is going to be to launch Jenkins Slaves/Agents via SSH, which are each configured with what is required to build a specific project. In the jobs configuration, I'll then restrict where the project can be built to the appropriate slave/agent node.
Are there any issues in having Jenkins agents as virtual machines
with resolvable IP addresses running on the same machine as Jenkins
Master (as the goal is not necessarily to gain computing power, but
to provide isolated environments for builds/tests)?
Should simply using virtualbox to launch the Slave/Agent virtual
machines, and configuring those machines with the environment
necessary to build/test the specific project be sufficient as far as
the project's goals go?
Thanks to everyone in advance for any advice on how best to create isolated environments for my projects!

TFS only releasing to the first agent in an environment

In TFS 2015 Update 2, I have configured seven release agents in one pool, separated into a set of logical environments using capabilities.
I also have a release configured with three environments defined to use the queue corresponding to this pool and demands specified to filter to the appropriate servers for each environment (1-Test, 2-QA, 4-Prod).
My problem is that TFS is only releasing to the first agent created that meets the demands. If I remove all demands in an environment I would assume it would release to every agent in the pool yet TFS still releases to only the first agent in the pool. If I disable that first agent, it will release to the next; but still to only one agent.
What am I missing?
I think you're misunderstanding what agents are for. The agent merely acts as an invocation mechanism for your deployment activities. You don't need one agent per environment or per server.
For example, if you need to run a PowerShell script on a machine, you use the "PowerShell on Target Machine" deployment activity. The agent will then use WinRM to tell the target machine what scripts to run. That agent can run PowerShell scripts against any machine.
Why would you want the release or build to select a different agent every time? I had always seen with TFS that the probability of a build running on the agent, where the last successful build for a specific build definition ran, is very high.
The only reason I think a build/release should run on a different agent every time is if the number of builds running at a same time requiring the same capabilities is more than one.
If you would like to test each of the agents then try disabling one agent at a time and run the build/release.

Resources