11"use strict" ;
2+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
3+ if ( k2 === undefined ) k2 = k ;
4+ var desc = Object . getOwnPropertyDescriptor ( m , k ) ;
5+ if ( ! desc || ( "get" in desc ? ! m . __esModule : desc . writable || desc . configurable ) ) {
6+ desc = { enumerable : true , get : function ( ) { return m [ k ] ; } } ;
7+ }
8+ Object . defineProperty ( o , k2 , desc ) ;
9+ } ) : ( function ( o , m , k , k2 ) {
10+ if ( k2 === undefined ) k2 = k ;
11+ o [ k2 ] = m [ k ] ;
12+ } ) ) ;
13+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
14+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
15+ } ) : function ( o , v ) {
16+ o [ "default" ] = v ;
17+ } ) ;
18+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
19+ if ( mod && mod . __esModule ) return mod ;
20+ var result = { } ;
21+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . prototype . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
22+ __setModuleDefault ( result , mod ) ;
23+ return result ;
24+ } ;
225var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
326 function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
427 return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
@@ -14,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1437Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1538exports . ValidatorFactory = void 0 ;
1639const actionparameters_1 = require ( "../actionparameters" ) ;
40+ const core = __importStar ( require ( "@actions/core" ) ) ;
1741const AzureResourceFilterUtility_1 = require ( "azure-actions-appservice-rest/Utilities/AzureResourceFilterUtility" ) ;
1842const BaseWebAppDeploymentProvider_1 = require ( "../DeploymentProvider/Providers/BaseWebAppDeploymentProvider" ) ;
1943const PublishProfileWebAppValidator_1 = require ( "./ActionValidators/PublishProfileWebAppValidator" ) ;
@@ -25,37 +49,49 @@ const SpnWindowsWebAppValidator_1 = require("./ActionValidators/SpnWindowsWebApp
2549const Validations_1 = require ( "./Validations" ) ;
2650const PublishProfile_1 = require ( "../Utilities/PublishProfile" ) ;
2751const RuntimeConstants_1 = __importDefault ( require ( "../RuntimeConstants" ) ) ;
52+ const SpnWebAppSiteContainersValidator_1 = require ( "./ActionValidators/SpnWebAppSiteContainersValidator" ) ;
2853class ValidatorFactory {
2954 static getValidator ( type ) {
3055 return __awaiter ( this , void 0 , void 0 , function * ( ) {
3156 let actionParams = actionparameters_1 . ActionParameters . getActionParams ( ) ;
3257 if ( type === BaseWebAppDeploymentProvider_1 . DEPLOYMENT_PROVIDER_TYPES . PUBLISHPROFILE ) {
33- if ( ! ! actionParams . images ) {
58+ if ( ! ! actionParams . blessedAppSitecontainers || ! ! actionParams . siteContainers ) {
59+ throw new Error ( "publish-profile is not supported for Site Containers scenario" ) ;
60+ }
61+ else if ( ! ! actionParams . images ) {
3462 yield this . setResourceDetails ( actionParams ) ;
35- return new PublishProfileContainerWebAppValidator_1 . PublishProfileContainerWebAppValidator ( ) ;
63+ return [ new PublishProfileContainerWebAppValidator_1 . PublishProfileContainerWebAppValidator ( ) ] ;
3664 }
3765 else {
38- return new PublishProfileWebAppValidator_1 . PublishProfileWebAppValidator ( ) ;
66+ return [ new PublishProfileWebAppValidator_1 . PublishProfileWebAppValidator ( ) ] ;
3967 }
4068 }
4169 else if ( type == BaseWebAppDeploymentProvider_1 . DEPLOYMENT_PROVIDER_TYPES . SPN ) {
4270 // app-name is required to get resource details
4371 ( 0 , Validations_1 . appNameIsRequired ) ( actionParams . appName ) ;
4472 yield this . getResourceDetails ( actionParams ) ;
4573 if ( ! ! actionParams . isLinux ) {
46- if ( ! ! actionParams . images || ! ! actionParams . multiContainerConfigFile ) {
47- return new SpnLinuxContainerWebAppValidator_1 . SpnLinuxContainerWebAppValidator ( ) ;
74+ if ( ! ! actionParams . blessedAppSitecontainers ) {
75+ core . info ( "Validating site containers app details" ) ;
76+ return [ new SpnWebAppSiteContainersValidator_1 . SpnWebAppSiteContainersValidator ( ) , new SpnLinuxWebAppValidator_1 . SpnLinuxWebAppValidator ( ) ] ;
77+ }
78+ else if ( ! ! actionParams . siteContainers ) {
79+ core . info ( "Validating site containers app details" ) ;
80+ return [ new SpnWebAppSiteContainersValidator_1 . SpnWebAppSiteContainersValidator ( ) ] ;
81+ }
82+ else if ( ! ! actionParams . images || ! ! actionParams . multiContainerConfigFile ) {
83+ return [ new SpnLinuxContainerWebAppValidator_1 . SpnLinuxContainerWebAppValidator ( ) ] ;
4884 }
4985 else {
50- return new SpnLinuxWebAppValidator_1 . SpnLinuxWebAppValidator ( ) ;
86+ return [ new SpnLinuxWebAppValidator_1 . SpnLinuxWebAppValidator ( ) ] ;
5187 }
5288 }
5389 else {
5490 if ( ! ! actionParams . images ) {
55- return new SpnWindowsContainerWebAppValidator_1 . SpnWindowsContainerWebAppValidator ( ) ;
91+ return [ new SpnWindowsContainerWebAppValidator_1 . SpnWindowsContainerWebAppValidator ( ) ] ;
5692 }
5793 else {
58- return new SpnWindowsWebAppValidator_1 . SpnWindowsWebAppValidator ( ) ;
94+ return [ new SpnWindowsWebAppValidator_1 . SpnWindowsWebAppValidator ( ) ] ;
5995 }
6096 }
6197 }
0 commit comments