Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to deploy zip files directly #2621

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@
"when": "explorerResourceIsFolder == true",
"group": "zzz_azuretools_deploy@1"
},
{
"command": "appService.Deploy",
"when": "resourceExtname == .zip",
"group": "zzz_azuretools_deploy@1"
},
{
"command": "appService.Deploy",
"when": "explorerResourceIsFolder == false && resourceExtname =~ /.[j|w]ar$/",
Expand Down
18 changes: 16 additions & 2 deletions test/nightly/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface ITestCase {
workspaceFolder: string | undefined;
runtimePrefix: string;
versions: IVersionInfo[];
zipFile?: string | undefined;
}

interface IVersionInfo {
Expand Down Expand Up @@ -55,6 +56,14 @@ suite('Create Web App and deploy', function (this: Mocha.Suite): void {
{ version: '16', supportedAppOs: 'Both', displayText: '16 LTS' }
]
},
{
runtimePrefix: 'Node',
workspaceFolder: 'testFolder',
zipFile: 'node-hello-1.zip',
versions: [
{ version: '16', supportedAppOs: 'Both', displayText: '16 LTS' }
]
},
{
runtimePrefix: '.NET',
workspaceFolder: undefined,
Expand Down Expand Up @@ -111,7 +120,7 @@ suite('Create Web App and deploy', function (this: Mocha.Suite): void {
});
}

async function testCreateWebAppAndDeploy(os: string, promptForOs: boolean, runtime: string, workspacePath: string, expectedVersion: string): Promise<void> {
async function testCreateWebAppAndDeploy(os: string, promptForOs: boolean, runtime: string, workspacePath: string, expectedVersion: string, zipFile?: string): Promise<void> {
const resourceName: string = getRandomHexString();
const resourceGroupName = getRandomHexString();
resourceGroupsToDelete.push(resourceGroupName);
Expand All @@ -132,8 +141,13 @@ suite('Create Web App and deploy', function (this: Mocha.Suite): void {
assert.ok(createdApp);

await runWithTestActionContext('Deploy', async context => {

await context.ui.runWithInputs([workspacePath, resourceName, 'Deploy'], async () => {
await deploy(context);
if (zipFile) {
await vscode.commands.executeCommand('appService.Deploy', vscode.Uri.file(path.join(workspacePath, zipFile)), undefined, true /*isNewApp*/);
} else {
await deploy(context);
}
});
});

Expand Down
Binary file added test/nightly/testFolder/node-hello-1.zip
Binary file not shown.