From 1cfcf9d09c6d3965d1883c7038a74c59b517da85 Mon Sep 17 00:00:00 2001 From: Subrahmanyam Mandavilli Date: Thu, 2 Mar 2017 13:07:30 +0530 Subject: [PATCH] Added servername input (#3706) --- Tasks/SqlDacpacDeploymentOnMachineGroup/Main.ps1 | 3 ++- .../resources.resjson/en-US/resources.resjson | 2 ++ Tasks/SqlDacpacDeploymentOnMachineGroup/task.json | 13 +++++++++++-- .../SqlDacpacDeploymentOnMachineGroup/task.loc.json | 13 +++++++++++-- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroup/Main.ps1 b/Tasks/SqlDacpacDeploymentOnMachineGroup/Main.ps1 index 99ea1f34f6b7..2f62f2082723 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroup/Main.ps1 +++ b/Tasks/SqlDacpacDeploymentOnMachineGroup/Main.ps1 @@ -47,6 +47,7 @@ $dacpacFile = Get-VstsInput -Name "dacpacFile" $sqlFile = Get-VstsInput -Name "sqlFile" $inlineSql = Get-VstsInput -Name "inlineSql" $targetMethod = Get-VstsInput -Name "targetMethod" +$serverName = Get-VstsInput -Name "serverName" -Require $databaseName = Get-VstsInput -Name "databaseName" -Require $authscheme = Get-VstsInput -Name "authscheme" -Require $sqlUsername = Get-VstsInput -Name "sqlUsername" @@ -60,7 +61,7 @@ Import-Module $PSScriptRoot\ps_modules\TaskModuleSqlUtility Try { - $serverName = "localhost" + if ($taskType -ne "dacpac") { $additionalArguments = $additionalArgumentsSql diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroup/Strings/resources.resjson/en-US/resources.resjson b/Tasks/SqlDacpacDeploymentOnMachineGroup/Strings/resources.resjson/en-US/resources.resjson index 0b01f6403edf..5fe2ba2aabdb 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroup/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/SqlDacpacDeploymentOnMachineGroup/Strings/resources.resjson/en-US/resources.resjson @@ -13,6 +13,8 @@ "loc.input.help.InlineSql": "Sql Queries inline", "loc.input.label.TargetMethod": "Specify SQL Using", "loc.input.help.TargetMethod": "Specify the option to connect to the target SQL Server Database. The options are either to provide the SQL Server Database details, or the SQL Server connection string, or the Publish profile XML file.", + "loc.input.label.ServerName": "Server Name", + "loc.input.help.ServerName": "Provide the SQL Server name like, machinename\\FabriakmSQL,1433 or localhost or .\\SQL2012R2. Specifying localhost will connect to the Default SQL Server instance on the machine.", "loc.input.label.DatabaseName": "Database Name", "loc.input.help.DatabaseName": "Provide the name of the SQL Server database.", "loc.input.label.AuthScheme": "Authentication", diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroup/task.json b/Tasks/SqlDacpacDeploymentOnMachineGroup/task.json index b2cf5306f228..e9e7daf43189 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroup/task.json +++ b/Tasks/SqlDacpacDeploymentOnMachineGroup/task.json @@ -14,8 +14,8 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 2, - "Patch": 2 + "Minor": 3, + "Patch": 0 }, "demands": [], "minimumAgentVersion": "1.102.0", @@ -79,6 +79,15 @@ }, "helpMarkDown": "Specify the option to connect to the target SQL Server Database. The options are either to provide the SQL Server Database details, or the SQL Server connection string, or the Publish profile XML file." }, + { + "name": "ServerName", + "type": "string", + "label": "Server Name", + "required": true, + "defaultValue": "localhost", + "visibleRule": "TargetMethod = server || TaskType = sqlQuery || TaskType = sqlInline", + "helpMarkDown": "Provide the SQL Server name like, machinename\\FabriakmSQL,1433 or localhost or .\\SQL2012R2. Specifying localhost will connect to the Default SQL Server instance on the machine." + }, { "name": "DatabaseName", "type": "string", diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroup/task.loc.json b/Tasks/SqlDacpacDeploymentOnMachineGroup/task.loc.json index 7824768586ae..2eeb4b36d3a0 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroup/task.loc.json +++ b/Tasks/SqlDacpacDeploymentOnMachineGroup/task.loc.json @@ -14,8 +14,8 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 2, - "Patch": 2 + "Minor": 3, + "Patch": 0 }, "demands": [], "minimumAgentVersion": "1.102.0", @@ -79,6 +79,15 @@ }, "helpMarkDown": "ms-resource:loc.input.help.TargetMethod" }, + { + "name": "ServerName", + "type": "string", + "label": "ms-resource:loc.input.label.ServerName", + "required": true, + "defaultValue": "localhost", + "visibleRule": "TargetMethod = server || TaskType = sqlQuery || TaskType = sqlInline", + "helpMarkDown": "ms-resource:loc.input.help.ServerName" + }, { "name": "DatabaseName", "type": "string",