Updated node version to 20 as node 16 is deprecated (#408)
* Updated node version to 20. Updated version of dependencies for compat. * lib changes after `npm install` --------- Co-authored-by: Shilpi Rachna <shilpir@microsoft.com>
This commit is contained in:
Родитель
71170cb4a9
Коммит
1700df8c95
|
@ -48,5 +48,5 @@ branding:
|
|||
icon: 'webapp.svg'
|
||||
color: 'blue'
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node20'
|
||||
main: 'lib/main.js'
|
||||
|
|
|
@ -9,17 +9,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PublishProfileContainerWebAppValidator = void 0;
|
||||
const Validations_1 = require("../Validations");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
class PublishProfileContainerWebAppValidator {
|
||||
validate() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
Validations_1.packageNotAllowed(actionParams.packageInput);
|
||||
Validations_1.multiContainerNotAllowed(actionParams.multiContainerConfigFile);
|
||||
Validations_1.startupCommandNotAllowed(actionParams.startupCommand);
|
||||
Validations_1.validateAppDetails();
|
||||
Validations_1.validateSingleContainerInputs();
|
||||
(0, Validations_1.packageNotAllowed)(actionParams.packageInput);
|
||||
(0, Validations_1.multiContainerNotAllowed)(actionParams.multiContainerConfigFile);
|
||||
(0, Validations_1.startupCommandNotAllowed)(actionParams.startupCommand);
|
||||
(0, Validations_1.validateAppDetails)();
|
||||
(0, Validations_1.validateSingleContainerInputs)();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,16 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PublishProfileWebAppValidator = void 0;
|
||||
const Validations_1 = require("../Validations");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
class PublishProfileWebAppValidator {
|
||||
validate() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
Validations_1.containerInputsNotAllowed(actionParams.images, actionParams.multiContainerConfigFile, true);
|
||||
Validations_1.validateAppDetails();
|
||||
Validations_1.startupCommandNotAllowed(actionParams.startupCommand);
|
||||
yield Validations_1.validatePackageInput();
|
||||
(0, Validations_1.containerInputsNotAllowed)(actionParams.images, actionParams.multiContainerConfigFile, true);
|
||||
(0, Validations_1.validateAppDetails)();
|
||||
(0, Validations_1.startupCommandNotAllowed)(actionParams.startupCommand);
|
||||
yield (0, Validations_1.validatePackageInput)();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SpnLinuxContainerWebAppValidator = void 0;
|
||||
const Validations_1 = require("../Validations");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
class SpnLinuxContainerWebAppValidator {
|
||||
validate() {
|
||||
let actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
Validations_1.packageNotAllowed(actionParams.packageInput);
|
||||
Validations_1.validateContainerInputs();
|
||||
(0, Validations_1.packageNotAllowed)(actionParams.packageInput);
|
||||
(0, Validations_1.validateContainerInputs)();
|
||||
}
|
||||
}
|
||||
exports.SpnLinuxContainerWebAppValidator = SpnLinuxContainerWebAppValidator;
|
||||
|
|
|
@ -9,14 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SpnLinuxWebAppValidator = void 0;
|
||||
const Validations_1 = require("../Validations");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
class SpnLinuxWebAppValidator {
|
||||
validate() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
Validations_1.containerInputsNotAllowed(actionParams.images, actionParams.multiContainerConfigFile);
|
||||
yield Validations_1.validatePackageInput();
|
||||
(0, Validations_1.containerInputsNotAllowed)(actionParams.images, actionParams.multiContainerConfigFile);
|
||||
yield (0, Validations_1.validatePackageInput)();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SpnWindowsContainerWebAppValidator = void 0;
|
||||
const Validations_1 = require("../Validations");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
class SpnWindowsContainerWebAppValidator {
|
||||
validate() {
|
||||
let actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
Validations_1.packageNotAllowed(actionParams.packageInput);
|
||||
Validations_1.startupCommandNotAllowed(actionParams.startupCommand);
|
||||
Validations_1.multiContainerNotAllowed(actionParams.multiContainerConfigFile);
|
||||
Validations_1.validateContainerInputs();
|
||||
(0, Validations_1.packageNotAllowed)(actionParams.packageInput);
|
||||
(0, Validations_1.startupCommandNotAllowed)(actionParams.startupCommand);
|
||||
(0, Validations_1.multiContainerNotAllowed)(actionParams.multiContainerConfigFile);
|
||||
(0, Validations_1.validateContainerInputs)();
|
||||
}
|
||||
}
|
||||
exports.SpnWindowsContainerWebAppValidator = SpnWindowsContainerWebAppValidator;
|
||||
|
|
|
@ -9,15 +9,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SpnWindowsWebAppValidator = void 0;
|
||||
const Validations_1 = require("../Validations");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
class SpnWindowsWebAppValidator {
|
||||
validate() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
Validations_1.containerInputsNotAllowed(actionParams.images, actionParams.multiContainerConfigFile);
|
||||
Validations_1.startupCommandNotAllowed(actionParams.startupCommand);
|
||||
yield Validations_1.validatePackageInput();
|
||||
(0, Validations_1.containerInputsNotAllowed)(actionParams.images, actionParams.multiContainerConfigFile);
|
||||
(0, Validations_1.startupCommandNotAllowed)(actionParams.startupCommand);
|
||||
yield (0, Validations_1.validatePackageInput)();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,27 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -8,14 +31,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.validatePackageInput = exports.validateContainerInputs = exports.validateSingleContainerInputs = exports.multiContainerNotAllowed = exports.packageNotAllowed = exports.startupCommandNotAllowed = exports.validateAppDetails = exports.containerInputsNotAllowed = exports.appNameIsRequired = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const packageUtility_1 = require("azure-actions-utility/packageUtility");
|
||||
const PublishProfile_1 = require("../Utilities/PublishProfile");
|
||||
|
@ -83,7 +100,7 @@ exports.validateSingleContainerInputs = validateSingleContainerInputs;
|
|||
function validateContainerInputs() {
|
||||
let actionParams = actionparameters_1.ActionParameters.getActionParams();
|
||||
actionParams.isMultiContainer = false;
|
||||
if (!!actionParams.multiContainerConfigFile && packageUtility_1.exist(actionParams.multiContainerConfigFile)) {
|
||||
if (!!actionParams.multiContainerConfigFile && (0, packageUtility_1.exist)(actionParams.multiContainerConfigFile)) {
|
||||
let stats = fs.statSync(actionParams.multiContainerConfigFile);
|
||||
if (!stats.isFile()) {
|
||||
throw new Error("Docker-compose file path is incorrect.");
|
||||
|
|
|
@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ValidatorFactory = void 0;
|
||||
const actionparameters_1 = require("../actionparameters");
|
||||
const AzureResourceFilterUtility_1 = require("azure-actions-appservice-rest/Utilities/AzureResourceFilterUtility");
|
||||
const BaseWebAppDeploymentProvider_1 = require("../DeploymentProvider/Providers/BaseWebAppDeploymentProvider");
|
||||
|
@ -39,7 +40,7 @@ class ValidatorFactory {
|
|||
}
|
||||
else if (type == BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.SPN) {
|
||||
// app-name is required to get resource details
|
||||
Validations_1.appNameIsRequired(actionParams.appName);
|
||||
(0, Validations_1.appNameIsRequired)(actionParams.appName);
|
||||
yield this.getResourceDetails(actionParams);
|
||||
if (!!actionParams.isLinux) {
|
||||
if (!!actionParams.images || !!actionParams.multiContainerConfigFile) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DeploymentProviderFactory = void 0;
|
||||
const actionparameters_1 = require("../actionparameters");
|
||||
const BaseWebAppDeploymentProvider_1 = require("./Providers/BaseWebAppDeploymentProvider");
|
||||
const WebAppContainerDeployment_1 = require("./Providers/WebAppContainerDeployment");
|
||||
|
|
|
@ -1,4 +1,27 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -8,14 +31,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DEPLOYMENT_PROVIDER_TYPES = exports.BaseWebAppDeploymentProvider = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const PublishProfile_1 = require("../../Utilities/PublishProfile");
|
||||
const actionparameters_1 = require("../../actionparameters");
|
||||
|
@ -45,7 +62,7 @@ class BaseWebAppDeploymentProvider {
|
|||
UpdateDeploymentStatus(isDeploymentSuccess) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!!this.appService) {
|
||||
yield AnnotationUtility_1.addAnnotation(this.actionParams.endpoint, this.appService, isDeploymentSuccess);
|
||||
yield (0, AnnotationUtility_1.addAnnotation)(this.actionParams.endpoint, this.appService, isDeploymentSuccess);
|
||||
}
|
||||
this.activeDeploymentID = yield this.kuduServiceUtility.updateDeploymentStatus(isDeploymentSuccess, null, { 'type': 'Deployment', slotName: this.actionParams.slotName });
|
||||
core.debug('Active DeploymentId :' + this.activeDeploymentID);
|
||||
|
@ -79,4 +96,4 @@ var DEPLOYMENT_PROVIDER_TYPES;
|
|||
(function (DEPLOYMENT_PROVIDER_TYPES) {
|
||||
DEPLOYMENT_PROVIDER_TYPES[DEPLOYMENT_PROVIDER_TYPES["SPN"] = 0] = "SPN";
|
||||
DEPLOYMENT_PROVIDER_TYPES[DEPLOYMENT_PROVIDER_TYPES["PUBLISHPROFILE"] = 1] = "PUBLISHPROFILE";
|
||||
})(DEPLOYMENT_PROVIDER_TYPES = exports.DEPLOYMENT_PROVIDER_TYPES || (exports.DEPLOYMENT_PROVIDER_TYPES = {}));
|
||||
})(DEPLOYMENT_PROVIDER_TYPES || (exports.DEPLOYMENT_PROVIDER_TYPES = DEPLOYMENT_PROVIDER_TYPES = {}));
|
||||
|
|
|
@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PublishProfileWebAppContainerDeploymentProvider = void 0;
|
||||
const BaseWebAppDeploymentProvider_1 = require("./BaseWebAppDeploymentProvider");
|
||||
class PublishProfileWebAppContainerDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebAppDeploymentProvider {
|
||||
DeployWebAppStep() {
|
||||
|
|
|
@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WebAppContainerDeploymentProvider = void 0;
|
||||
const BaseWebAppDeploymentProvider_1 = require("./BaseWebAppDeploymentProvider");
|
||||
const ContainerDeploymentUtility_1 = require("azure-actions-appservice-rest/Utilities/ContainerDeploymentUtility");
|
||||
class WebAppContainerDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebAppDeploymentProvider {
|
||||
|
|
|
@ -1,4 +1,27 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -8,14 +31,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WebAppDeploymentProvider = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const utility = __importStar(require("azure-actions-utility/utility.js"));
|
||||
const zipUtility = __importStar(require("azure-actions-utility/ziputility.js"));
|
||||
|
@ -27,36 +44,41 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let appPackage = this.actionParams.package;
|
||||
let webPackage = appPackage.getPath();
|
||||
const validTypes = ["war", "jar", "ear", "zip", "static"];
|
||||
// kudu warm up
|
||||
yield this.kuduServiceUtility.warmpUp();
|
||||
let packageType = appPackage.getPackageType();
|
||||
switch (packageType) {
|
||||
case packageUtility_1.PackageType.war:
|
||||
core.debug("Initiated deployment via kudu service for webapp war package : " + webPackage);
|
||||
var warName = utility.getFileNameFromPath(webPackage, ".war");
|
||||
this.deploymentID = yield this.kuduServiceUtility.deployUsingWarDeploy(webPackage, { slotName: this.actionParams.slotName, commitMessage: this.actionParams.commitMessage }, warName);
|
||||
break;
|
||||
case packageUtility_1.PackageType.jar:
|
||||
core.debug("Initiated deployment via kudu service for webapp jar package : " + webPackage);
|
||||
let folderPath = yield utility.generateTemporaryFolderForDeployment(false, webPackage, packageUtility_1.PackageType.jar);
|
||||
let output = yield utility.archiveFolderForDeployment(false, folderPath);
|
||||
webPackage = output.webDeployPkg;
|
||||
this.deploymentID = yield this.kuduServiceUtility.deployUsingZipDeploy(webPackage, { slotName: this.actionParams.slotName, commitMessage: this.actionParams.commitMessage });
|
||||
break;
|
||||
case packageUtility_1.PackageType.folder:
|
||||
let tempPackagePath = utility.generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false);
|
||||
webPackage = (yield zipUtility.archiveFolder(webPackage, "", tempPackagePath));
|
||||
core.debug("Compressed folder into zip " + webPackage);
|
||||
core.debug("Initiated deployment via kudu service for webapp package : " + webPackage);
|
||||
this.deploymentID = yield this.kuduServiceUtility.deployUsingZipDeploy(webPackage, { slotName: this.actionParams.slotName, commitMessage: this.actionParams.commitMessage });
|
||||
break;
|
||||
case packageUtility_1.PackageType.zip:
|
||||
core.debug("Initiated deployment via kudu service for webapp package : " + webPackage);
|
||||
this.deploymentID = yield this.kuduServiceUtility.deployUsingZipDeploy(webPackage, { slotName: this.actionParams.slotName, commitMessage: this.actionParams.commitMessage });
|
||||
break;
|
||||
default:
|
||||
throw new Error('Invalid App Service package or folder path provided: ' + webPackage);
|
||||
// If provided, type paramater takes precidence over file package type
|
||||
if (this.actionParams.type != null && validTypes.includes(this.actionParams.type.toLowerCase())) {
|
||||
core.debug("Initiated deployment via kudu service for webapp" + this.actionParams.type + "package : " + webPackage);
|
||||
}
|
||||
else {
|
||||
// Retains the old behavior of determining the package type from the file extension if valid type is not defined
|
||||
let packageType = appPackage.getPackageType();
|
||||
switch (packageType) {
|
||||
case packageUtility_1.PackageType.war:
|
||||
core.debug("Initiated deployment via kudu service for webapp war package : " + webPackage);
|
||||
this.actionParams.type = "war";
|
||||
break;
|
||||
case packageUtility_1.PackageType.jar:
|
||||
core.debug("Initiated deployment via kudu service for webapp jar package : " + webPackage);
|
||||
this.actionParams.type = "jar";
|
||||
break;
|
||||
case packageUtility_1.PackageType.folder:
|
||||
let tempPackagePath = utility.generateTemporaryFolderOrZipPath(`${process.env.RUNNER_TEMP}`, false);
|
||||
webPackage = (yield zipUtility.archiveFolder(webPackage, "", tempPackagePath));
|
||||
core.debug("Compressed folder into zip " + webPackage);
|
||||
core.debug("Initiated deployment via kudu service for webapp package : " + webPackage);
|
||||
this.actionParams.type = "zip";
|
||||
break;
|
||||
case packageUtility_1.PackageType.zip:
|
||||
core.debug("Initiated deployment via kudu service for webapp zip package : " + webPackage);
|
||||
this.actionParams.type = "zip";
|
||||
break;
|
||||
default:
|
||||
throw new Error('Invalid App Service package: ' + webPackage + ' or type provided: ' + this.actionParams.type);
|
||||
}
|
||||
}
|
||||
this.deploymentID = yield this.kuduServiceUtility.deployUsingOneDeploy(webPackage, { slotName: this.actionParams.slotName, commitMessage: this.actionParams.commitMessage }, this.actionParams.targetPath, this.actionParams.type, this.actionParams.clean, this.actionParams.restart);
|
||||
// updating startup command
|
||||
if (!!this.actionParams.startupCommand) {
|
||||
yield this.updateStartupCommand();
|
||||
|
@ -79,7 +101,7 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
|
|||
UpdateDeploymentStatus(isDeploymentSuccess) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!!this.appService) {
|
||||
yield AnnotationUtility_1.addAnnotation(this.actionParams.endpoint, this.appService, isDeploymentSuccess);
|
||||
yield (0, AnnotationUtility_1.addAnnotation)(this.actionParams.endpoint, this.appService, isDeploymentSuccess);
|
||||
}
|
||||
console.log('App Service Application URL: ' + this.applicationURL);
|
||||
core.setOutput('webapp-url', this.applicationURL);
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class RuntimeConstants {
|
||||
}
|
||||
exports.default = RuntimeConstants;
|
||||
RuntimeConstants.system = "system";
|
||||
RuntimeConstants.osName = "os_name";
|
||||
RuntimeConstants.Windows = "Windows";
|
||||
RuntimeConstants.Unix = "Unix";
|
||||
exports.default = RuntimeConstants;
|
||||
|
|
|
@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PublishProfile = void 0;
|
||||
var core = require("@actions/core");
|
||||
const actions_secret_parser_1 = require("actions-secret-parser");
|
||||
const azure_app_kudu_service_1 = require("azure-actions-appservice-rest/Kudu/azure-app-kudu-service");
|
||||
|
|
|
@ -1,12 +1,29 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionParameters = exports.appKindMap = exports.WebAppKind = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const github = require('@actions/github');
|
||||
var WebAppKind;
|
||||
|
@ -15,7 +32,7 @@ var WebAppKind;
|
|||
WebAppKind[WebAppKind["Linux"] = 1] = "Linux";
|
||||
WebAppKind[WebAppKind["WindowsContainer"] = 2] = "WindowsContainer";
|
||||
WebAppKind[WebAppKind["LinuxContainer"] = 3] = "LinuxContainer";
|
||||
})(WebAppKind = exports.WebAppKind || (exports.WebAppKind = {}));
|
||||
})(WebAppKind || (exports.WebAppKind = WebAppKind = {}));
|
||||
;
|
||||
exports.appKindMap = new Map([
|
||||
['app', WebAppKind.Windows],
|
||||
|
@ -39,6 +56,11 @@ class ActionParameters {
|
|||
*/
|
||||
this._commitMessage = github.context.eventName === 'push' ? github.context.payload.head_commit.message.slice(0, 1000) : "";
|
||||
this._endpoint = endpoint;
|
||||
// Used only for OneDeploy
|
||||
this._type = core.getInput('type');
|
||||
this._targetPath = core.getInput('target-path');
|
||||
this._clean = core.getInput('clean');
|
||||
this._restart = core.getInput('restart');
|
||||
}
|
||||
static getActionParams(endpoint) {
|
||||
if (!this.actionparams) {
|
||||
|
@ -112,5 +134,20 @@ class ActionParameters {
|
|||
get multiContainerConfigFile() {
|
||||
return this._multiContainerConfigFile;
|
||||
}
|
||||
get type() {
|
||||
return this._type;
|
||||
}
|
||||
set type(type) {
|
||||
this._type = type;
|
||||
}
|
||||
get targetPath() {
|
||||
return this._targetPath;
|
||||
}
|
||||
get clean() {
|
||||
return this._clean;
|
||||
}
|
||||
get restart() {
|
||||
return this._restart;
|
||||
}
|
||||
}
|
||||
exports.ActionParameters = ActionParameters;
|
||||
|
|
31
lib/main.js
31
lib/main.js
|
@ -1,4 +1,27 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -8,14 +31,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.main = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const crypto = __importStar(require("crypto"));
|
||||
const actionparameters_1 = require("./actionparameters");
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
12
package.json
12
package.json
|
@ -23,12 +23,12 @@
|
|||
},
|
||||
"homepage": "https://github.com/Azure/webapps-deploy#readme",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.1.4",
|
||||
"@types/node": "^13.1.7",
|
||||
"jest": "^25.1.0",
|
||||
"ts-jest": "^25.2.1",
|
||||
"ts-node": "^8.8.1",
|
||||
"typescript": "^3.7.4"
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^20.12.2",
|
||||
"jest": "29.7.0",
|
||||
"ts-jest": "29.1.2",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
|
|
Загрузка…
Ссылка в новой задаче