Skip to content

Commit

Permalink
added node_modules and package-lock.json (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
BALAGA-GAYATRI authored Jun 14, 2021
1 parent 9bd3ea4 commit 48f6584
Show file tree
Hide file tree
Showing 2,536 changed files with 72,364 additions and 91,893 deletions.
178 changes: 89 additions & 89 deletions lib/DeploymentProvider/Providers/WebAppDeploymentProvider.js
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
"use strict";
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) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
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 });
const core = __importStar(require("@actions/core"));
const utility = __importStar(require("azure-actions-utility/utility.js"));
const zipUtility = __importStar(require("azure-actions-utility/ziputility.js"));
const packageUtility_1 = require("azure-actions-utility/packageUtility");
const BaseWebAppDeploymentProvider_1 = require("./BaseWebAppDeploymentProvider");
const AnnotationUtility_1 = require("azure-actions-appservice-rest/Utilities/AnnotationUtility");
class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebAppDeploymentProvider {
DeployWebAppStep() {
return __awaiter(this, void 0, void 0, function* () {
let appPackage = this.actionParams.package;
let webPackage = appPackage.getPath();
// 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 }, 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 });
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 });
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 });
break;
default:
throw new Error('Invalid App Service package or folder path provided: ' + webPackage);
}
// updating startup command
if (!!this.actionParams.startupCommand) {
yield this.updateStartupCommand();
}
});
}
updateStartupCommand() {
return __awaiter(this, void 0, void 0, function* () {
let currentConfig = yield this.appService.getConfiguration();
let currentStartupCommand = currentConfig.properties.appCommandLine;
let newStartupCommand = this.actionParams.startupCommand;
if (currentStartupCommand != newStartupCommand) {
yield this.appServiceUtility.updateConfigurationSettings({ appCommandLine: newStartupCommand });
}
else {
core.debug(`Skipped updating appCommandLine. Current value is: ${currentStartupCommand}`);
}
});
}
UpdateDeploymentStatus(isDeploymentSuccess) {
return __awaiter(this, void 0, void 0, function* () {
if (!!this.appService) {
yield AnnotationUtility_1.addAnnotation(this.actionParams.endpoint, this.appService, isDeploymentSuccess);
}
console.log('App Service Application URL: ' + this.applicationURL);
core.setOutput('webapp-url', this.applicationURL);
});
}
}
exports.WebAppDeploymentProvider = WebAppDeploymentProvider;
"use strict";
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) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
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 });
const core = __importStar(require("@actions/core"));
const utility = __importStar(require("azure-actions-utility/utility.js"));
const zipUtility = __importStar(require("azure-actions-utility/ziputility.js"));
const packageUtility_1 = require("azure-actions-utility/packageUtility");
const BaseWebAppDeploymentProvider_1 = require("./BaseWebAppDeploymentProvider");
const AnnotationUtility_1 = require("azure-actions-appservice-rest/Utilities/AnnotationUtility");
class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebAppDeploymentProvider {
DeployWebAppStep() {
return __awaiter(this, void 0, void 0, function* () {
let appPackage = this.actionParams.package;
let webPackage = appPackage.getPath();
// 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);
}
// updating startup command
if (!!this.actionParams.startupCommand) {
yield this.updateStartupCommand();
}
});
}
updateStartupCommand() {
return __awaiter(this, void 0, void 0, function* () {
let currentConfig = yield this.appService.getConfiguration();
let currentStartupCommand = currentConfig.properties.appCommandLine;
let newStartupCommand = this.actionParams.startupCommand;
if (currentStartupCommand != newStartupCommand) {
yield this.appServiceUtility.updateConfigurationSettings({ appCommandLine: newStartupCommand });
}
else {
core.debug(`Skipped updating appCommandLine. Current value is: ${currentStartupCommand}`);
}
});
}
UpdateDeploymentStatus(isDeploymentSuccess) {
return __awaiter(this, void 0, void 0, function* () {
if (!!this.appService) {
yield AnnotationUtility_1.addAnnotation(this.actionParams.endpoint, this.appService, isDeploymentSuccess);
}
console.log('App Service Application URL: ' + this.applicationURL);
core.setOutput('webapp-url', this.applicationURL);
});
}
}
exports.WebAppDeploymentProvider = WebAppDeploymentProvider;
214 changes: 111 additions & 103 deletions lib/actionparameters.js
Original file line number Diff line number Diff line change
@@ -1,103 +1,111 @@
"use strict";
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 });
const core = __importStar(require("@actions/core"));
var WebAppKind;
(function (WebAppKind) {
WebAppKind[WebAppKind["Windows"] = 0] = "Windows";
WebAppKind[WebAppKind["Linux"] = 1] = "Linux";
WebAppKind[WebAppKind["WindowsContainer"] = 2] = "WindowsContainer";
WebAppKind[WebAppKind["LinuxContainer"] = 3] = "LinuxContainer";
})(WebAppKind = exports.WebAppKind || (exports.WebAppKind = {}));
;
exports.appKindMap = new Map([
['app', WebAppKind.Windows],
['app,linux', WebAppKind.Linux],
['app,container,windows', WebAppKind.WindowsContainer],
['app,linux,container', WebAppKind.LinuxContainer]
]);
class ActionParameters {
constructor(endpoint) {
this._publishProfileContent = core.getInput('publish-profile');
this._appName = core.getInput('app-name');
this._slotName = core.getInput('slot-name');
this._packageInput = core.getInput('package');
this._images = core.getInput('images');
this._multiContainerConfigFile = core.getInput('configuration-file');
this._startupCommand = core.getInput('startup-command');
this._endpoint = endpoint;
}
static getActionParams(endpoint) {
if (!this.actionparams) {
this.actionparams = new ActionParameters(!!endpoint ? endpoint : null);
}
return this.actionparams;
}
get appName() {
return this._appName;
}
get packageInput() {
return this._packageInput;
}
get package() {
return this._package;
}
set package(appPackage) {
this._package = appPackage;
}
get images() {
return this._images;
}
get resourceGroupName() {
return this._resourceGroupName;
}
set resourceGroupName(rg) {
this._resourceGroupName = rg;
}
get kind() {
return this._kind;
}
set kind(kind) {
this._kind = kind;
}
get realKind() {
return this._realKind;
}
set realKind(kind) {
this._realKind = kind;
}
get endpoint() {
return this._endpoint;
}
get publishProfileContent() {
return this._publishProfileContent;
}
get slotName() {
return this._slotName;
}
get isMultiContainer() {
return this._isMultiContainer;
}
set isMultiContainer(isMultiCont) {
this._isMultiContainer = isMultiCont;
}
get isLinux() {
return this._isLinux;
}
set isLinux(isLin) {
this._isLinux = isLin;
}
get startupCommand() {
return this._startupCommand;
}
get multiContainerConfigFile() {
return this._multiContainerConfigFile;
}
}
exports.ActionParameters = ActionParameters;
"use strict";
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 });
const core = __importStar(require("@actions/core"));
const github = require('@actions/github');
var WebAppKind;
(function (WebAppKind) {
WebAppKind[WebAppKind["Windows"] = 0] = "Windows";
WebAppKind[WebAppKind["Linux"] = 1] = "Linux";
WebAppKind[WebAppKind["WindowsContainer"] = 2] = "WindowsContainer";
WebAppKind[WebAppKind["LinuxContainer"] = 3] = "LinuxContainer";
})(WebAppKind = exports.WebAppKind || (exports.WebAppKind = {}));
;
exports.appKindMap = new Map([
['app', WebAppKind.Windows],
['app,linux', WebAppKind.Linux],
['app,container,windows', WebAppKind.WindowsContainer],
['app,linux,container', WebAppKind.LinuxContainer]
]);
class ActionParameters {
constructor(endpoint) {
this._publishProfileContent = core.getInput('publish-profile');
this._appName = core.getInput('app-name');
this._slotName = core.getInput('slot-name');
this._packageInput = core.getInput('package');
this._images = core.getInput('images');
this._multiContainerConfigFile = core.getInput('configuration-file');
this._startupCommand = core.getInput('startup-command');
this._commitMessage = github.context.eventName === 'push' ? github.context.payload.head_commit.message : "";
this._endpoint = endpoint;
}
static getActionParams(endpoint) {
if (!this.actionparams) {
this.actionparams = new ActionParameters(!!endpoint ? endpoint : null);
}
return this.actionparams;
}
get appName() {
return this._appName;
}
get commitMessage() {
return this._commitMessage;
}
set commitMessage(commitMessage) {
this._commitMessage = commitMessage;
}
get packageInput() {
return this._packageInput;
}
get package() {
return this._package;
}
set package(appPackage) {
this._package = appPackage;
}
get images() {
return this._images;
}
get resourceGroupName() {
return this._resourceGroupName;
}
set resourceGroupName(rg) {
this._resourceGroupName = rg;
}
get kind() {
return this._kind;
}
set kind(kind) {
this._kind = kind;
}
get realKind() {
return this._realKind;
}
set realKind(kind) {
this._realKind = kind;
}
get endpoint() {
return this._endpoint;
}
get publishProfileContent() {
return this._publishProfileContent;
}
get slotName() {
return this._slotName;
}
get isMultiContainer() {
return this._isMultiContainer;
}
set isMultiContainer(isMultiCont) {
this._isMultiContainer = isMultiCont;
}
get isLinux() {
return this._isLinux;
}
set isLinux(isLin) {
this._isLinux = isLin;
}
get startupCommand() {
return this._startupCommand;
}
get multiContainerConfigFile() {
return this._multiContainerConfigFile;
}
}
exports.ActionParameters = ActionParameters;
Loading

0 comments on commit 48f6584

Please sign in to comment.