SQL Project Deploy to docker container - Adding a UI for user to select docker image tag (#19297)

This commit is contained in:
Leila Lali
2022-05-11 11:29:11 -07:00
committed by GitHub
parent 65ef41d53d
commit e10b1eb5a9
10 changed files with 301 additions and 30 deletions

View File

@@ -213,9 +213,13 @@ export async function launchPublishTargetOption(project: Project): Promise<const
const target = project.getProjectTargetVersion();
const name = getPublishServerName(target);
const logicalServerName = target === constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlAzure) ? constants.AzureSqlLogicalServerName : constants.SqlServerName;
// Options list based on target
const options = target === constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlAzure) ?
[constants.publishToDockerContainer(name), constants.publishToNewAzureServer, constants.publishToExistingServer(logicalServerName)] :
[constants.publishToAzureEmulator, constants.publishToNewAzureServer, constants.publishToExistingServer(logicalServerName)] :
[constants.publishToDockerContainer(name), constants.publishToExistingServer(logicalServerName)];
// Show the options to the user
const publishOption = await vscode.window.showQuickPick(
options,
{ title: constants.selectPublishOption, ignoreFocusOut: true });
@@ -225,11 +229,14 @@ export async function launchPublishTargetOption(project: Project): Promise<const
return undefined;
}
// Map the title to the publish option type
switch (publishOption) {
case constants.publishToExistingServer(name):
return constants.PublishTargetType.existingServer;
case constants.publishToDockerContainer(name):
return constants.PublishTargetType.docker;
case constants.publishToAzureEmulator:
return constants.PublishTargetType.docker;
case constants.publishToNewAzureServer:
return constants.PublishTargetType.newAzureServer;
default: