SQL Project - deploy to docker publish option (#17050)

SQL Project - deploy to docker publish option
This commit is contained in:
Leila Lali
2021-09-13 14:12:53 -07:00
committed by GitHub
parent 90bb9c3c55
commit 4912faa966
13 changed files with 158 additions and 143 deletions

View File

@@ -207,17 +207,37 @@ export async function getPublishDatabaseSettings(project: Project, promptForConn
* Create flow for Publishing a database using only VS Code-native APIs such as QuickPick
*/
export async function launchPublishDatabaseQuickpick(project: Project, projectController: ProjectsController): Promise<void> {
let settings: IDeploySettings | undefined = await getPublishDatabaseSettings(project);
const publishTarget = await launchPublishTargetOption();
if (publishTarget === constants.publishToDockerContainer) {
await projectController.publishToDockerContainer(project);
} else {
let settings: IDeploySettings | undefined = await getPublishDatabaseSettings(project);
if (settings) {
// 5. Select action to take
const action = await vscode.window.showQuickPick(
[constants.generateScriptButtonText, constants.publish],
{ title: constants.chooseAction, ignoreFocusOut: true });
if (!action) {
return;
if (settings) {
// 5. Select action to take
const action = await vscode.window.showQuickPick(
[constants.generateScriptButtonText, constants.publish],
{ title: constants.chooseAction, ignoreFocusOut: true });
if (!action) {
return;
}
await projectController.publishOrScriptProject(project, settings, action === constants.publish);
}
await projectController.publishOrScriptProject(project, settings, action === constants.publish);
}
}
async function launchPublishTargetOption(): Promise<string | undefined> {
// Show options to user for deploy to existing server or docker
const publishOption = await vscode.window.showQuickPick(
[constants.publishToExistingServer, constants.publishToDockerContainer],
{ title: constants.selectPublishOption, ignoreFocusOut: true });
// Return when user hits escape
if (!publishOption) {
return undefined;
}
return publishOption;
}