@24i/smartapps-bigscreen-rnv-build-engine 0.8.6 → 0.8.7-alpha.1414
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/resolvers/index.js +9 -1
- package/dist/src/resolvers/resolveBaseUrl.js +4 -4
- package/dist/src/resolvers/resolveBuildFileExtension.js +12 -0
- package/dist/src/resolvers/resolveBuildFileName.js +35 -0
- package/dist/src/resolvers/resolveBuildVersion.js +4 -4
- package/dist/src/resolvers/resolveBuildVersionOffset.js +2 -2
- package/dist/src/resolvers/resolveDeployLocations.js +31 -37
- package/dist/src/resolvers/resolveGenericRnvConfig.js +4 -25
- package/dist/src/resolvers/resolveHbbtvDeployUrl.js +2 -2
- package/dist/src/resolvers/resolveSupportedPlatforms.js +5 -0
- package/dist/src/resolvers/resolveUsedFlavours.js +23 -0
- package/dist/src/scripts/buildAllWithScheme.js +3 -3
- package/dist/src/scripts/generateDeployUrls/formatTableDataSpaces.js +30 -0
- package/dist/src/scripts/generateDeployUrls/index.js +88 -0
- package/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +63 -0
- package/dist/src/scripts/gitReleaser/afterVersionBump.js +6 -6
- package/dist/src/scripts/gitReleaser/beforeVersionBump.js +6 -6
- package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +1 -1
- package/dist/src/scripts/gitReleaser/pushRelease.js +7 -7
- package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +1 -1
- package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +7 -7
- package/dist/src/scripts/release/deleteSourceMaps.js +1 -1
- package/dist/src/scripts/release/deployToAppCenter.js +6 -7
- package/dist/src/scripts/release/githubRelease.js +16 -16
- package/dist/src/scripts/release/notifySlack/makePayload.js +10 -7
- package/dist/src/scripts/release/notifySlack/notifySlack.js +5 -4
- package/dist/src/scripts/release/sentryRelease.js +4 -3
- package/dist/src/scripts/release/urlsMarkdown.js +1 -1
- package/dist/src/scripts/releaseAllWithScheme.js +16 -15
- package/dist/src/scripts/utils/cmdUtils.js +1 -1
- package/dist/src/scripts/utils/fsUtils.js +4 -2
- package/dist/src/scripts/utils/gitUtils.js +17 -17
- package/dist/src/sdks/sdk-tizen/index.js +13 -12
- package/dist/src/sdks/sdk-webos/index.js +4 -4
- package/dist/src/sdks/sdkUtils.js +1 -1
- package/dist/src/tasks/deploy/aswS3/aws.js +3 -23
- package/dist/src/tasks/deploy/aswS3/deployS3.js +3 -5
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +8 -16
- package/dist/src/tasks/task.rnv.build.js +9 -45
- package/dist/src/tasks/task.rnv.configure.js +1 -1
- package/dist/src/tasks/task.rnv.configureSoft.js +2 -2
- package/dist/src/tasks/task.rnv.deploy.js +3 -3
- package/dist/src/tasks/task.rnv.hooks.run.js +1 -1
- package/dist/src/tasks/task.rnv.project.configure.js +2 -2
- package/dist/src/types/constants.js +2 -0
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +4 -3
- package/dist/src/utils/mergeDeep.js +23 -0
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +1 -1
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +1 -1
- package/dist/src/utils/zipBuildsByPlatforms.js +10 -18
- package/dist/templates/platforms/entone/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/entone/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/saphi/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/saphi/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/tizen/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/tizen/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/webos/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/webos/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/webtv/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/webtv/webpack.config.prod.js +1 -1
- package/package.json +12 -12
|
@@ -4,20 +4,20 @@ const assert_1 = require("assert");
|
|
|
4
4
|
const resolvers_1 = require("../../resolvers");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const checkReleaseNotes_1 = require("./checkReleaseNotes");
|
|
7
|
-
const c = resolvers_1.getBaseConfig();
|
|
7
|
+
const c = (0, resolvers_1.getBaseConfig)();
|
|
8
8
|
const { branchNames, commitTitles, pullRequestTitles } = c.buildConfig.common.git || {};
|
|
9
9
|
const { relativePath } = c.buildConfig.common.releaseNotes || {};
|
|
10
10
|
const rcBranchName = branchNames.rc;
|
|
11
11
|
const releaseNotesBranchName = branchNames.rcReleaseNotes;
|
|
12
12
|
const commitTitle = commitTitles.rcReleaseNotes;
|
|
13
13
|
const prTitle = pullRequestTitles.releaseNotesToRc;
|
|
14
|
-
assert_1.ok(relativePath);
|
|
15
|
-
assert_1.ok(releaseNotesBranchName);
|
|
16
|
-
assert_1.ok(commitTitle);
|
|
17
|
-
assert_1.ok(prTitle);
|
|
14
|
+
(0, assert_1.ok)(relativePath);
|
|
15
|
+
(0, assert_1.ok)(releaseNotesBranchName);
|
|
16
|
+
(0, assert_1.ok)(commitTitle);
|
|
17
|
+
(0, assert_1.ok)(prTitle);
|
|
18
18
|
utils_1.gitUtils.assertCurrentBranch(rcBranchName);
|
|
19
19
|
utils_1.gitUtils.assertRemoteBranch(rcBranchName);
|
|
20
|
-
checkReleaseNotes_1.checkReleaseNotes(c);
|
|
20
|
+
(0, checkReleaseNotes_1.checkReleaseNotes)(c);
|
|
21
21
|
utils_1.gitUtils.pull();
|
|
22
22
|
const changedFilesCount = utils_1.gitUtils.statusList().length;
|
|
23
23
|
if (changedFilesCount === 0) {
|
|
@@ -25,7 +25,7 @@ if (changedFilesCount === 0) {
|
|
|
25
25
|
console.log('Skipping making a commit, if needed, please continue on your own (manually).');
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
assert_1.ok(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
|
|
28
|
+
(0, assert_1.ok)(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
|
|
29
29
|
utils_1.gitUtils.createBranch(releaseNotesBranchName);
|
|
30
30
|
utils_1.gitUtils.checkout(releaseNotesBranchName);
|
|
31
31
|
utils_1.gitUtils.add([relativePath]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteSourceMaps = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
5
|
+
const executeSync = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
6
6
|
const deleteSourceMaps = (c) => {
|
|
7
7
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
8
8
|
executeSync(`find ${platformBuildsDir} -type f -iname "*.map" -delete`);
|
|
@@ -28,7 +28,7 @@ const urlsMarkdown_1 = require("./urlsMarkdown");
|
|
|
28
28
|
const appCenterRelease = (params) => {
|
|
29
29
|
const { filePath, releaseNotesPath, buildVersion, token, projectName } = params;
|
|
30
30
|
const app = `24i-Media/${projectName}`;
|
|
31
|
-
child_process_1.execSync('appcenter distribute release '
|
|
31
|
+
(0, child_process_1.execSync)('appcenter distribute release '
|
|
32
32
|
+ `--file "${filePath}" `
|
|
33
33
|
+ `--release-notes-file "${releaseNotesPath}" `
|
|
34
34
|
+ `--build-version "${buildVersion}" `
|
|
@@ -56,7 +56,7 @@ const processPlatform = (c, platformName) => {
|
|
|
56
56
|
return;
|
|
57
57
|
const { appName } = appCenterConfig;
|
|
58
58
|
const token = getTokenByPlatform(platformName);
|
|
59
|
-
const zipPath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
|
|
59
|
+
const zipPath = (0, resolvers_1.resolveZippedPlatformBuildsRelativeFilePath)(c, platformName);
|
|
60
60
|
const buildVersion = getConfigProp(c, platformName, 'packageVersion', '');
|
|
61
61
|
const releaseNotesPath = getConfigProp(c, platformName, 'releaseNotes', {}).relativePath || '';
|
|
62
62
|
if (!appName || !token || !releaseNotesPath || !zipPath || !buildVersion)
|
|
@@ -65,9 +65,9 @@ const processPlatform = (c, platformName) => {
|
|
|
65
65
|
if (fs.existsSync(tempReleaseNotesPath)) {
|
|
66
66
|
fs.unlinkSync(tempReleaseNotesPath);
|
|
67
67
|
}
|
|
68
|
-
child_process_1.execSync(`cat ${releaseNotesPath} >> ${tempReleaseNotesPath}`);
|
|
69
|
-
const urlsMarkdown = urlsMarkdown_1.getUrlsMarkdown(c, [platformName]);
|
|
70
|
-
child_process_1.execSync(`echo "${urlsMarkdown}" >> ${tempReleaseNotesPath}`);
|
|
68
|
+
(0, child_process_1.execSync)(`cat ${releaseNotesPath} >> ${tempReleaseNotesPath}`);
|
|
69
|
+
const urlsMarkdown = (0, urlsMarkdown_1.getUrlsMarkdown)(c, [platformName]);
|
|
70
|
+
(0, child_process_1.execSync)(`echo "${urlsMarkdown}" >> ${tempReleaseNotesPath}`);
|
|
71
71
|
console.log(`Deploying ${platformName} platform to AppCenter.ms...`);
|
|
72
72
|
appCenterRelease({
|
|
73
73
|
projectName: appName,
|
|
@@ -78,7 +78,6 @@ const processPlatform = (c, platformName) => {
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
const deployToAppCenter = (c) => {
|
|
81
|
-
|
|
82
|
-
supportedPlatforms.forEach((platformName) => processPlatform(c, platformName));
|
|
81
|
+
(0, resolvers_1.resolveSupportedPlatforms)(c).forEach((platformName) => processPlatform(c, platformName));
|
|
83
82
|
};
|
|
84
83
|
exports.deployToAppCenter = deployToAppCenter;
|
|
@@ -58,20 +58,20 @@ const deleteFileIfExists = (filePath) => {
|
|
|
58
58
|
};
|
|
59
59
|
const makeGitHubReleaseNotes = (c) => {
|
|
60
60
|
const releaseNotesPath = getReleaseNotesPath(c);
|
|
61
|
-
assert_1.ok(releaseNotesPath, 'The path to the file with release notes is missing!');
|
|
61
|
+
(0, assert_1.ok)(releaseNotesPath, 'The path to the file with release notes is missing!');
|
|
62
62
|
deleteFileIfExists(githubReleaseNotesPath);
|
|
63
|
-
child_process_1.execSync(`sed '1d;2d' ${releaseNotesPath} >> ${githubReleaseNotesPath}`);
|
|
64
|
-
const textToAppend = urlsMarkdown_1.getUrlsMarkdown(c);
|
|
65
|
-
child_process_1.execSync(`echo "${textToAppend}" >> ${githubReleaseNotesPath}`);
|
|
63
|
+
(0, child_process_1.execSync)(`sed '1d;2d' ${releaseNotesPath} >> ${githubReleaseNotesPath}`);
|
|
64
|
+
const textToAppend = (0, urlsMarkdown_1.getUrlsMarkdown)(c);
|
|
65
|
+
(0, child_process_1.execSync)(`echo "${textToAppend}" >> ${githubReleaseNotesPath}`);
|
|
66
66
|
};
|
|
67
67
|
const createRelease = (c) => {
|
|
68
68
|
const { packageVersion, git } = c.buildConfig.common;
|
|
69
69
|
const versionLabel = `v${packageVersion}`;
|
|
70
|
-
assert_1.ok(token, 'process.env.GITHUB_TOKEN is not set!');
|
|
71
|
-
assert_1.ok(targetCommit, 'process.env.TRAVIS_COMMIT is not set!');
|
|
72
|
-
assert_1.ok(git.owner, 'Missing value for rnv config prop: common.git.owner');
|
|
73
|
-
assert_1.ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
|
|
74
|
-
assert_1.ok(packageVersion);
|
|
70
|
+
(0, assert_1.ok)(token, 'process.env.GITHUB_TOKEN is not set!');
|
|
71
|
+
(0, assert_1.ok)(targetCommit, 'process.env.TRAVIS_COMMIT is not set!');
|
|
72
|
+
(0, assert_1.ok)(git.owner, 'Missing value for rnv config prop: common.git.owner');
|
|
73
|
+
(0, assert_1.ok)(git.repo, 'Missing value for rnv config prop: common.git.repo');
|
|
74
|
+
(0, assert_1.ok)(packageVersion);
|
|
75
75
|
makeGitHubReleaseNotes(c);
|
|
76
76
|
const releaseNotesContent = fs.readFileSync(githubReleaseNotesPath).toString();
|
|
77
77
|
const data = {
|
|
@@ -87,7 +87,7 @@ const createRelease = (c) => {
|
|
|
87
87
|
const dataStringWithFixedSingleQuotes = JSON.stringify(data).replace(/'/g, "'\\''");
|
|
88
88
|
const cmd = `curl -X POST ${headers} ${url} -d '${dataStringWithFixedSingleQuotes}'`;
|
|
89
89
|
console.log(`Pushing GitHub Release: ${versionLabel}...`);
|
|
90
|
-
const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
|
|
90
|
+
const responseString = (0, child_process_1.execSync)(cmd, { stdio: 'pipe' }).toString();
|
|
91
91
|
const response = JSON.parse(responseString);
|
|
92
92
|
handleResponseErrors(response);
|
|
93
93
|
console.log('Pushing done.');
|
|
@@ -95,23 +95,23 @@ const createRelease = (c) => {
|
|
|
95
95
|
};
|
|
96
96
|
const getFileMimeType = (filepath) => {
|
|
97
97
|
const cmd = `file --mime-type -b ${filepath}`;
|
|
98
|
-
return child_process_1.execSync(cmd, { stdio: 'pipe' })
|
|
98
|
+
return (0, child_process_1.execSync)(cmd, { stdio: 'pipe' })
|
|
99
99
|
.toString()
|
|
100
100
|
.replace(/\r?\n/, '');
|
|
101
101
|
};
|
|
102
102
|
const uploadAsset = (uploadUrl, filePath) => {
|
|
103
103
|
const url = `${uploadUrl.replace('{?name,label}', '')}`;
|
|
104
104
|
const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${fs.statSync(filePath).size}"`;
|
|
105
|
-
const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${path_1.basename(filePath)}`;
|
|
105
|
+
const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${(0, path_1.basename)(filePath)}`;
|
|
106
106
|
console.log(`Uploading ${filePath} asset to created GitHub Release...`);
|
|
107
|
-
const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
|
|
107
|
+
const responseString = (0, child_process_1.execSync)(cmd, { stdio: 'pipe' }).toString();
|
|
108
108
|
const uploadResponse = JSON.parse(responseString);
|
|
109
109
|
handleResponseErrors(uploadResponse);
|
|
110
110
|
console.log('Uploading done.');
|
|
111
111
|
return uploadResponse;
|
|
112
112
|
};
|
|
113
113
|
const uploadZipWithPlatformBuilds = (c, platformName, githubUploadUrl) => {
|
|
114
|
-
const zipFilePath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
|
|
114
|
+
const zipFilePath = (0, resolvers_1.resolveZippedPlatformBuildsRelativeFilePath)(c, platformName);
|
|
115
115
|
if (zipFilePath) {
|
|
116
116
|
uploadAsset(githubUploadUrl, zipFilePath);
|
|
117
117
|
}
|
|
@@ -119,8 +119,8 @@ const uploadZipWithPlatformBuilds = (c, platformName, githubUploadUrl) => {
|
|
|
119
119
|
const githubRelease = (c) => {
|
|
120
120
|
const releaseResponse = createRelease(c) || {};
|
|
121
121
|
const uploadUrl = releaseResponse.upload_url;
|
|
122
|
-
assert_1.ok(uploadUrl, 'Missing "upload_url" in release response!');
|
|
123
|
-
c.
|
|
122
|
+
(0, assert_1.ok)(uploadUrl, 'Missing "upload_url" in release response!');
|
|
123
|
+
(0, resolvers_1.resolveSupportedPlatforms)(c).forEach((platformName) => {
|
|
124
124
|
uploadZipWithPlatformBuilds(c, platformName, uploadUrl);
|
|
125
125
|
});
|
|
126
126
|
deleteFileIfExists(githubReleaseNotesPath);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeDistributionPayload = exports.makeReleaseCandidatePayload = exports.makeDevelopmentPayload = void 0;
|
|
4
4
|
const slackBlockKitBuilder_1 = require("./slackBlockKitBuilder");
|
|
5
5
|
const resolvers_1 = require("../../../resolvers");
|
|
6
|
-
const getVersionsObject = (c) => resolvers_1.resolveDeployLocations(c).versions;
|
|
6
|
+
const getVersionsObject = (c) => (0, resolvers_1.resolveDeployLocations)(c).versions;
|
|
7
7
|
const getVersion = (c) => Object.keys(getVersionsObject(c))[0] || '';
|
|
8
8
|
const getPlatformsObject = (c) => {
|
|
9
9
|
const version = getVersion(c);
|
|
@@ -26,12 +26,15 @@ const makeFlavoursMarkdown = (platformName, entries) => entries
|
|
|
26
26
|
.join('\n');
|
|
27
27
|
const makePackagePayload = (c, platformName) => {
|
|
28
28
|
const platformData = getPlatformsObject(c)[platformName];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
if (platformData) {
|
|
30
|
+
const flavoursEntries = Object.entries(platformData);
|
|
31
|
+
return [
|
|
32
|
+
slackBlockKitBuilder_1.Divider.plain(),
|
|
33
|
+
slackBlockKitBuilder_1.Context.mrkdwns([`Platform: *${platformName}*`]),
|
|
34
|
+
slackBlockKitBuilder_1.Context.mrkdwns([makeFlavoursMarkdown(platformName, flavoursEntries)]),
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
return [];
|
|
35
38
|
};
|
|
36
39
|
const makePackagesPayload = (c) => {
|
|
37
40
|
const platformList = Object.keys(getPlatformsObject(c));
|
|
@@ -22,12 +22,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.notifySlack = void 0;
|
|
23
23
|
const child_process_1 = require("child_process");
|
|
24
24
|
const payload = __importStar(require("./makePayload"));
|
|
25
|
+
const constants_1 = require("../../../constants");
|
|
25
26
|
const getPayload = (c) => {
|
|
26
27
|
const releaseType = c.runtime.scheme;
|
|
27
28
|
switch (releaseType) {
|
|
28
|
-
case
|
|
29
|
-
case
|
|
30
|
-
case
|
|
29
|
+
case constants_1.BuildSchemes.DEV_LATEST: return payload.makeDevelopmentPayload(c);
|
|
30
|
+
case constants_1.BuildSchemes.RC_LATEST: return payload.makeReleaseCandidatePayload(c);
|
|
31
|
+
case constants_1.BuildSchemes.RELEASE_DIST: return payload.makeDistributionPayload(c);
|
|
31
32
|
default: throw new Error('Notify Slack: unsupported or undefined release type! Did you pass it as an argument?');
|
|
32
33
|
}
|
|
33
34
|
};
|
|
@@ -37,7 +38,7 @@ const notifySlack = (c) => {
|
|
|
37
38
|
const webHookUrl = c.buildConfig.common.deploy.slack?.webhookUrl || '';
|
|
38
39
|
if (webHookUrl) {
|
|
39
40
|
const cmd = `curl -X POST -H ${contentType} ${data} ${webHookUrl}`;
|
|
40
|
-
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
41
|
+
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
exports.notifySlack = notifySlack;
|
|
@@ -23,8 +23,9 @@ exports.sentryRelease = void 0;
|
|
|
23
23
|
const child_process_1 = require("child_process");
|
|
24
24
|
const fs = __importStar(require("fs"));
|
|
25
25
|
const constants_1 = require("../../constants");
|
|
26
|
+
const resolvers_1 = require("../../resolvers");
|
|
26
27
|
const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
|
|
27
|
-
const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
28
|
+
const executeSync = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
28
29
|
const createNewRelease = (version) => {
|
|
29
30
|
executeSync(`sentry-cli releases new ${version}`);
|
|
30
31
|
};
|
|
@@ -61,7 +62,7 @@ const processPlatform = (c, platform, version) => {
|
|
|
61
62
|
supportedFlavours.forEach(processFlavour);
|
|
62
63
|
};
|
|
63
64
|
const isSentryProjectConfigured = () => {
|
|
64
|
-
const cmd = child_process_1.execSync('sentry-cli info --config-status-json');
|
|
65
|
+
const cmd = (0, child_process_1.execSync)('sentry-cli info --config-status-json');
|
|
65
66
|
const sentryConfig = JSON.parse(cmd.toString()) || {};
|
|
66
67
|
return !!sentryConfig.config?.project;
|
|
67
68
|
};
|
|
@@ -73,7 +74,7 @@ const sentryRelease = (c) => {
|
|
|
73
74
|
const version = `v${c.buildConfig.common?.packageVersion}`;
|
|
74
75
|
if (!version)
|
|
75
76
|
return;
|
|
76
|
-
const
|
|
77
|
+
const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
|
|
77
78
|
const supportedPlatformsBySentry = supportedPlatforms.filter((platform) => !UNSUPPORTED_PLATFORMS.includes(platform));
|
|
78
79
|
createNewRelease(version);
|
|
79
80
|
supportedPlatformsBySentry.forEach((platform) => processPlatform(c, platform, version));
|
|
@@ -5,7 +5,7 @@ const constants_1 = require("../../constants");
|
|
|
5
5
|
const resolvers_1 = require("../../resolvers");
|
|
6
6
|
const newLine = '\r\n';
|
|
7
7
|
const getDataToProceed = (c, customPlatformList = []) => {
|
|
8
|
-
const locations = resolvers_1.resolveDeployLocations(c);
|
|
8
|
+
const locations = (0, resolvers_1.resolveDeployLocations)(c);
|
|
9
9
|
const { versions } = locations;
|
|
10
10
|
const { platforms } = versions[Object.keys(versions)[0]];
|
|
11
11
|
if (!customPlatformList.length)
|
|
@@ -9,14 +9,15 @@ const deployToAppCenter_1 = require("./release/deployToAppCenter");
|
|
|
9
9
|
const githubRelease_1 = require("./release/githubRelease");
|
|
10
10
|
const notifySlack_1 = require("./release/notifySlack/notifySlack");
|
|
11
11
|
const sentryRelease_1 = require("./release/sentryRelease");
|
|
12
|
+
const constants_1 = require("../constants");
|
|
12
13
|
const deployTask = (options) => {
|
|
13
14
|
const { scheme, platform, flavour } = options;
|
|
14
15
|
const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only`;
|
|
15
|
-
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
16
|
+
(0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
16
17
|
};
|
|
17
18
|
const deployBuilds = (c) => {
|
|
18
19
|
console.log('Deploying the builds...');
|
|
19
|
-
forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, deployTask);
|
|
20
|
+
(0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, deployTask);
|
|
20
21
|
return true;
|
|
21
22
|
};
|
|
22
23
|
const doLatestDevelopmentRelease = (c) => {
|
|
@@ -26,7 +27,7 @@ const doLatestDevelopmentRelease = (c) => {
|
|
|
26
27
|
const doLatestReleaseCandidateRelease = (c) => {
|
|
27
28
|
console.log('doLatestReleaseCandidateRelease');
|
|
28
29
|
deployBuilds(c);
|
|
29
|
-
notifySlack_1.notifySlack(c);
|
|
30
|
+
(0, notifySlack_1.notifySlack)(c);
|
|
30
31
|
return true;
|
|
31
32
|
};
|
|
32
33
|
const doLatestRelease = (c) => {
|
|
@@ -35,13 +36,13 @@ const doLatestRelease = (c) => {
|
|
|
35
36
|
};
|
|
36
37
|
const doDistributionRelease = (c) => {
|
|
37
38
|
console.log('doDistributionRelease');
|
|
38
|
-
zipBuildsByPlatforms_1.zipBuildsByPlatforms(c);
|
|
39
|
+
(0, zipBuildsByPlatforms_1.zipBuildsByPlatforms)(c);
|
|
39
40
|
deployBuilds(c);
|
|
40
|
-
sentryRelease_1.sentryRelease(c);
|
|
41
|
-
deleteSourceMaps_1.deleteSourceMaps(c);
|
|
42
|
-
githubRelease_1.githubRelease(c);
|
|
43
|
-
deployToAppCenter_1.deployToAppCenter(c);
|
|
44
|
-
notifySlack_1.notifySlack(c);
|
|
41
|
+
(0, sentryRelease_1.sentryRelease)(c);
|
|
42
|
+
(0, deleteSourceMaps_1.deleteSourceMaps)(c);
|
|
43
|
+
(0, githubRelease_1.githubRelease)(c);
|
|
44
|
+
(0, deployToAppCenter_1.deployToAppCenter)(c);
|
|
45
|
+
(0, notifySlack_1.notifySlack)(c);
|
|
45
46
|
return true;
|
|
46
47
|
};
|
|
47
48
|
const releaseAllWithScheme = () => {
|
|
@@ -49,26 +50,26 @@ const releaseAllWithScheme = () => {
|
|
|
49
50
|
if (!scheme) {
|
|
50
51
|
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
51
52
|
}
|
|
52
|
-
const c = resolvers_1.getBaseConfig();
|
|
53
|
+
const c = (0, resolvers_1.getBaseConfig)();
|
|
53
54
|
c.runtime.scheme = scheme;
|
|
54
55
|
switch (scheme) {
|
|
55
|
-
case
|
|
56
|
+
case constants_1.BuildSchemes.DEV_LATEST:
|
|
56
57
|
doLatestDevelopmentRelease(c);
|
|
57
58
|
break;
|
|
58
|
-
case
|
|
59
|
+
case constants_1.BuildSchemes.RC_LATEST:
|
|
59
60
|
doLatestReleaseCandidateRelease(c);
|
|
60
61
|
break;
|
|
61
|
-
case
|
|
62
|
+
case constants_1.BuildSchemes.RELEASE_LATEST:
|
|
62
63
|
doLatestRelease(c);
|
|
63
64
|
break;
|
|
64
|
-
case
|
|
65
|
+
case constants_1.BuildSchemes.RELEASE_DIST:
|
|
65
66
|
doDistributionRelease(c);
|
|
66
67
|
break;
|
|
67
68
|
default:
|
|
68
69
|
throw new Error('Unsupported scheme to release!');
|
|
69
70
|
}
|
|
70
71
|
const spacing = 4;
|
|
71
|
-
console.log(JSON.stringify(resolvers_1.resolveDeployLocations(c), null, spacing));
|
|
72
|
+
console.log(JSON.stringify((0, resolvers_1.resolveDeployLocations)(c), null, spacing));
|
|
72
73
|
return true;
|
|
73
74
|
};
|
|
74
75
|
const startTimestamp = Date.now();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cmdSyncTrimOut = exports.cmdSyncPipeOut = exports.cmdSyncInheritOut = exports.cmdSync = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
const cmdSync = (command, options) => child_process_1.execSync(command, options);
|
|
5
|
+
const cmdSync = (command, options) => (0, child_process_1.execSync)(command, options);
|
|
6
6
|
exports.cmdSync = cmdSync;
|
|
7
7
|
const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
|
|
8
8
|
exports.cmdSyncInheritOut = cmdSyncInheritOut;
|
|
@@ -19,13 +19,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.assertPath = exports.getFileContentAsString = void 0;
|
|
22
|
+
exports.isDir = exports.assertPath = exports.getFileContentAsString = void 0;
|
|
23
23
|
const fs = __importStar(require("fs"));
|
|
24
24
|
const assert_1 = require("assert");
|
|
25
25
|
const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
|
|
26
26
|
exports.getFileContentAsString = getFileContentAsString;
|
|
27
27
|
const assertPath = (path) => {
|
|
28
28
|
const errorMsg = `File or path ${path} does not exist!`;
|
|
29
|
-
assert_1.ok(fs.existsSync(path), errorMsg);
|
|
29
|
+
(0, assert_1.ok)(fs.existsSync(path), errorMsg);
|
|
30
30
|
};
|
|
31
31
|
exports.assertPath = assertPath;
|
|
32
|
+
const isDir = (verifiedPath) => (fs.existsSync(verifiedPath) && fs.lstatSync(verifiedPath).isDirectory());
|
|
33
|
+
exports.isDir = isDir;
|
|
@@ -6,7 +6,7 @@ const cmdUtils_1 = require("./cmdUtils");
|
|
|
6
6
|
const stringUtils_1 = require("./stringUtils");
|
|
7
7
|
const statusList = () => {
|
|
8
8
|
const gitCmd = 'git status --porcelain';
|
|
9
|
-
const outputString = cmdUtils_1.cmdSyncTrimOut(gitCmd);
|
|
9
|
+
const outputString = (0, cmdUtils_1.cmdSyncTrimOut)(gitCmd);
|
|
10
10
|
if (!outputString)
|
|
11
11
|
return [];
|
|
12
12
|
const handleMultipleWhitespaces = (rowString) => {
|
|
@@ -14,65 +14,65 @@ const statusList = () => {
|
|
|
14
14
|
const parts = rowString.split(spaceChar);
|
|
15
15
|
return parts.filter(Boolean).join(spaceChar);
|
|
16
16
|
};
|
|
17
|
-
return stringUtils_1.splitByNewLine(outputString).map(handleMultipleWhitespaces);
|
|
17
|
+
return (0, stringUtils_1.splitByNewLine)(outputString).map(handleMultipleWhitespaces);
|
|
18
18
|
};
|
|
19
19
|
exports.statusList = statusList;
|
|
20
|
-
const getCurrentBranchName = () => cmdUtils_1.cmdSyncTrimOut('git branch --show-current');
|
|
20
|
+
const getCurrentBranchName = () => (0, cmdUtils_1.cmdSyncTrimOut)('git branch --show-current');
|
|
21
21
|
exports.getCurrentBranchName = getCurrentBranchName;
|
|
22
22
|
const pullRequest = (fromBranch, toBranch, prTitle) => {
|
|
23
23
|
const cmdTool = 'hub';
|
|
24
24
|
const installDocUrl = 'https://github.com/github/hub#installation';
|
|
25
25
|
const errorMsg = `${cmdTool} is not installed! See ${installDocUrl}\n`;
|
|
26
26
|
try {
|
|
27
|
-
const toolPath = cmdUtils_1.cmdSyncTrimOut(`${cmdTool} --version`);
|
|
28
|
-
assert_1.ok(toolPath, errorMsg);
|
|
27
|
+
const toolPath = (0, cmdUtils_1.cmdSyncTrimOut)(`${cmdTool} --version`);
|
|
28
|
+
(0, assert_1.ok)(toolPath, errorMsg);
|
|
29
29
|
}
|
|
30
30
|
catch (error) {
|
|
31
31
|
throw new Error(errorMsg);
|
|
32
32
|
}
|
|
33
33
|
const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
|
|
34
|
-
cmdUtils_1.cmdSyncInheritOut(cmd);
|
|
34
|
+
(0, cmdUtils_1.cmdSyncInheritOut)(cmd);
|
|
35
35
|
};
|
|
36
36
|
exports.pullRequest = pullRequest;
|
|
37
37
|
const remoteBranchExists = (expectedBranchName) => {
|
|
38
38
|
const gitCmd = `git ls-remote --heads origin ${expectedBranchName}`;
|
|
39
|
-
const output = cmdUtils_1.cmdSyncTrimOut(gitCmd);
|
|
39
|
+
const output = (0, cmdUtils_1.cmdSyncTrimOut)(gitCmd);
|
|
40
40
|
return Boolean(output);
|
|
41
41
|
};
|
|
42
42
|
exports.remoteBranchExists = remoteBranchExists;
|
|
43
|
-
const pull = () => cmdUtils_1.cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}');
|
|
43
|
+
const pull = () => (0, cmdUtils_1.cmdSyncPipeOut)('git remote update -p && git merge --ff-only @{u}');
|
|
44
44
|
exports.pull = pull;
|
|
45
|
-
const addAll = () => cmdUtils_1.cmdSyncPipeOut('git add --all');
|
|
45
|
+
const addAll = () => (0, cmdUtils_1.cmdSyncPipeOut)('git add --all');
|
|
46
46
|
exports.addAll = addAll;
|
|
47
|
-
const add = (fileList) => cmdUtils_1.cmdSyncPipeOut(`git add ${fileList.join(' ')}`);
|
|
47
|
+
const add = (fileList) => (0, cmdUtils_1.cmdSyncPipeOut)(`git add ${fileList.join(' ')}`);
|
|
48
48
|
exports.add = add;
|
|
49
|
-
const checkout = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git checkout ${branchName}`);
|
|
49
|
+
const checkout = (branchName) => (0, cmdUtils_1.cmdSyncPipeOut)(`git checkout ${branchName}`);
|
|
50
50
|
exports.checkout = checkout;
|
|
51
|
-
const createBranch = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git branch ${branchName}`);
|
|
51
|
+
const createBranch = (branchName) => (0, cmdUtils_1.cmdSyncPipeOut)(`git branch ${branchName}`);
|
|
52
52
|
exports.createBranch = createBranch;
|
|
53
53
|
const commit = (commitMessage, noVerify) => {
|
|
54
54
|
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
55
|
-
return cmdUtils_1.cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
|
|
55
|
+
return (0, cmdUtils_1.cmdSyncPipeOut)(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
|
|
56
56
|
};
|
|
57
57
|
exports.commit = commit;
|
|
58
58
|
const push = (branchName, noVerify) => {
|
|
59
59
|
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
60
60
|
const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
|
|
61
|
-
return cmdUtils_1.cmdSyncPipeOut(cmd);
|
|
61
|
+
return (0, cmdUtils_1.cmdSyncPipeOut)(cmd);
|
|
62
62
|
};
|
|
63
63
|
exports.push = push;
|
|
64
64
|
const assertEmptyStatusList = () => {
|
|
65
|
-
assert_1.ok(statusList().length === 0, 'An empty GIT stage is expected!');
|
|
65
|
+
(0, assert_1.ok)(statusList().length === 0, 'An empty GIT stage is expected!');
|
|
66
66
|
};
|
|
67
67
|
exports.assertEmptyStatusList = assertEmptyStatusList;
|
|
68
68
|
const assertCurrentBranch = (expectedBranchName) => {
|
|
69
69
|
const currentGitBranchName = getCurrentBranchName();
|
|
70
70
|
const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
|
|
71
|
-
assert_1.ok(currentGitBranchName === expectedBranchName, errorMsg);
|
|
71
|
+
(0, assert_1.ok)(currentGitBranchName === expectedBranchName, errorMsg);
|
|
72
72
|
};
|
|
73
73
|
exports.assertCurrentBranch = assertCurrentBranch;
|
|
74
74
|
const assertRemoteBranch = (expectedBranchName) => {
|
|
75
75
|
const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
|
|
76
|
-
assert_1.ok(remoteBranchExists(expectedBranchName), errorMsg);
|
|
76
|
+
(0, assert_1.ok)(remoteBranchExists(expectedBranchName), errorMsg);
|
|
77
77
|
};
|
|
78
78
|
exports.assertRemoteBranch = assertRemoteBranch;
|
|
@@ -27,6 +27,7 @@ const semver = __importStar(require("semver"));
|
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
28
|
const rnv_1 = require("rnv");
|
|
29
29
|
const sdkUtils_1 = require("../sdkUtils");
|
|
30
|
+
const constants_1 = require("../../constants");
|
|
30
31
|
const { execCLI } = rnv_1.Exec;
|
|
31
32
|
const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
|
|
32
33
|
const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
|
|
@@ -111,8 +112,8 @@ const buildTizenProject = async (c) => {
|
|
|
111
112
|
logTask('buildTizenProject');
|
|
112
113
|
await buildCoreWebpackProject(c);
|
|
113
114
|
if (!c.program.hosted) {
|
|
114
|
-
const { buildConfig
|
|
115
|
-
const platformConfig = buildConfig.platforms[
|
|
115
|
+
const { buildConfig } = c;
|
|
116
|
+
const platformConfig = buildConfig.platforms[constants_1.Platforms.TIZEN];
|
|
116
117
|
const projectDir = getPlatformProjectDir(c);
|
|
117
118
|
const projectParentDir = path.join(projectDir, '..');
|
|
118
119
|
const tBuild = path.join(projectParentDir, 'build');
|
|
@@ -128,7 +129,7 @@ exports.buildTizenProject = buildTizenProject;
|
|
|
128
129
|
let isGlobalConfigured = false;
|
|
129
130
|
const configureProject = (c) => new Promise((resolve) => {
|
|
130
131
|
logTask('configureProject');
|
|
131
|
-
const
|
|
132
|
+
const platform = constants_1.Platforms.TIZEN;
|
|
132
133
|
const configFile = 'config.xml';
|
|
133
134
|
const p = c.buildConfig.platforms[platform];
|
|
134
135
|
const injects = [
|
|
@@ -162,11 +163,11 @@ exports.configureTizenProject = configureTizenProject;
|
|
|
162
163
|
const handleLinuxKeyring = () => {
|
|
163
164
|
if (process.env.CI && os.platform() === 'linux') {
|
|
164
165
|
const options = { stdio: 'inherit' };
|
|
165
|
-
child_process_1.execSync('eval $(dbus-launch --sh-syntax)', options);
|
|
166
|
-
child_process_1.execSync('mkdir -p ~/.cache', options);
|
|
167
|
-
child_process_1.execSync('mkdir -p ~/.local/share/keyrings', options);
|
|
168
|
-
child_process_1.execSync('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
|
|
169
|
-
child_process_1.execSync('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
|
|
166
|
+
(0, child_process_1.execSync)('eval $(dbus-launch --sh-syntax)', options);
|
|
167
|
+
(0, child_process_1.execSync)('mkdir -p ~/.cache', options);
|
|
168
|
+
(0, child_process_1.execSync)('mkdir -p ~/.local/share/keyrings', options);
|
|
169
|
+
(0, child_process_1.execSync)('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
|
|
170
|
+
(0, child_process_1.execSync)('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
|
|
170
171
|
}
|
|
171
172
|
};
|
|
172
173
|
const setTizenCertificate = (c) => {
|
|
@@ -184,7 +185,7 @@ const setTizenCertificate = (c) => {
|
|
|
184
185
|
console.log('\'c.cli.tizen\' is not set');
|
|
185
186
|
return false;
|
|
186
187
|
}
|
|
187
|
-
const spawnSyncReturn = child_process_1.spawnSync(tizenCliPath, [
|
|
188
|
+
const spawnSyncReturn = (0, child_process_1.spawnSync)(tizenCliPath, [
|
|
188
189
|
'security-profiles', 'add',
|
|
189
190
|
'-n', TIZEN_SECURITY_PROFILE_NAME,
|
|
190
191
|
'-a', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH,
|
|
@@ -224,12 +225,12 @@ const handleTizenSdk = async (c) => {
|
|
|
224
225
|
if (!TIZEN_SDK) {
|
|
225
226
|
handleLinuxKeyring();
|
|
226
227
|
if (fs.existsSync(installPath)) {
|
|
227
|
-
await sdkUtils_1.registerSdkPath(c, rnvSdkKey, installPath);
|
|
228
|
+
await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, installPath);
|
|
228
229
|
}
|
|
229
230
|
else {
|
|
230
|
-
const sdkInstalledToPath = await sdkUtils_1.installSdk(TIZEN_SDK_INSTALLER_URL, installPath);
|
|
231
|
+
const sdkInstalledToPath = await (0, sdkUtils_1.installSdk)(TIZEN_SDK_INSTALLER_URL, installPath);
|
|
231
232
|
if (sdkInstalledToPath) {
|
|
232
|
-
await sdkUtils_1.registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
|
|
233
|
+
await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, sdkInstalledToPath);
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
236
|
}
|
|
@@ -119,15 +119,15 @@ const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.
|
|
|
119
119
|
const handleWebosSdk = async (c) => {
|
|
120
120
|
const { WEBOS_SDK_INSTALLER_URL = sdkInstallerUUrl } = process.env;
|
|
121
121
|
const { WEBOS_SDK } = c.buildConfig.sdks || {};
|
|
122
|
-
const installPath = `${os_1.homedir()}/webOS_TV_SDK`;
|
|
122
|
+
const installPath = `${(0, os_1.homedir)()}/webOS_TV_SDK`;
|
|
123
123
|
const rnvSdkKey = 'WEBOS_SDK';
|
|
124
124
|
if (!WEBOS_SDK) {
|
|
125
125
|
if (fs.existsSync(installPath)) {
|
|
126
|
-
await sdkUtils_1.registerSdkPath(c, rnvSdkKey, installPath);
|
|
126
|
+
await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, installPath);
|
|
127
127
|
}
|
|
128
|
-
const sdkInstalledToPath = await sdkUtils_1.installSdk(WEBOS_SDK_INSTALLER_URL, installPath);
|
|
128
|
+
const sdkInstalledToPath = await (0, sdkUtils_1.installSdk)(WEBOS_SDK_INSTALLER_URL, installPath);
|
|
129
129
|
if (sdkInstalledToPath) {
|
|
130
|
-
await sdkUtils_1.registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
|
|
130
|
+
await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, sdkInstalledToPath);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
await rnv_1.SDKManager.Installer.checkAndConfigureWebosSdks(c);
|
|
@@ -10,7 +10,7 @@ const registerSdkPath = async (c, sdkKey, sdkValue) => {
|
|
|
10
10
|
Object.assign(c.buildConfig, customObjectToMerge);
|
|
11
11
|
};
|
|
12
12
|
exports.registerSdkPath = registerSdkPath;
|
|
13
|
-
const installSdk = async (installerUrl, installPath) => smartapps_bigscreen_sdk_installer_1.sdkInstaller({
|
|
13
|
+
const installSdk = async (installerUrl, installPath) => (0, smartapps_bigscreen_sdk_installer_1.sdkInstaller)({
|
|
14
14
|
zipPath: installerUrl,
|
|
15
15
|
installPath,
|
|
16
16
|
enableLogs: true,
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
3
|
exports.rm = exports.cp = void 0;
|
|
23
4
|
const child_process_1 = require("child_process");
|
|
24
|
-
const
|
|
25
|
-
const runCmdSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
26
|
-
const isDir = (path) => fs.existsSync(path) && fs.lstatSync(path).isDirectory();
|
|
5
|
+
const fsUtils_1 = require("../../../scripts/utils/fsUtils");
|
|
6
|
+
const runCmdSync = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
27
7
|
const cp = (source, destination) => {
|
|
28
8
|
let cmd = `aws s3 cp ${source} s3://${destination} --acl public-read`;
|
|
29
|
-
if (isDir(source)) {
|
|
9
|
+
if ((0, fsUtils_1.isDir)(source)) {
|
|
30
10
|
cmd += ' --recursive';
|
|
31
11
|
}
|
|
32
12
|
runCmdSync(cmd);
|
|
@@ -21,7 +21,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.deployToS3 = void 0;
|
|
23
23
|
const path = __importStar(require("path"));
|
|
24
|
-
const fs = __importStar(require("fs"));
|
|
25
24
|
const rnv_1 = require("rnv");
|
|
26
25
|
const aws = __importStar(require("./aws"));
|
|
27
26
|
const constants_1 = require("../../../constants");
|
|
@@ -29,8 +28,7 @@ const resolvers_1 = require("../../../resolvers");
|
|
|
29
28
|
const { getConfigProp } = rnv_1.Common;
|
|
30
29
|
const uploadPackage = (c, sourcePath, uploadPath) => {
|
|
31
30
|
const packageOutputDirPath = `${sourcePath}/output`;
|
|
32
|
-
const
|
|
33
|
-
const packageFileName = outputFilenameList[0];
|
|
31
|
+
const packageFileName = (0, resolvers_1.resolveBuildFileName)(c);
|
|
34
32
|
const packageLocalPath = `"${packageOutputDirPath}/${packageFileName}"`;
|
|
35
33
|
const packageRemotePath = `"${uploadPath}/build/${packageFileName}"`;
|
|
36
34
|
aws.cp(packageLocalPath, packageRemotePath);
|
|
@@ -49,10 +47,10 @@ const deployToS3 = async (c) => {
|
|
|
49
47
|
const { platform, runtime } = c;
|
|
50
48
|
const sourcePath = runtime.appDir;
|
|
51
49
|
const { isBuildHosted } = getConfigProp(c, platform, 'webpackConfig', {});
|
|
52
|
-
const baseUrl = resolvers_1.resolveBaseUrl({
|
|
50
|
+
const baseUrl = (0, resolvers_1.resolveBaseUrl)({
|
|
53
51
|
platform,
|
|
54
52
|
scheme: runtime.scheme || '',
|
|
55
|
-
|
|
53
|
+
flavour: runtime.appId,
|
|
56
54
|
});
|
|
57
55
|
if (!baseUrl) {
|
|
58
56
|
return false;
|