@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1328 → 0.0.2-alpha.1332
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.
- package/dist/src/constants/buildSchemes.js +3 -3
- package/dist/src/constants/index.js +5 -10
- package/dist/src/constants/platforms.js +11 -0
- package/dist/src/index.js +29 -31
- package/dist/src/resolvers/index.js +19 -12
- package/dist/src/resolvers/resolveBaseUrl.js +15 -16
- package/dist/src/resolvers/resolveBuildVersion.js +17 -19
- package/dist/src/resolvers/resolveBuildVersionOffset.js +35 -0
- package/dist/src/resolvers/resolveDeployLocations.js +70 -0
- package/dist/src/{utils/getBaseConfig.js → resolvers/resolveGenericRnvConfig.js} +18 -30
- package/dist/src/resolvers/resolveHbbtvDeployConfig.js +13 -0
- package/dist/src/resolvers/resolveHbbtvDeployUrl.js +11 -0
- package/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +27 -0
- package/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +15 -0
- package/dist/src/scripts/buildAllWithScheme.js +14 -14
- package/dist/src/scripts/gitReleaser/afterVersionBump.js +10 -10
- package/dist/src/scripts/gitReleaser/beforeVersionBump.js +7 -7
- package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +9 -9
- package/dist/src/scripts/gitReleaser/pushRelease.js +17 -17
- package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +4 -4
- package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +16 -16
- package/dist/src/scripts/release/deleteSourceMaps.js +6 -6
- package/dist/src/scripts/release/deployToAppCenter.js +37 -38
- package/dist/src/scripts/release/githubRelease.js +60 -64
- package/dist/src/scripts/release/notifySlack/makePayload.js +44 -48
- package/dist/src/scripts/release/notifySlack/notifySlack.js +10 -10
- package/dist/src/scripts/release/notifySlack/slackBlockKitBuilder.js +25 -28
- package/dist/src/scripts/release/sentryRelease.js +34 -33
- package/dist/src/scripts/release/urlsMarkdown.js +29 -30
- package/dist/src/scripts/releaseAllWithScheme.js +27 -28
- package/dist/src/scripts/utils/cmdUtils.js +9 -9
- package/dist/src/scripts/utils/fsUtils.js +7 -7
- package/dist/src/scripts/utils/gitUtils.js +50 -50
- package/dist/src/scripts/utils/index.js +8 -8
- package/dist/src/scripts/utils/stringUtils.js +2 -5
- package/dist/src/sdks/index.js +15 -54
- package/dist/src/sdks/sdk-tizen/index.js +154 -254
- package/dist/src/sdks/sdk-webos/index.js +136 -231
- package/dist/src/sdks/sdk-webpack/index.js +20 -69
- package/dist/src/sdks/sdkUtils.js +14 -59
- package/dist/src/tasks/deploy/aswS3/aws.js +9 -9
- package/dist/src/tasks/deploy/aswS3/deployS3.js +44 -82
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +70 -174
- package/dist/src/tasks/engineTasks.js +10 -10
- package/dist/src/tasks/task.rnv.build.js +77 -134
- package/dist/src/tasks/task.rnv.configure.js +39 -88
- package/dist/src/tasks/task.rnv.configureSoft.js +22 -75
- package/dist/src/tasks/task.rnv.deploy.js +28 -78
- package/dist/src/tasks/task.rnv.hooks.run.js +42 -92
- package/dist/src/tasks/task.rnv.package.js +18 -61
- package/dist/src/tasks/task.rnv.project.configure.js +80 -183
- package/dist/src/tasks/task.rnv.start.js +42 -87
- package/dist/src/types/c.js +1 -1
- package/dist/src/types/index.js +1 -1
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +12 -12
- package/dist/src/utils/replaceRelevantStringsInConfig/index.js +2 -9
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +10 -11
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +24 -30
- package/dist/src/utils/zipBuildsByPlatforms.js +28 -39
- package/dist/templates/platforms/_shared/template.js +58 -42
- package/dist/templates/platforms/_shared/webpack.base.js +119 -139
- package/dist/templates/platforms/entone/webpack.config.dev.js +27 -22
- package/dist/templates/platforms/entone/webpack.config.prod.js +21 -20
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +42 -24
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +36 -22
- package/dist/templates/platforms/tizen/webpack.config.dev.js +28 -22
- package/dist/templates/platforms/tizen/webpack.config.prod.js +21 -20
- package/dist/templates/platforms/webos/webpack.config.dev.js +31 -24
- package/dist/templates/platforms/webos/webpack.config.prod.js +23 -22
- package/dist/templates/platforms/webtv/webpack.config.dev.js +27 -22
- package/dist/templates/platforms/webtv/webpack.config.prod.js +21 -20
- package/dist/types/src/constants/index.d.ts +1 -0
- package/dist/types/src/constants/platforms.d.ts +8 -0
- package/dist/types/src/resolvers/index.d.ts +8 -1
- package/dist/types/src/resolvers/resolveBuildVersionOffset.d.ts +3 -0
- package/dist/types/src/resolvers/resolveDeployLocations.d.ts +9 -0
- package/dist/types/src/resolvers/resolveGenericRnvConfig.d.ts +4 -0
- package/dist/types/src/resolvers/resolveHbbtvDeployConfig.d.ts +10 -0
- package/dist/types/src/resolvers/resolveHbbtvDeployUrl.d.ts +3 -0
- package/dist/types/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.d.ts +3 -0
- package/dist/types/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.d.ts +3 -0
- package/dist/types/src/scripts/release/notifySlack/makePayload.d.ts +9 -3
- package/dist/types/src/tasks/deploy/hbbtv/deployHbbtv.d.ts +0 -1
- package/dist/types/src/tasks/task.rnv.build.d.ts +1 -2
- package/dist/types/src/tasks/task.rnv.configure.d.ts +1 -2
- package/dist/types/src/tasks/task.rnv.deploy.d.ts +1 -2
- package/dist/types/src/tasks/task.rnv.package.d.ts +1 -2
- package/dist/types/src/tasks/task.rnv.start.d.ts +1 -2
- package/dist/types/src/types/c.d.ts +278 -8
- package/dist/types/src/utils/zipBuildsByPlatforms.d.ts +0 -1
- package/package.json +3 -3
- package/dist/src/enginePlatforms.js +0 -15
- package/dist/src/utils/getDeployLocations.js +0 -80
- package/dist/src/utils/getVersionOffset.js +0 -35
- package/dist/types/src/enginePlatforms.d.ts +0 -8
- package/dist/types/src/utils/getBaseConfig.d.ts +0 -2
- package/dist/types/src/utils/getDeployLocations.d.ts +0 -7
- package/dist/types/src/utils/getVersionOffset.d.ts +0 -1
|
@@ -18,12 +18,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
exports
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.notifySlack = void 0;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const child_process_1 = require("child_process");
|
|
24
|
+
const payload = __importStar(require("./makePayload"));
|
|
25
|
+
const getPayload = (c) => {
|
|
26
|
+
const releaseType = c.runtime.scheme;
|
|
27
27
|
switch (releaseType) {
|
|
28
28
|
case 'dev:latest': return payload.makeDevelopmentPayload(c);
|
|
29
29
|
case 'rc:latest': return payload.makeReleaseCandidatePayload(c);
|
|
@@ -31,12 +31,12 @@ var getPayload = function (c) {
|
|
|
31
31
|
default: throw new Error('Notify Slack: unsupported or undefined release type! Did you pass it as an argument?');
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
const notifySlack = (c) => {
|
|
35
35
|
var _a, _b, _c, _d;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const contentType = '"Content-type: application/json"';
|
|
37
|
+
const data = `--data '${JSON.stringify(getPayload(c))}'`;
|
|
38
|
+
const webHookUrl = ((_d = (_c = (_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.deploy) === null || _c === void 0 ? void 0 : _c.slack) === null || _d === void 0 ? void 0 : _d.webhookUrl) || '';
|
|
39
|
+
const cmd = `curl -X POST -H ${contentType} ${data} ${webHookUrl}`;
|
|
40
40
|
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
41
41
|
};
|
|
42
42
|
exports.notifySlack = notifySlack;
|
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Context = exports.Divider = exports.Actions = exports.Section = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const mrkdwn = (text) => ({ type: 'mrkdwn', text });
|
|
5
|
+
const plainText = (text) => ({
|
|
6
6
|
type: 'plain_text',
|
|
7
|
-
text
|
|
8
|
-
emoji: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
var Section = {
|
|
19
|
-
mrkdwn: function (text) { return ({
|
|
7
|
+
text,
|
|
8
|
+
emoji: true,
|
|
9
|
+
});
|
|
10
|
+
const buttonWithUrl = ({ text, url }) => ({
|
|
11
|
+
type: 'button',
|
|
12
|
+
text: plainText(text),
|
|
13
|
+
url,
|
|
14
|
+
});
|
|
15
|
+
const Section = {
|
|
16
|
+
mrkdwn: (text) => ({
|
|
20
17
|
type: 'section',
|
|
21
|
-
text: mrkdwn(text)
|
|
22
|
-
})
|
|
18
|
+
text: mrkdwn(text),
|
|
19
|
+
}),
|
|
23
20
|
};
|
|
24
21
|
exports.Section = Section;
|
|
25
|
-
|
|
26
|
-
buttons:
|
|
22
|
+
const Actions = {
|
|
23
|
+
buttons: (btnsData) => ({
|
|
27
24
|
type: 'actions',
|
|
28
|
-
elements: btnsData.map(buttonWithUrl)
|
|
29
|
-
})
|
|
25
|
+
elements: btnsData.map(buttonWithUrl),
|
|
26
|
+
}),
|
|
30
27
|
};
|
|
31
28
|
exports.Actions = Actions;
|
|
32
|
-
|
|
33
|
-
plain:
|
|
29
|
+
const Divider = {
|
|
30
|
+
plain: () => ({ type: 'divider' }),
|
|
34
31
|
};
|
|
35
32
|
exports.Divider = Divider;
|
|
36
|
-
|
|
37
|
-
mrkdwns:
|
|
33
|
+
const Context = {
|
|
34
|
+
mrkdwns: (texts) => ({
|
|
38
35
|
type: 'context',
|
|
39
|
-
elements: texts.map(mrkdwn)
|
|
40
|
-
})
|
|
36
|
+
elements: texts.map(mrkdwn),
|
|
37
|
+
}),
|
|
41
38
|
};
|
|
42
39
|
exports.Context = Context;
|
|
@@ -2,67 +2,68 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.sentryRelease = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const constants_1 = require("../../constants");
|
|
10
|
+
const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
|
|
11
|
+
const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
12
|
+
const createNewRelease = (version) => {
|
|
13
|
+
executeSync(`sentry-cli releases new ${version}`);
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
const uploadSourceMaps = (params) => {
|
|
16
|
+
const { version, sourceMapsPath, urlPrefix } = params;
|
|
16
17
|
executeSync('sentry-cli releases '
|
|
17
|
-
+
|
|
18
|
-
+
|
|
19
|
-
+
|
|
18
|
+
+ `files ${version} `
|
|
19
|
+
+ `upload-sourcemaps ${sourceMapsPath} `
|
|
20
|
+
+ `--url-prefix "~/${urlPrefix}" `
|
|
20
21
|
+ '--rewrite --validate');
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
+
const setReleaseCommits = (version) => {
|
|
23
24
|
try {
|
|
24
|
-
executeSync(
|
|
25
|
+
executeSync(`sentry-cli releases set-commits ${version} --auto --log-level=debug`);
|
|
25
26
|
}
|
|
26
27
|
catch (error) {
|
|
27
28
|
console.log('Sentry release commits failed: ', error);
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
-
executeSync(
|
|
31
|
+
const finalizeRelease = (version) => {
|
|
32
|
+
executeSync(`sentry-cli releases finalize ${version}`);
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
+
const processPlatform = (c, platform, version) => {
|
|
34
35
|
var _a;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!fs_1
|
|
36
|
+
const processFlavour = (flavour) => {
|
|
37
|
+
const { platformBuildsDir } = c.buildConfig.paths;
|
|
38
|
+
const mapsPath = `${platformBuildsDir}/${flavour}_${platform}-public/public/content/js`;
|
|
39
|
+
const urlPrefix = `builds/${platform}/${flavour}/dist/${version}/public/content/js/`;
|
|
40
|
+
if (!fs_1.default.existsSync(mapsPath))
|
|
40
41
|
return;
|
|
41
|
-
console.log(
|
|
42
|
-
uploadSourceMaps({ version
|
|
42
|
+
console.log(`Uploading ${flavour}_${platform} sourcemaps to Sentry...`);
|
|
43
|
+
uploadSourceMaps({ version, sourceMapsPath: mapsPath, urlPrefix });
|
|
43
44
|
};
|
|
44
|
-
|
|
45
|
+
const { supportedFlavours = [] } = ((_a = c.buildConfig.platforms[platform]) === null || _a === void 0 ? void 0 : _a.deploy) || {};
|
|
45
46
|
supportedFlavours.forEach(processFlavour);
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
const isSentryProjectConfigured = () => {
|
|
48
49
|
var _a;
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
const cmd = child_process_1.execSync('sentry-cli info --config-status-json');
|
|
51
|
+
const sentryConfig = JSON.parse(cmd.toString()) || {};
|
|
51
52
|
return !!((_a = sentryConfig.config) === null || _a === void 0 ? void 0 : _a.project);
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
+
const sentryRelease = (c) => {
|
|
54
55
|
var _a;
|
|
55
56
|
if (!isSentryProjectConfigured()) {
|
|
56
57
|
console.log('Project is not defined...');
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
const version = `v${(_a = c.buildConfig.common) === null || _a === void 0 ? void 0 : _a.packageVersion}`;
|
|
60
61
|
if (!version)
|
|
61
62
|
return;
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
|
|
64
|
+
const supportedPlatformsBySentry = supportedPlatforms.filter((platform) => !UNSUPPORTED_PLATFORMS.includes(platform));
|
|
64
65
|
createNewRelease(version);
|
|
65
|
-
supportedPlatformsBySentry.forEach(
|
|
66
|
+
supportedPlatformsBySentry.forEach((platform) => processPlatform(c, platform, version));
|
|
66
67
|
setReleaseCommits(version);
|
|
67
68
|
finalizeRelease(version);
|
|
68
69
|
console.log('Source Maps uploaded...');
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUrlsMarkdown = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const resolvers_1 = require("../../resolvers");
|
|
6
|
+
const newLine = '\r\n';
|
|
7
|
+
const getDataToProceed = (c, customPlatformList = []) => {
|
|
8
|
+
const locations = resolvers_1.resolveDeployLocations(c);
|
|
9
|
+
const { versions } = locations;
|
|
10
|
+
const { platforms } = versions[Object.keys(versions)[0]];
|
|
11
11
|
if (!customPlatformList.length)
|
|
12
12
|
return platforms;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const outputData = {};
|
|
14
|
+
const addToOutputIfPlatformHasData = (platformName) => {
|
|
15
|
+
const platformData = platforms[platformName];
|
|
16
16
|
if (platformData) {
|
|
17
17
|
outputData[platformName] = platformData;
|
|
18
18
|
}
|
|
@@ -20,38 +20,37 @@ var getDataToProceed = function (c, customPlatformList) {
|
|
|
20
20
|
customPlatformList.forEach(addToOutputIfPlatformHasData);
|
|
21
21
|
return outputData;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
const beautifyPlatformName = (platformName) => {
|
|
24
24
|
switch (platformName.toLowerCase()) {
|
|
25
|
-
case
|
|
26
|
-
case
|
|
27
|
-
case
|
|
28
|
-
case
|
|
29
|
-
case
|
|
25
|
+
case constants_1.Platforms.ENTONE: return 'Entone';
|
|
26
|
+
case constants_1.Platforms.HBBTV: return 'HbbTV';
|
|
27
|
+
case constants_1.Platforms.TIZEN: return 'Tizen (Samsung)';
|
|
28
|
+
case constants_1.Platforms.WEBOS: return 'webOS (LG)';
|
|
29
|
+
case constants_1.Platforms.WEBTV: return 'WebTV';
|
|
30
30
|
default: return platformName;
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
if (platformName ===
|
|
33
|
+
const getPlatformOutput = (data, platformName) => {
|
|
34
|
+
if (platformName === constants_1.Platforms.TIZEN || platformName === constants_1.Platforms.WEBOS) {
|
|
35
35
|
return '';
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
output += "* [" + flavour + "](" + indexUrl + ")" + newLine;
|
|
37
|
+
const platformData = data[platformName];
|
|
38
|
+
let output = `**${beautifyPlatformName(platformName)}**${newLine}`;
|
|
39
|
+
const processPlatformEntry = ([flavour, flavourData]) => {
|
|
40
|
+
const { indexUrl } = flavourData;
|
|
41
|
+
output += `* [${flavour}](${indexUrl})${newLine}`;
|
|
43
42
|
};
|
|
44
43
|
Object.entries(platformData).forEach(processPlatformEntry);
|
|
45
44
|
return output;
|
|
46
45
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.map(
|
|
46
|
+
const getUrlsMarkdown = (c, customPlatformList) => {
|
|
47
|
+
const dataToProceed = getDataToProceed(c, customPlatformList);
|
|
48
|
+
const markdownWithoutHeader = Object.keys(dataToProceed)
|
|
49
|
+
.map((platformName) => getPlatformOutput(dataToProceed, platformName))
|
|
51
50
|
.filter(Boolean)
|
|
52
51
|
.join(newLine);
|
|
53
52
|
if (markdownWithoutHeader.length) {
|
|
54
|
-
|
|
53
|
+
const urlHeader = `${newLine}## URL${newLine}`;
|
|
55
54
|
return urlHeader + markdownWithoutHeader;
|
|
56
55
|
}
|
|
57
56
|
return '';
|
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var cmd = "npx rnv deploy -s " + scheme + " -p " + platform + " -c " + flavour + " --ci --only";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const child_process_1 = require("child_process");
|
|
4
|
+
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
5
|
+
const resolvers_1 = require("../resolvers");
|
|
6
|
+
const zipBuildsByPlatforms_1 = require("../utils/zipBuildsByPlatforms");
|
|
7
|
+
const deleteSourceMaps_1 = require("./release/deleteSourceMaps");
|
|
8
|
+
const deployToAppCenter_1 = require("./release/deployToAppCenter");
|
|
9
|
+
const githubRelease_1 = require("./release/githubRelease");
|
|
10
|
+
const notifySlack_1 = require("./release/notifySlack/notifySlack");
|
|
11
|
+
const sentryRelease_1 = require("./release/sentryRelease");
|
|
12
|
+
const deployTask = (options) => {
|
|
13
|
+
const { scheme, platform, flavour } = options;
|
|
14
|
+
const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only`;
|
|
16
15
|
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
17
16
|
};
|
|
18
|
-
|
|
17
|
+
const deployBuilds = (c) => {
|
|
19
18
|
console.log('Deploying the builds...');
|
|
20
19
|
forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, deployTask);
|
|
21
20
|
return true;
|
|
22
21
|
};
|
|
23
|
-
|
|
22
|
+
const doLatestDevelopmentRelease = (c) => {
|
|
24
23
|
console.log('doLatestDevelopmentRelease');
|
|
25
24
|
return deployBuilds(c);
|
|
26
25
|
};
|
|
27
|
-
|
|
26
|
+
const doLatestReleaseCandidateRelease = (c) => {
|
|
28
27
|
console.log('doLatestReleaseCandidateRelease');
|
|
29
28
|
deployBuilds(c);
|
|
30
29
|
notifySlack_1.notifySlack(c);
|
|
31
30
|
return true;
|
|
32
31
|
};
|
|
33
|
-
|
|
32
|
+
const doLatestRelease = (c) => {
|
|
34
33
|
console.log('doLatestRelease');
|
|
35
34
|
return deployBuilds(c);
|
|
36
35
|
};
|
|
37
|
-
|
|
36
|
+
const doDistributionRelease = (c) => {
|
|
38
37
|
console.log('doDistributionRelease');
|
|
39
38
|
zipBuildsByPlatforms_1.zipBuildsByPlatforms(c);
|
|
40
39
|
deployBuilds(c);
|
|
@@ -45,12 +44,12 @@ var doDistributionRelease = function (c) {
|
|
|
45
44
|
notifySlack_1.notifySlack(c);
|
|
46
45
|
return true;
|
|
47
46
|
};
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const releaseAllWithScheme = () => {
|
|
48
|
+
const scheme = process.argv[2];
|
|
50
49
|
if (!scheme) {
|
|
51
50
|
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
52
51
|
}
|
|
53
|
-
|
|
52
|
+
const c = resolvers_1.getBaseConfig();
|
|
54
53
|
c.runtime.scheme = scheme;
|
|
55
54
|
switch (scheme) {
|
|
56
55
|
case 'dev:latest':
|
|
@@ -68,12 +67,12 @@ var releaseAllWithScheme = function () {
|
|
|
68
67
|
default:
|
|
69
68
|
throw new Error('Unsupported scheme to release!');
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
console.log(JSON.stringify(
|
|
70
|
+
const spacing = 4;
|
|
71
|
+
console.log(JSON.stringify(resolvers_1.resolveDeployLocations(c), null, spacing));
|
|
73
72
|
return true;
|
|
74
73
|
};
|
|
75
|
-
|
|
74
|
+
const startTimestamp = Date.now();
|
|
76
75
|
releaseAllWithScheme();
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
console.log(
|
|
76
|
+
const msPerSecond = 1000;
|
|
77
|
+
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
78
|
+
console.log(`buildAllWithScheme: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
const cmdSync = (command, options) => execSync(command, options);
|
|
4
|
+
const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
|
|
5
|
+
const cmdSyncPipeOut = (command) => cmdSync(command, { stdio: 'pipe' });
|
|
6
|
+
const cmdSyncTrimOut = (command) => cmdSync(command).toString().trim();
|
|
7
7
|
module.exports = {
|
|
8
|
-
cmdSync
|
|
9
|
-
cmdSyncInheritOut
|
|
10
|
-
cmdSyncPipeOut
|
|
11
|
-
cmdSyncTrimOut
|
|
8
|
+
cmdSync,
|
|
9
|
+
cmdSyncInheritOut,
|
|
10
|
+
cmdSyncPipeOut,
|
|
11
|
+
cmdSyncTrimOut,
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const { ok } = require('assert').strict;
|
|
4
|
+
const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
|
|
5
|
+
const assertPath = (path) => {
|
|
6
|
+
const errorMsg = `File or path ${path} does not exist!`;
|
|
7
7
|
ok(fs.existsSync(path), errorMsg);
|
|
8
8
|
};
|
|
9
9
|
module.exports = {
|
|
10
|
-
getFileContentAsString
|
|
11
|
-
assertPath
|
|
10
|
+
getFileContentAsString,
|
|
11
|
+
assertPath,
|
|
12
12
|
};
|
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
const { ok } = require('assert').strict;
|
|
3
|
+
const { cmdSyncTrimOut, cmdSyncInheritOut, cmdSyncPipeOut } = require('./cmdUtils');
|
|
4
|
+
const { splitByNewLine } = require('./stringUtils');
|
|
5
|
+
const statusList = () => {
|
|
6
|
+
const gitCmd = 'git status --porcelain';
|
|
7
|
+
const outputString = cmdSyncTrimOut(gitCmd);
|
|
8
8
|
if (!outputString)
|
|
9
9
|
return [];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const handleMultipleWhitespaces = (rowString) => {
|
|
11
|
+
const spaceChar = ' ';
|
|
12
|
+
const parts = rowString.split(spaceChar);
|
|
13
13
|
return parts.filter(Boolean).join(spaceChar);
|
|
14
14
|
};
|
|
15
15
|
return splitByNewLine(outputString).map(handleMultipleWhitespaces);
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const getCurrentBranchName = () => cmdSyncTrimOut('git branch --show-current');
|
|
18
|
+
const pullRequest = (fromBranch, toBranch, prTitle) => {
|
|
19
|
+
const cmdTool = 'hub';
|
|
20
|
+
const installDocUrl = 'https://github.com/github/hub#installation';
|
|
21
|
+
const errorMsg = `${cmdTool} is not installed! See ${installDocUrl}\n`;
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
const toolPath = cmdSyncTrimOut(`${cmdTool} --version`);
|
|
24
24
|
ok(toolPath, errorMsg);
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
27
|
throw new Error(errorMsg);
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
|
|
30
30
|
cmdSyncInheritOut(cmd);
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const remoteBranchExists = (expectedBranchName) => {
|
|
33
|
+
const gitCmd = `git ls-remote --heads origin ${expectedBranchName}`;
|
|
34
|
+
const output = cmdSyncTrimOut(gitCmd);
|
|
35
35
|
return Boolean(output);
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return cmdSyncPipeOut(
|
|
37
|
+
const pull = () => cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}');
|
|
38
|
+
const addAll = () => cmdSyncPipeOut('git add --all');
|
|
39
|
+
const add = (fileList) => cmdSyncPipeOut(`git add ${fileList.join(' ')}`);
|
|
40
|
+
const checkout = (branchName) => cmdSyncPipeOut(`git checkout ${branchName}`);
|
|
41
|
+
const createBranch = (branchName) => cmdSyncPipeOut(`git branch ${branchName}`);
|
|
42
|
+
const commit = (commitMessage, noVerify) => {
|
|
43
|
+
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
44
|
+
return cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const push = (branchName, noVerify) => {
|
|
47
|
+
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
48
|
+
const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
|
|
49
49
|
return cmdSyncPipeOut(cmd);
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
const assertEmptyStatusList = () => {
|
|
52
52
|
ok(statusList().length === 0, 'An empty GIT stage is expected!');
|
|
53
53
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const assertCurrentBranch = (expectedBranchName) => {
|
|
55
|
+
const currentGitBranchName = getCurrentBranchName();
|
|
56
|
+
const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
|
|
57
57
|
ok(currentGitBranchName === expectedBranchName, errorMsg);
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const assertRemoteBranch = (expectedBranchName) => {
|
|
60
|
+
const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
|
|
61
61
|
ok(remoteBranchExists(expectedBranchName), errorMsg);
|
|
62
62
|
};
|
|
63
63
|
module.exports = {
|
|
64
|
-
statusList
|
|
65
|
-
getCurrentBranchName
|
|
66
|
-
pullRequest
|
|
67
|
-
remoteBranchExists
|
|
68
|
-
pull
|
|
69
|
-
addAll
|
|
70
|
-
add
|
|
71
|
-
checkout
|
|
72
|
-
createBranch
|
|
73
|
-
commit
|
|
74
|
-
push
|
|
75
|
-
assertEmptyStatusList
|
|
76
|
-
assertCurrentBranch
|
|
77
|
-
assertRemoteBranch
|
|
64
|
+
statusList,
|
|
65
|
+
getCurrentBranchName,
|
|
66
|
+
pullRequest,
|
|
67
|
+
remoteBranchExists,
|
|
68
|
+
pull,
|
|
69
|
+
addAll,
|
|
70
|
+
add,
|
|
71
|
+
checkout,
|
|
72
|
+
createBranch,
|
|
73
|
+
commit,
|
|
74
|
+
push,
|
|
75
|
+
assertEmptyStatusList,
|
|
76
|
+
assertCurrentBranch,
|
|
77
|
+
assertRemoteBranch,
|
|
78
78
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const cmdUtils = require('./cmdUtils');
|
|
3
|
+
const fsUtils = require('./fsUtils');
|
|
4
|
+
const gitUtils = require('./gitUtils');
|
|
5
|
+
const stringUtils = require('./stringUtils');
|
|
6
6
|
module.exports = {
|
|
7
|
-
cmdUtils
|
|
8
|
-
fsUtils
|
|
9
|
-
gitUtils
|
|
10
|
-
stringUtils
|
|
7
|
+
cmdUtils,
|
|
8
|
+
fsUtils,
|
|
9
|
+
gitUtils,
|
|
10
|
+
stringUtils,
|
|
11
11
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
if (string === void 0) { string = ''; }
|
|
4
|
-
return string.split(/\r?\n/);
|
|
5
|
-
};
|
|
2
|
+
const splitByNewLine = (string = '') => string.split(/\r?\n/);
|
|
6
3
|
module.exports = {
|
|
7
|
-
splitByNewLine
|
|
4
|
+
splitByNewLine,
|
|
8
5
|
};
|