Skip to content

Commit 63983db

Browse files
committed
prepare release 1.3.0
1 parent c87941d commit 63983db

File tree

4,344 files changed

+1429579
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,344 files changed

+1429579
-710
lines changed

lib/AzModuleInstaller.js

Lines changed: 197 additions & 180 deletions
Large diffs are not rendered by default.

lib/Constants.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
"use strict";
2-
Object.defineProperty(exports, "__esModule", { value: true });
3-
class Constants {
4-
}
5-
exports.default = Constants;
6-
Constants.prefix = "az_";
7-
Constants.moduleName = "Az";
8-
Constants.versionPattern = /[0-9]\.[0-9]\.[0-9]/;
9-
Constants.Success = "Success";
10-
Constants.Error = "Error";
11-
Constants.AzVersion = "AzVersion";
12-
Constants.versionExists = "versionExists";
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
class Constants {
4+
}
5+
exports.default = Constants;
6+
Constants.prefix = "az_";
7+
Constants.moduleName = "Az";
8+
Constants.versionPattern = /[0-9]\.[0-9]\.[0-9]/;
9+
Constants.Success = "Success";
10+
Constants.Error = "Error";
11+
Constants.AzVersion = "AzVersion";
12+
Constants.versionExists = "versionExists";

lib/InitializeAzure.js

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
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-
};
11-
var __importStar = (this && this.__importStar) || function (mod) {
12-
if (mod && mod.__esModule) return mod;
13-
var result = {};
14-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
15-
result["default"] = mod;
16-
return result;
17-
};
18-
var __importDefault = (this && this.__importDefault) || function (mod) {
19-
return (mod && mod.__esModule) ? mod : { "default": mod };
20-
};
21-
Object.defineProperty(exports, "__esModule", { value: true });
22-
const core = __importStar(require("@actions/core"));
23-
const Utils_1 = __importDefault(require("./Utilities/Utils"));
24-
const Constants_1 = __importDefault(require("./Constants"));
25-
class InitializeAzure {
26-
static importAzModule(azPSVersion) {
27-
return __awaiter(this, void 0, void 0, function* () {
28-
Utils_1.default.setPSModulePath();
29-
if (azPSVersion === "latest") {
30-
azPSVersion = yield Utils_1.default.getLatestModule(Constants_1.default.moduleName);
31-
}
32-
else {
33-
yield Utils_1.default.checkModuleVersion(Constants_1.default.moduleName, azPSVersion);
34-
}
35-
core.debug(`Az Module version used: ${azPSVersion}`);
36-
Utils_1.default.setPSModulePath(`${Constants_1.default.prefix}${azPSVersion}`);
37-
});
38-
}
39-
}
40-
exports.default = InitializeAzure;
1+
"use strict";
2+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3+
if (k2 === undefined) k2 = k;
4+
var desc = Object.getOwnPropertyDescriptor(m, k);
5+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6+
desc = { enumerable: true, get: function() { return m[k]; } };
7+
}
8+
Object.defineProperty(o, k2, desc);
9+
}) : (function(o, m, k, k2) {
10+
if (k2 === undefined) k2 = k;
11+
o[k2] = m[k];
12+
}));
13+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14+
Object.defineProperty(o, "default", { enumerable: true, value: v });
15+
}) : function(o, v) {
16+
o["default"] = v;
17+
});
18+
var __importStar = (this && this.__importStar) || function (mod) {
19+
if (mod && mod.__esModule) return mod;
20+
var result = {};
21+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22+
__setModuleDefault(result, mod);
23+
return result;
24+
};
25+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27+
return new (P || (P = Promise))(function (resolve, reject) {
28+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31+
step((generator = generator.apply(thisArg, _arguments || [])).next());
32+
});
33+
};
34+
var __importDefault = (this && this.__importDefault) || function (mod) {
35+
return (mod && mod.__esModule) ? mod : { "default": mod };
36+
};
37+
Object.defineProperty(exports, "__esModule", { value: true });
38+
const core = __importStar(require("@actions/core"));
39+
const Utils_1 = __importDefault(require("./Utilities/Utils"));
40+
const Constants_1 = __importDefault(require("./Constants"));
41+
class InitializeAzure {
42+
static importAzModule(azPSVersion) {
43+
return __awaiter(this, void 0, void 0, function* () {
44+
Utils_1.default.setPSModulePath();
45+
if (azPSVersion === "latest") {
46+
azPSVersion = yield Utils_1.default.getLatestModule(Constants_1.default.moduleName);
47+
}
48+
else {
49+
yield Utils_1.default.checkModuleVersion(Constants_1.default.moduleName, azPSVersion);
50+
}
51+
core.debug(`Az Module version used: ${azPSVersion}`);
52+
Utils_1.default.setPSModulePath(`${Constants_1.default.prefix}${azPSVersion}`);
53+
});
54+
}
55+
}
56+
exports.default = InitializeAzure;

lib/ScriptRunner.js

Lines changed: 86 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,86 @@
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-
};
11-
var __importStar = (this && this.__importStar) || function (mod) {
12-
if (mod && mod.__esModule) return mod;
13-
var result = {};
14-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
15-
result["default"] = mod;
16-
return result;
17-
};
18-
var __importDefault = (this && this.__importDefault) || function (mod) {
19-
return (mod && mod.__esModule) ? mod : { "default": mod };
20-
};
21-
Object.defineProperty(exports, "__esModule", { value: true });
22-
const core = __importStar(require("@actions/core"));
23-
const FileUtils_1 = __importDefault(require("./Utilities/FileUtils"));
24-
const PowerShellToolRunner_1 = __importDefault(require("./Utilities/PowerShellToolRunner"));
25-
const ScriptBuilder_1 = __importDefault(require("./Utilities/ScriptBuilder"));
26-
class ScriptRunner {
27-
constructor(inlineScript, errorActionPreference, failOnStandardErr) {
28-
this.inlineScript = inlineScript;
29-
this.errorActionPreference = errorActionPreference;
30-
this.failOnStandardErr = failOnStandardErr;
31-
}
32-
executeFile() {
33-
return __awaiter(this, void 0, void 0, function* () {
34-
const error = [];
35-
const options = {
36-
listeners: {
37-
stderr: (data) => {
38-
if (error.length < 10) {
39-
// Truncate to at most 1000 bytes
40-
if (data.length > 1000) {
41-
error.push(`${data.toString('utf8', 0, 1000)}<truncated>`);
42-
}
43-
else {
44-
error.push(data.toString('utf8'));
45-
}
46-
}
47-
else if (error.length === 10) {
48-
error.push('Additional writes to stderr truncated');
49-
}
50-
}
51-
}
52-
};
53-
const scriptToExecute = new ScriptBuilder_1.default().getInlineScriptFile(this.inlineScript, this.errorActionPreference);
54-
ScriptRunner.filePath = yield FileUtils_1.default.createScriptFile(scriptToExecute);
55-
core.debug(`script file to run: ${ScriptRunner.filePath}`);
56-
yield PowerShellToolRunner_1.default.init();
57-
const exitCode = yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(ScriptRunner.filePath, options);
58-
if (exitCode !== 0) {
59-
core.setOutput(`Azure PowerShell exited with code:`, exitCode.toString());
60-
if (this.failOnStandardErr) {
61-
error.forEach((err) => {
62-
core.error(err);
63-
});
64-
throw new Error(`Standard error stream contains one or more lines`);
65-
}
66-
}
67-
});
68-
}
69-
}
70-
exports.default = ScriptRunner;
1+
"use strict";
2+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3+
if (k2 === undefined) k2 = k;
4+
var desc = Object.getOwnPropertyDescriptor(m, k);
5+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6+
desc = { enumerable: true, get: function() { return m[k]; } };
7+
}
8+
Object.defineProperty(o, k2, desc);
9+
}) : (function(o, m, k, k2) {
10+
if (k2 === undefined) k2 = k;
11+
o[k2] = m[k];
12+
}));
13+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14+
Object.defineProperty(o, "default", { enumerable: true, value: v });
15+
}) : function(o, v) {
16+
o["default"] = v;
17+
});
18+
var __importStar = (this && this.__importStar) || function (mod) {
19+
if (mod && mod.__esModule) return mod;
20+
var result = {};
21+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22+
__setModuleDefault(result, mod);
23+
return result;
24+
};
25+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27+
return new (P || (P = Promise))(function (resolve, reject) {
28+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31+
step((generator = generator.apply(thisArg, _arguments || [])).next());
32+
});
33+
};
34+
var __importDefault = (this && this.__importDefault) || function (mod) {
35+
return (mod && mod.__esModule) ? mod : { "default": mod };
36+
};
37+
Object.defineProperty(exports, "__esModule", { value: true });
38+
const core = __importStar(require("@actions/core"));
39+
const FileUtils_1 = __importDefault(require("./Utilities/FileUtils"));
40+
const PowerShellToolRunner_1 = __importDefault(require("./Utilities/PowerShellToolRunner"));
41+
const ScriptBuilder_1 = __importDefault(require("./Utilities/ScriptBuilder"));
42+
class ScriptRunner {
43+
constructor(inlineScript, errorActionPreference, failOnStandardErr) {
44+
this.inlineScript = inlineScript;
45+
this.errorActionPreference = errorActionPreference;
46+
this.failOnStandardErr = failOnStandardErr;
47+
}
48+
executeFile() {
49+
return __awaiter(this, void 0, void 0, function* () {
50+
const error = [];
51+
const options = {
52+
listeners: {
53+
stderr: (data) => {
54+
if (error.length < 10) {
55+
// Truncate to at most 1000 bytes
56+
if (data.length > 1000) {
57+
error.push(`${data.toString('utf8', 0, 1000)}<truncated>`);
58+
}
59+
else {
60+
error.push(data.toString('utf8'));
61+
}
62+
}
63+
else if (error.length === 10) {
64+
error.push('Additional writes to stderr truncated');
65+
}
66+
}
67+
}
68+
};
69+
const scriptToExecute = new ScriptBuilder_1.default().getInlineScriptFile(this.inlineScript, this.errorActionPreference);
70+
ScriptRunner.filePath = yield FileUtils_1.default.createScriptFile(scriptToExecute);
71+
core.debug(`script file to run: ${ScriptRunner.filePath}`);
72+
yield PowerShellToolRunner_1.default.init();
73+
const exitCode = yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(ScriptRunner.filePath, options);
74+
if (exitCode !== 0) {
75+
core.setOutput(`Azure PowerShell exited with code:`, exitCode.toString());
76+
if (this.failOnStandardErr) {
77+
error.forEach((err) => {
78+
core.error(err);
79+
});
80+
throw new Error(`Standard error stream contains one or more lines`);
81+
}
82+
}
83+
});
84+
}
85+
}
86+
exports.default = ScriptRunner;

lib/Utilities/ArchiveTools.js

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
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-
};
11-
var __importDefault = (this && this.__importDefault) || function (mod) {
12-
return (mod && mod.__esModule) ? mod : { "default": mod };
13-
};
14-
Object.defineProperty(exports, "__esModule", { value: true });
15-
const core_1 = require("@actions/core");
16-
const exec_1 = require("@actions/exec");
17-
const io_1 = require("@actions/io");
18-
const PowerShellToolRunner_1 = __importDefault(require("./PowerShellToolRunner"));
19-
class ArchiveTools {
20-
constructor(use7Zip = false) {
21-
this.use7Zip = use7Zip;
22-
}
23-
unzip(zipPath, destination) {
24-
return __awaiter(this, void 0, void 0, function* () {
25-
if (this.use7Zip) {
26-
yield this.unzipUsing7Zip(zipPath, destination);
27-
}
28-
else {
29-
yield this.unzipUsingPowerShell(zipPath, destination);
30-
}
31-
});
32-
}
33-
unzipUsing7Zip(zipPath, destination) {
34-
return __awaiter(this, void 0, void 0, function* () {
35-
core_1.debug(`Using 7zip to extract ${zipPath} to ${destination}`);
36-
const path7Zip = yield io_1.which("7z.exe", true);
37-
const exitCode = yield exec_1.exec(`${path7Zip} x -o${destination} ${zipPath}`);
38-
if (exitCode != 0) {
39-
throw new Error(`Extraction using 7zip failed from ${zipPath} to ${destination}`);
40-
}
41-
});
42-
}
43-
unzipUsingPowerShell(zipPath, destination) {
44-
return __awaiter(this, void 0, void 0, function* () {
45-
core_1.debug(`Using powershell Expand-Archive cmdlet to extract ${zipPath} to ${destination}`);
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+
};
11+
var __importDefault = (this && this.__importDefault) || function (mod) {
12+
return (mod && mod.__esModule) ? mod : { "default": mod };
13+
};
14+
Object.defineProperty(exports, "__esModule", { value: true });
15+
exports.ArchiveTools = void 0;
16+
const core_1 = require("@actions/core");
17+
const exec_1 = require("@actions/exec");
18+
const io_1 = require("@actions/io");
19+
const PowerShellToolRunner_1 = __importDefault(require("./PowerShellToolRunner"));
20+
class ArchiveTools {
21+
constructor(use7Zip = false) {
22+
this.use7Zip = use7Zip;
23+
}
24+
unzip(zipPath, destination) {
25+
return __awaiter(this, void 0, void 0, function* () {
26+
if (this.use7Zip) {
27+
yield this.unzipUsing7Zip(zipPath, destination);
28+
}
29+
else {
30+
yield this.unzipUsingPowerShell(zipPath, destination);
31+
}
32+
});
33+
}
34+
unzipUsing7Zip(zipPath, destination) {
35+
return __awaiter(this, void 0, void 0, function* () {
36+
(0, core_1.debug)(`Using 7zip to extract ${zipPath} to ${destination}`);
37+
const path7Zip = yield (0, io_1.which)("7z.exe", true);
38+
const exitCode = yield (0, exec_1.exec)(`${path7Zip} x -o${destination} ${zipPath}`);
39+
if (exitCode != 0) {
40+
throw new Error(`Extraction using 7zip failed from ${zipPath} to ${destination}`);
41+
}
42+
});
43+
}
44+
unzipUsingPowerShell(zipPath, destination) {
45+
return __awaiter(this, void 0, void 0, function* () {
46+
(0, core_1.debug)(`Using powershell Expand-Archive cmdlet to extract ${zipPath} to ${destination}`);
4647
const script = `
4748
$prevProgressPref = $ProgressPreference
4849
$ProgressPreference = 'SilentlyContinue'
4950
Expand-Archive -Path ${zipPath} -DestinationPath ${destination}
50-
$ProgressPreference = $prevProgressPref`;
51-
yield PowerShellToolRunner_1.default.init();
52-
const exitCode = yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(script);
53-
if (exitCode != 0) {
54-
throw new Error(`Extraction using Expand-Archive cmdlet failed from ${zipPath} to ${destination}`);
55-
}
56-
});
57-
}
58-
}
59-
exports.ArchiveTools = ArchiveTools;
51+
$ProgressPreference = $prevProgressPref`;
52+
yield PowerShellToolRunner_1.default.init();
53+
const exitCode = yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(script);
54+
if (exitCode != 0) {
55+
throw new Error(`Extraction using Expand-Archive cmdlet failed from ${zipPath} to ${destination}`);
56+
}
57+
});
58+
}
59+
}
60+
exports.ArchiveTools = ArchiveTools;

0 commit comments

Comments
 (0)