Skip to content

Commit

Permalink
fix for duplicate duployment issue (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrutaKawade authored Mar 9, 2021
1 parent b062dd0 commit db1eced
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
16 changes: 13 additions & 3 deletions src/DeploymentProvider/Providers/WebAppDeploymentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -30,20 +31,20 @@ 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:
let tempPackagePath = utility.generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false);
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:
Expand All @@ -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);
}
}

0 comments on commit db1eced

Please sign in to comment.