From db1eced7f065ad6c0f7cadb5227ef013e013ef36 Mon Sep 17 00:00:00 2001 From: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> Date: Tue, 9 Mar 2021 12:35:07 +0530 Subject: [PATCH] fix for duplicate duployment issue (#111) --- package.json | 4 ++-- .../Providers/WebAppDeploymentProvider.ts | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 25997e237..2517872c4 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "dependencies": { "@actions/core": "^1.2.6", "actions-secret-parser": "^1.0.3", - "azure-actions-appservice-rest": "^1.2.9", + "azure-actions-appservice-rest": "^1.3.1", "azure-actions-utility": "^1.0.3", - "azure-actions-webclient": "^1.0.11" + "azure-actions-webclient": "^1.1.0" } } diff --git a/src/DeploymentProvider/Providers/WebAppDeploymentProvider.ts b/src/DeploymentProvider/Providers/WebAppDeploymentProvider.ts index 4e3518f24..0da14307c 100644 --- a/src/DeploymentProvider/Providers/WebAppDeploymentProvider.ts +++ b/src/DeploymentProvider/Providers/WebAppDeploymentProvider.ts @@ -5,6 +5,7 @@ import * as zipUtility from 'azure-actions-utility/ziputility.js'; import { Package, PackageType } from "azure-actions-utility/packageUtility"; import { BaseWebAppDeploymentProvider } from './BaseWebAppDeploymentProvider'; +import { addAnnotation } from 'azure-actions-appservice-rest/Utilities/AnnotationUtility'; export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider { @@ -30,7 +31,7 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider { let folderPath = await utility.generateTemporaryFolderForDeployment(false, webPackage, PackageType.jar); let output = await utility.archiveFolderForDeployment(false, folderPath); webPackage = output.webDeployPkg; - this.deploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage); + this.deploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, { slotName: this.actionParams.slotName }); break; case PackageType.folder: @@ -38,12 +39,12 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider { webPackage = await zipUtility.archiveFolder(webPackage, "", tempPackagePath) as string; core.debug("Compressed folder into zip " + webPackage); core.debug("Initiated deployment via kudu service for webapp package : "+ webPackage); - this.deploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage); + this.deploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, { slotName: this.actionParams.slotName }); break; case PackageType.zip: core.debug("Initiated deployment via kudu service for webapp package : "+ webPackage); - this.deploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage); + this.deploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, { slotName: this.actionParams.slotName }); break; default: @@ -67,4 +68,13 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider { core.debug(`Skipped updating appCommandLine. Current value is: ${currentStartupCommand}`); } } + + public async UpdateDeploymentStatus(isDeploymentSuccess: boolean) { + if(!!this.appService) { + await addAnnotation(this.actionParams.endpoint, this.appService, isDeploymentSuccess); + } + + console.log('App Service Application URL: ' + this.applicationURL); + core.setOutput('webapp-url', this.applicationURL); + } } \ No newline at end of file