Merge pull request #30 from jmiller-afw/develop
Updates to provide installation of agent as a release agent
This commit is contained in:
Коммит
bc151ff681
|
@ -108,6 +108,15 @@ function Set-TargetResource {
|
|||
[System.String]
|
||||
$Pool = 'Default',
|
||||
|
||||
[System.String]
|
||||
$DeploymentGroup = '',
|
||||
|
||||
[System.String]
|
||||
$DeploymentGroupTags = '',
|
||||
|
||||
[System.String]
|
||||
[string]$ProjectName = '',
|
||||
|
||||
[parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
$AgentDirectory,
|
||||
|
@ -141,12 +150,15 @@ function Set-TargetResource {
|
|||
|
||||
if ( $Ensure -eq 'Present') {
|
||||
$installArgs = @{
|
||||
'Name' = $Name
|
||||
'Pool' = $Pool
|
||||
'ServerUrl' = $ServerUrl
|
||||
'PAT' = $AccountCredential.Password
|
||||
'AgentDirectory' = $AgentDirectory
|
||||
'Replace' = $true
|
||||
'Name' = $Name
|
||||
'Pool' = $Pool
|
||||
'ServerUrl' = $ServerUrl
|
||||
'PAT' = $AccountCredential.Password
|
||||
'AgentDirectory' = $AgentDirectory
|
||||
'Replace' = $true
|
||||
'DeploymentGroup' = $DeploymentGroup
|
||||
'DeploymentGroupTags' = $DeploymentGroupTags
|
||||
'ProjectName' = $ProjectName
|
||||
}
|
||||
|
||||
if ( $Work ) { $installArgs['Work'] = $Work }
|
||||
|
@ -189,6 +201,15 @@ function Test-TargetResource {
|
|||
[System.String]
|
||||
$Pool = 'Default',
|
||||
|
||||
[System.String]
|
||||
$DeploymentGroup = '',
|
||||
|
||||
[System.String]
|
||||
$DeploymentGroupTags = '',
|
||||
|
||||
[System.String]
|
||||
[string]$ProjectName = '',
|
||||
|
||||
[parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
$AgentDirectory,
|
||||
|
|
|
@ -222,6 +222,15 @@ function Install-VSTSAgent {
|
|||
[parameter(Mandatory = $false)]
|
||||
[string]$Pool = 'Default',
|
||||
|
||||
[parameter(Mandatory = $false)]
|
||||
[string]$DeploymentGroup = '',
|
||||
|
||||
[parameter(Mandatory = $false)]
|
||||
[string]$DeploymentGroupTags = '',
|
||||
|
||||
[parameter(Mandatory = $false)]
|
||||
[string]$ProjectName = '',
|
||||
|
||||
[parameter(Mandatory = $true)]
|
||||
[securestring]$PAT,
|
||||
|
||||
|
@ -292,7 +301,14 @@ function Install-VSTSAgent {
|
|||
if ( -not $configPath ) { throw "Agent $agentFolder is missing config.cmd" }
|
||||
|
||||
[string[]]$configArgs = @('--unattended', '--url', "$ServerUrl", '--auth', `
|
||||
'pat', '--pool', "$Pool", '--agent', "$Name", '--runAsService')
|
||||
'pat', '--agent', "$Name", '--runAsService')
|
||||
|
||||
if ($Pool) { $configArgs += '--pool', $Pool }
|
||||
|
||||
if ($DeploymentGroup) { $configArgs += '--deploymentgroup', '--deploymentgroupname', $DeploymentGroup }
|
||||
if ($DeploymentGroupTags) { $configArgs += '--addDeploymentGroupTags', '--deploymentGroupTags', $DeploymentGroupTags }
|
||||
if ($ProjectName) { $configArgs += '--projectname', $ProjectName }
|
||||
|
||||
if ( $Replace ) { $configArgs += '--replace' }
|
||||
if ( $LogonCredential ) { $configArgs += '--windowsLogonAccount', $LogonCredential.UserName }
|
||||
if ( $Work ) { $configArgs += '--work', $Work }
|
||||
|
|
Загрузка…
Ссылка в новой задаче