-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Trim commit message (#301) Co-authored-by: Akshay Kumar <kumaraksh@DESKTOP-ARQ1NM6.localdomain> * Container Registry changed (#299) * Update pr_check_windows_container_pubprofile.yml * Moved the entries to secrets * Update pr_check_windows_container_pubprofile.yml * Update pr_check_windows_container_pubprofile.yml * update azure-actions-appservice-rest version (#295) * Added node modules and package-lock * Update pr_check_windows_container_pubprofile.yml * Update pr_check_windows_container_pubprofile.yml * Update pr_check_windows_container_pubprofile.yml * Update pr_check_windows_container_pubprofile.yml * Update pr_check_windows_container_pubprofile.yml * Update PR gate workflow file * Enhance deployment error in case of 403 (#305) * Enhance deployment error in case of 403 * Update aka.ms link --------- Co-authored-by: Akshay Kumar <kumaraksh@DESKTOP-ARQ1NM6.localdomain> * Release V2.2.7 * Adding lib folder --------- Co-authored-by: kumaraksh1 <112485097+kumaraksh1@users.noreply.github.com> Co-authored-by: Akshay Kumar <kumaraksh@DESKTOP-ARQ1NM6.localdomain>
- Loading branch information
1 parent
43cec19
commit 4ed4d42
Showing
332 changed files
with
32,714 additions
and
1,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,77 @@ | ||
"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 crypto = __importStar(require("crypto")); | ||
const actionparameters_1 = require("./actionparameters"); | ||
const AuthorizerFactory_1 = require("azure-actions-webclient/AuthorizerFactory"); | ||
const BaseWebAppDeploymentProvider_1 = require("./DeploymentProvider/Providers/BaseWebAppDeploymentProvider"); | ||
const DeploymentProviderFactory_1 = require("./DeploymentProvider/DeploymentProviderFactory"); | ||
const ValidatorFactory_1 = require("./ActionInputValidator/ValidatorFactory"); | ||
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : ""; | ||
function main() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let isDeploymentSuccess = true; | ||
try { | ||
// Set user agent variable | ||
let usrAgentRepo = crypto.createHash('sha256').update(`${process.env.GITHUB_REPOSITORY}`).digest('hex'); | ||
let actionName = 'DeployWebAppToAzure'; | ||
let userAgentString = (!!prefix ? `${prefix}+` : '') + `GITHUBACTIONS_${actionName}_${usrAgentRepo}`; | ||
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentString); | ||
// Initialize action inputs | ||
let endpoint = !!core.getInput('publish-profile') ? null : yield AuthorizerFactory_1.AuthorizerFactory.getAuthorizer(); | ||
actionparameters_1.ActionParameters.getActionParams(endpoint); | ||
let type = null; | ||
if (!!endpoint) { | ||
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.SPN; | ||
} | ||
else { | ||
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.PUBLISHPROFILE; | ||
} | ||
// Validate action inputs | ||
let validator = yield ValidatorFactory_1.ValidatorFactory.getValidator(type); | ||
yield validator.validate(); | ||
var deploymentProvider = DeploymentProviderFactory_1.DeploymentProviderFactory.getDeploymentProvider(type); | ||
core.debug("Predeployment Step Started"); | ||
yield deploymentProvider.PreDeploymentStep(); | ||
core.debug("Deployment Step Started"); | ||
yield deploymentProvider.DeployWebAppStep(); | ||
} | ||
catch (error) { | ||
isDeploymentSuccess = false; | ||
core.setFailed("Deployment Failed with Error: " + error); | ||
} | ||
finally { | ||
if (deploymentProvider != null) { | ||
yield deploymentProvider.UpdateDeploymentStatus(isDeploymentSuccess); | ||
} | ||
// Reset AZURE_HTTP_USER_AGENT | ||
core.exportVariable('AZURE_HTTP_USER_AGENT', prefix); | ||
core.debug(isDeploymentSuccess ? "Deployment Succeeded" : "Deployment failed"); | ||
} | ||
}); | ||
} | ||
exports.main = main; | ||
main(); | ||
"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 crypto = __importStar(require("crypto")); | ||
const actionparameters_1 = require("./actionparameters"); | ||
const AuthorizerFactory_1 = require("azure-actions-webclient/AuthorizerFactory"); | ||
const BaseWebAppDeploymentProvider_1 = require("./DeploymentProvider/Providers/BaseWebAppDeploymentProvider"); | ||
const DeploymentProviderFactory_1 = require("./DeploymentProvider/DeploymentProviderFactory"); | ||
const ValidatorFactory_1 = require("./ActionInputValidator/ValidatorFactory"); | ||
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : ""; | ||
function main() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let isDeploymentSuccess = true; | ||
try { | ||
// Set user agent variable | ||
let usrAgentRepo = crypto.createHash('sha256').update(`${process.env.GITHUB_REPOSITORY}`).digest('hex'); | ||
let actionName = 'DeployWebAppToAzure'; | ||
let userAgentString = (!!prefix ? `${prefix}+` : '') + `GITHUBACTIONS_${actionName}_${usrAgentRepo}`; | ||
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentString); | ||
// Initialize action inputs | ||
let endpoint = !!core.getInput('publish-profile') ? null : yield AuthorizerFactory_1.AuthorizerFactory.getAuthorizer(); | ||
actionparameters_1.ActionParameters.getActionParams(endpoint); | ||
let type = null; | ||
if (!!endpoint) { | ||
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.SPN; | ||
} | ||
else { | ||
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.PUBLISHPROFILE; | ||
} | ||
// Validate action inputs | ||
let validator = yield ValidatorFactory_1.ValidatorFactory.getValidator(type); | ||
yield validator.validate(); | ||
var deploymentProvider = DeploymentProviderFactory_1.DeploymentProviderFactory.getDeploymentProvider(type); | ||
core.debug("Predeployment Step Started"); | ||
yield deploymentProvider.PreDeploymentStep(); | ||
core.debug("Deployment Step Started"); | ||
yield deploymentProvider.DeployWebAppStep(); | ||
} | ||
catch (error) { | ||
isDeploymentSuccess = false; | ||
if (error.statusCode == 403) { | ||
core.setFailed("The deployment to your web app failed with HTTP status code 403. \ | ||
Your web app may have networking features enabled which are blocking access (such as Private Endpoints).\ | ||
For more information, please follow https://aka.ms/forbidden-deployment-error"); | ||
} | ||
else { | ||
core.setFailed("Deployment Failed, " + error); | ||
} | ||
} | ||
finally { | ||
if (deploymentProvider != null) { | ||
yield deploymentProvider.UpdateDeploymentStatus(isDeploymentSuccess); | ||
} | ||
// Reset AZURE_HTTP_USER_AGENT | ||
core.exportVariable('AZURE_HTTP_USER_AGENT', prefix); | ||
core.debug(isDeploymentSuccess ? "Deployment Succeeded" : "Deployment failed"); | ||
} | ||
}); | ||
} | ||
exports.main = main; | ||
main(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.