Skip to content

Commit

Permalink
Remove windowsContainerAppNotAllowedForPublishProfile validator.
Browse files Browse the repository at this point in the history
  • Loading branch information
chunye committed Jun 22, 2021
1 parent 85c751e commit 03d63f7
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class PublishProfileContainerWebAppValidator {
return __awaiter(this, void 0, void 0, function* () {
const actionParams = actionparameters_1.ActionParameters.getActionParams();
Validations_1.packageNotAllowed(actionParams.packageInput);
yield Validations_1.windowsContainerAppNotAllowedForPublishProfile();
Validations_1.multiContainerNotAllowed(actionParams.multiContainerConfigFile);
Validations_1.startupCommandNotAllowed(actionParams.startupCommand);
Validations_1.validateAppDetails();
Expand Down
16 changes: 0 additions & 16 deletions lib/ActionInputValidator/Validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const packageUtility_1 = require("azure-actions-utility/packageUtility");
const PublishProfile_1 = require("../Utilities/PublishProfile");
const RuntimeConstants_1 = __importDefault(require("../RuntimeConstants"));
const actionparameters_1 = require("../actionparameters");
const fs = require("fs");
// Error is app-name is not provided
Expand Down Expand Up @@ -124,15 +120,3 @@ function validatePackageInput() {
});
}
exports.validatePackageInput = validatePackageInput;
// windows container app not allowed for publish profile auth scheme
function windowsContainerAppNotAllowedForPublishProfile() {
return __awaiter(this, void 0, void 0, function* () {
const actionParams = actionparameters_1.ActionParameters.getActionParams();
const publishProfile = PublishProfile_1.PublishProfile.getPublishProfile(actionParams.publishProfileContent);
const appOS = yield publishProfile.getAppOS();
if (appOS.includes(RuntimeConstants_1.default.Windows) || appOS.includes(RuntimeConstants_1.default.Windows.toLowerCase())) {
throw new Error("Publish profile auth scheme is not supported for Windows container Apps.");
}
});
}
exports.windowsContainerAppNotAllowedForPublishProfile = windowsContainerAppNotAllowedForPublishProfile;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"actions-secret-parser": "^1.0.3",
"azure-actions-appservice-rest": "^1.3.1",
"azure-actions-appservice-rest": "^1.3.3",
"azure-actions-utility": "^1.0.3",
"azure-actions-webclient": "^1.1.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { packageNotAllowed, windowsContainerAppNotAllowedForPublishProfile, multiContainerNotAllowed, startupCommandNotAllowed, validateSingleContainerInputs, validateAppDetails } from "../Validations";
import { packageNotAllowed, multiContainerNotAllowed, startupCommandNotAllowed, validateSingleContainerInputs, validateAppDetails } from "../Validations";
import { ActionParameters } from "../../actionparameters";
import { IValidator } from "./IValidator";

Expand All @@ -7,8 +7,6 @@ export class PublishProfileContainerWebAppValidator implements IValidator {
const actionParams: ActionParameters = ActionParameters.getActionParams();

packageNotAllowed(actionParams.packageInput);

await windowsContainerAppNotAllowedForPublishProfile();

multiContainerNotAllowed(actionParams.multiContainerConfigFile);

Expand Down
10 changes: 0 additions & 10 deletions src/ActionInputValidator/Validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,4 @@ export async function validatePackageInput() {
if(isMSBuildPackage) {
throw new Error(`Deployment of msBuild generated package is not supported. Please change package format.`);
}
}

// windows container app not allowed for publish profile auth scheme
export async function windowsContainerAppNotAllowedForPublishProfile() {
const actionParams = ActionParameters.getActionParams();
const publishProfile: PublishProfile = PublishProfile.getPublishProfile(actionParams.publishProfileContent);
const appOS: string = await publishProfile.getAppOS();
if (appOS.includes(RuntimeConstants.Windows) || appOS.includes(RuntimeConstants.Windows.toLowerCase())) {
throw new Error("Publish profile auth scheme is not supported for Windows container Apps.");
}
}

0 comments on commit 03d63f7

Please sign in to comment.