简体   繁体   中英

Deployment on TFS 2018 on premises with build agent and/or deployment group

We are using TFS 2018 On-Premises. On our server we have set up a build agent which builds our project on demand. In the publish task, I have configured a fileshare where I can find my builds. This build server is also hosting our staging and testing website.

Now there is the opportunity to create a deployment group. The deployment group should be able to deploy the build directly to the web server.

If I create the deployment group, a script for registering a deployment agent is provided.

Now my question: do I have to register this depoyment agent on my buildserver, which hosts also our staging website or is this agent the same as the already registered build-agent?

Do I have to register both agents?

If my stating website is on the build machine, is it possible to deploy only with the build functionality or do I have to setup the deloyment group and after that do I have to configure a release definition?

If I have to setup a deployment group and a release, do I have change the publish task on build from file share to server?

Addition register the agent:

If I try to register the agent, I get an error:

Exception when calling "DownloadFile" with 2 arguments: "The request was aborted: no protected SSL / TLS channel could be created."

Is this because a password is required? The build agent has had not such a problem. Or is the reason the SSL / TLS channel is already used by the build agent or such a thing?

The registration script is:

$ErrorActionPreference="Stop";If(-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() ).IsInRole( [Security.Principal.WindowsBuiltInRole] “Administrator”)){ throw "Run command in Administrator PowerShell Prompt"};If(-NOT (Test-Path $env:SystemDrive\\'vstsagent')){mkdir $env:SystemDrive\\'vstsagent'}; cd $env:SystemDrive\\'vstsagent'; for($i=1; $i -lt 100; $i++){$destFolder="A"+$i.ToString();if(-NOT (Test-Path ($destFolder))){mkdir $destFolder;cd $destFolder;break;}}; $agentZip="$PWD\\agent.zip";(New-Object Net.WebClient).DownloadFile( ' https://go.microsoft.com/fwlink/?linkid=867184 ', $agentZip);Add-Type -AssemblyName System.IO.Compression.FileSystem;[System.IO.Compression.ZipFile]::ExtractToDirectory( $agentZip, "$PWD");.\\config.cmd --deploymentgroup --agent $env:COMPUTERNAME --runasservice --work '_work' --url ' https://xxxxxx:1234/ ' --collectionname 'DefaultCollection' --projectname 'ABCDEFGH' --deploymentgroupname "DEV" ; Remove-Item $agentZip;

When you register a deployment group, you install the agent on the servers that are members of the deployment group. A deployment group is a special type of agent pool. Even if another agent is already running on the machine, you have to install the agent using the provided script so that an agent is registered in the agent pool for your deployment group.

Deployment groups only work in Release definitions -- you have to use a "Run on Deployment Group" phase. The tasks that you add to the deployment group phase are then run directly on the machines in the deployment group.

As long as the machines that are members of the deployment group have access to the file share to which your artifacts are published, you should be able to continue to use a file share for storing your build artifacts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM