azure-pipelines-tasks-webdeployment-common 4.222.1 → 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.
|
@@ -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;
|