@@ -10,6 +10,7 @@ import { addAnnotation } from 'azure-actions-appservice-rest/Utilities/Annotatio
1010export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
1111
1212 public async DeployWebAppStep ( ) {
13+ var deploymentType ;
1314 let appPackage : Package = this . actionParams . package ;
1415 let webPackage = appPackage . getPath ( ) ;
1516
@@ -20,37 +21,42 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
2021
2122 switch ( packageType ) {
2223 case PackageType . war :
23- core . debug ( "Initiated deployment via kudu service for webapp war package : " + webPackage ) ;
24- var warName = utility . getFileNameFromPath ( webPackage , ".war" ) ;
25- this . deploymentID = await this . kuduServiceUtility . deployUsingWarDeploy ( webPackage ,
26- { slotName : this . actionParams . slotName , commitMessage : this . actionParams . commitMessage } , warName ) ;
24+ core . debug ( "Initiated deployment via kudu service for webapp war package : " + webPackage ) ;
25+ deploymentType = "war" ;
2726 break ;
2827
2928 case PackageType . jar :
3029 core . debug ( "Initiated deployment via kudu service for webapp jar package : " + webPackage ) ;
31- let folderPath = await utility . generateTemporaryFolderForDeployment ( false , webPackage , PackageType . jar ) ;
32- let output = await utility . archiveFolderForDeployment ( false , folderPath ) ;
33- webPackage = output . webDeployPkg ;
34- this . deploymentID = await this . kuduServiceUtility . deployUsingZipDeploy ( webPackage , { slotName : this . actionParams . slotName , commitMessage :this . actionParams . commitMessage } ) ;
30+ deploymentType = "jar" ;
3531 break ;
3632
3733 case PackageType . folder :
3834 let tempPackagePath = utility . generateTemporaryFolderOrZipPath ( `${ process . env . RUNNER_TEMP } ` , false ) ;
3935 webPackage = await zipUtility . archiveFolder ( webPackage , "" , tempPackagePath ) as string ;
4036 core . debug ( "Compressed folder into zip " + webPackage ) ;
41- core . debug ( "Initiated deployment via kudu service for webapp package : " + webPackage ) ;
42- this . deploymentID = await this . kuduServiceUtility . deployUsingZipDeploy ( webPackage , { slotName : this . actionParams . slotName , commitMessage : this . actionParams . commitMessage } ) ;
37+ core . debug ( "Initiated deployment via kudu service for webapp package : " + webPackage ) ;
38+ deploymentType = "zip" ;
4339 break ;
4440
4541 case PackageType . zip :
46- core . debug ( "Initiated deployment via kudu service for webapp package : " + webPackage ) ;
47- this . deploymentID = await this . kuduServiceUtility . deployUsingZipDeploy ( webPackage , { slotName : this . actionParams . slotName , commitMessage : this . actionParams . commitMessage } ) ;
42+ core . debug ( "Initiated deployment via kudu service for webapp zip package : " + webPackage ) ;
43+ deploymentType = "zip" ;
4844 break ;
4945
5046 default :
51- throw new Error ( 'Invalid App Service package or folder path provided: ' + webPackage ) ;
47+ if ( ! this . actionParams . type ) {
48+ throw new Error ( 'Invalid App Service package or folder path provided: ' + webPackage ) ;
49+ }
50+ break ;
51+ }
52+
53+ if ( ! this . actionParams . type ) {
54+ this . actionParams . type = deploymentType ;
5255 }
5356
57+ this . deploymentID = await this . kuduServiceUtility . deployUsingOneDeploy ( webPackage , { slotName : this . actionParams . slotName , commitMessage :this . actionParams . commitMessage } ,
58+ this . actionParams . targetPath , this . actionParams . type , this . actionParams . clean , this . actionParams . restart ) ;
59+
5460 // updating startup command
5561 if ( ! ! this . actionParams . startupCommand ) {
5662 await this . updateStartupCommand ( ) ;
0 commit comments