azure-pipelines-tasks-webdeployment-common 4.222.0 → 4.222.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"loc.messages.FailedToApplyTransformationReason1": "1. Whether the Transformation is already applied for the MSBuild generated package during build. If yes, remove the <DependentUpon> tag for each config in the csproj file and rebuild. ",
|
|
15
15
|
"loc.messages.FailedToApplyTransformationReason2": "2. Ensure that the config file and transformation files are present in the same folder inside the package.",
|
|
16
16
|
"loc.messages.FailedToApplyXMLvariablesubstitutionReason1": "Failed to apply XML variable substitution. Changes are already present in the package.",
|
|
17
|
-
"loc.messages.MissingArgumentsforXMLTransformation": "Incomplete or missing arguments. Expected format -transform <transform file> -xml <source file> -result <
|
|
17
|
+
"loc.messages.MissingArgumentsforXMLTransformation": "Incomplete or missing arguments. Expected format -transform <transform file> -xml <source file> -result <destination file>. Transformation and source file are mandatory inputs.",
|
|
18
18
|
"loc.messages.MorethanonepackagematchedwithspecifiedpatternPleaserestrainthesearchpattern": "More than one package matched with specified pattern: %s. Please restrain the search pattern.",
|
|
19
19
|
"loc.messages.JSONvariableSubstitution": "Applying JSON variable substitution for %s",
|
|
20
20
|
"loc.messages.SubstitutingValueonKey": "Substituting value on key: %s",
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { PackageType } from './packageUtility';
|
|
1
2
|
export declare function fileTransformations(isFolderBasedDeployment: boolean, JSONFiles: any, xmlTransformation: boolean, xmlVariableSubstitution: boolean, folderPath: string, isMSBuildPackage: boolean): void;
|
|
2
3
|
export declare function advancedFileTransformations(isFolderBasedDeployment: boolean, targetFiles: any, xmlTransformation: boolean, variableSubstitutionFileFormat: string, folderPath: string, transformationRules: any): void;
|
|
3
4
|
export declare function enhancedFileTransformations(isFolderBasedDeployment: boolean, xmlTransformation: boolean, folderPath: string, transformationRules: any, xmlTargetFiles: any, jsonTargetFiles: any): void;
|
|
5
|
+
/** Generate web config file from parameters object, add it to temp directory that is archived afterwards and returned as a package */
|
|
6
|
+
export declare function applyTransformations(webPackage: string, parameters: string, packageType: PackageType): Promise<string>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enhancedFileTransformations = exports.advancedFileTransformations = exports.fileTransformations = void 0;
|
|
12
|
+
exports.applyTransformations = exports.enhancedFileTransformations = exports.advancedFileTransformations = exports.fileTransformations = void 0;
|
|
4
13
|
const tl = require("azure-pipelines-task-lib/task");
|
|
5
14
|
const ParameterParser = require("./ParameterParserUtility");
|
|
15
|
+
const ParameterParserUtility_1 = require("./ParameterParserUtility");
|
|
16
|
+
var deployUtility = require('./utility.js');
|
|
17
|
+
var generateWebConfigUtil = require('./webconfigutil.js');
|
|
6
18
|
var jsonSubstitutionUtility = require('azure-pipelines-tasks-webdeployment-common/jsonvariablesubstitutionutility.js');
|
|
7
19
|
var xmlSubstitutionUtility = require('azure-pipelines-tasks-webdeployment-common/xmlvariablesubstitutionutility.js');
|
|
8
20
|
var xdtTransformationUtility = require('azure-pipelines-tasks-webdeployment-common/xdttransformationutility.js');
|
|
@@ -153,3 +165,26 @@ function enhancedFileTransformations(isFolderBasedDeployment, xmlTransformation,
|
|
|
153
165
|
}
|
|
154
166
|
}
|
|
155
167
|
exports.enhancedFileTransformations = enhancedFileTransformations;
|
|
168
|
+
/** Generate web config file from parameters object, add it to temp directory that is archived afterwards and returned as a package */
|
|
169
|
+
function applyTransformations(webPackage, parameters, packageType) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
tl.debug("WebConfigParameters is " + parameters);
|
|
172
|
+
if (parameters) {
|
|
173
|
+
const isFolderBasedDeployment = tl.stats(webPackage).isDirectory();
|
|
174
|
+
const folderPath = yield deployUtility.generateTemporaryFolderForDeployment(isFolderBasedDeployment, webPackage, packageType);
|
|
175
|
+
if (parameters) {
|
|
176
|
+
tl.debug('parsing web.config parameters');
|
|
177
|
+
const webConfigParameters = ParameterParserUtility_1.parse(parameters);
|
|
178
|
+
const rootDirectoryPath = "D:\\home\\site\\wwwroot";
|
|
179
|
+
generateWebConfigUtil.addWebConfigFile(folderPath, webConfigParameters, rootDirectoryPath);
|
|
180
|
+
}
|
|
181
|
+
const output = yield deployUtility.archiveFolderForDeployment(isFolderBasedDeployment, folderPath);
|
|
182
|
+
webPackage = output.webDeployPkg;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
tl.debug('File Tranformation not enabled');
|
|
186
|
+
}
|
|
187
|
+
return webPackage;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
exports.applyTransformations = applyTransformations;
|
package/module.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"FailedToApplyTransformationReason1": "1. Whether the Transformation is already applied for the MSBuild generated package during build. If yes, remove the <DependentUpon> tag for each config in the csproj file and rebuild. ",
|
|
16
16
|
"FailedToApplyTransformationReason2": "2. Ensure that the config file and transformation files are present in the same folder inside the package.",
|
|
17
17
|
"FailedToApplyXMLvariablesubstitutionReason1": "Failed to apply XML variable substitution. Changes are already present in the package.",
|
|
18
|
-
"MissingArgumentsforXMLTransformation": "Incomplete or missing arguments. Expected format -transform <transform file> -xml <source file> -result <
|
|
18
|
+
"MissingArgumentsforXMLTransformation": "Incomplete or missing arguments. Expected format -transform <transform file> -xml <source file> -result <destination file>. Transformation and source file are mandatory inputs.",
|
|
19
19
|
"MorethanonepackagematchedwithspecifiedpatternPleaserestrainthesearchpattern": "More than one package matched with specified pattern: %s. Please restrain the search pattern.",
|
|
20
20
|
"JSONvariableSubstitution" : "Applying JSON variable substitution for %s",
|
|
21
21
|
"SubstitutingValueonKey" : "Substituting value on key: %s",
|