@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1337 → 0.0.2-alpha.1340
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 +10 -3
- package/dist/src/constants/platforms.js +3 -3
- package/dist/src/index.js +31 -29
- package/dist/src/resolvers/index.js +17 -10
- package/dist/src/resolvers/resolveBaseUrl.js +15 -14
- package/dist/src/resolvers/resolveBuildVersion.js +17 -16
- package/dist/src/resolvers/resolveBuildVersionOffset.js +12 -12
- package/dist/src/resolvers/resolveDeployLocations.js +56 -44
- package/dist/src/resolvers/resolveGenericRnvConfig.js +30 -18
- package/dist/src/resolvers/resolveHbbtvDeployConfig.js +4 -4
- package/dist/src/resolvers/resolveHbbtvDeployUrl.js +7 -7
- package/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +12 -12
- package/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +11 -11
- 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 +38 -37
- package/dist/src/scripts/release/githubRelease.js +64 -60
- package/dist/src/scripts/release/notifySlack/makePayload.js +48 -44
- package/dist/src/scripts/release/notifySlack/notifySlack.js +10 -10
- package/dist/src/scripts/release/notifySlack/slackBlockKitBuilder.js +28 -25
- package/dist/src/scripts/release/sentryRelease.js +34 -34
- package/dist/src/scripts/release/urlsMarkdown.js +25 -23
- package/dist/src/scripts/releaseAllWithScheme.js +26 -26
- 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 +5 -2
- package/dist/src/sdks/index.js +54 -15
- package/dist/src/sdks/sdk-tizen/index.js +254 -154
- package/dist/src/sdks/sdk-webos/index.js +231 -136
- package/dist/src/sdks/sdk-webpack/index.js +69 -20
- package/dist/src/sdks/sdkUtils.js +59 -14
- package/dist/src/tasks/deploy/aswS3/aws.js +9 -9
- package/dist/src/tasks/deploy/aswS3/deployS3.js +83 -44
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +139 -70
- package/dist/src/tasks/engineTasks.js +10 -10
- package/dist/src/tasks/task.rnv.build.js +132 -75
- package/dist/src/tasks/task.rnv.configure.js +88 -39
- package/dist/src/tasks/task.rnv.configureSoft.js +75 -22
- package/dist/src/tasks/task.rnv.deploy.js +78 -28
- package/dist/src/tasks/task.rnv.hooks.run.js +92 -42
- package/dist/src/tasks/task.rnv.package.js +61 -18
- package/dist/src/tasks/task.rnv.project.configure.js +183 -80
- package/dist/src/tasks/task.rnv.start.js +87 -42
- 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 +9 -2
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +11 -10
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +29 -23
- package/dist/src/utils/zipBuildsByPlatforms.js +25 -25
- package/dist/templates/platforms/_shared/template.js +41 -56
- package/dist/templates/platforms/_shared/webpack.base.js +140 -120
- package/dist/templates/platforms/entone/webpack.config.dev.js +22 -27
- package/dist/templates/platforms/entone/webpack.config.prod.js +20 -21
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +24 -42
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +22 -36
- package/dist/templates/platforms/tizen/webpack.config.dev.js +22 -28
- package/dist/templates/platforms/tizen/webpack.config.prod.js +20 -21
- package/dist/templates/platforms/webos/webpack.config.dev.js +24 -31
- package/dist/templates/platforms/webos/webpack.config.prod.js +22 -23
- package/dist/templates/platforms/webtv/webpack.config.dev.js +22 -27
- package/dist/templates/platforms/webtv/webpack.config.prod.js +20 -21
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/resolvers/resolveBaseUrl.d.ts +3 -3
- package/dist/types/src/resolvers/resolveBuildVersion.d.ts +3 -3
- package/dist/types/src/resolvers/resolveGenericRnvConfig.d.ts +1 -1
- package/dist/types/src/resolvers/resolveHbbtvDeployConfig.d.ts +1 -1
- package/dist/types/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.d.ts +1 -1
- package/dist/types/src/scripts/release/notifySlack/makePayload.d.ts +3 -9
- package/dist/types/src/tasks/engineTasks.d.ts +9 -3
- package/dist/types/src/tasks/task.rnv.configureSoft.d.ts +1 -1
- package/dist/types/src/tasks/task.rnv.hooks.run.d.ts +1 -1
- package/dist/types/src/tasks/task.rnv.project.configure.d.ts +1 -1
- package/package.json +2 -2
|
@@ -18,59 +18,98 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
31
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
32
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
|
+
function step(op) {
|
|
35
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
+
while (_) try {
|
|
37
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
|
+
switch (op[0]) {
|
|
40
|
+
case 0: case 1: t = op; break;
|
|
41
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
42
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
43
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
44
|
+
default:
|
|
45
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
46
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
47
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49
|
+
if (t[2]) _.ops.pop();
|
|
50
|
+
_.trys.pop(); continue;
|
|
51
|
+
}
|
|
52
|
+
op = body.call(thisArg, _);
|
|
53
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
|
+
}
|
|
56
|
+
};
|
|
21
57
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
58
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
59
|
};
|
|
24
|
-
|
|
60
|
+
exports.__esModule = true;
|
|
25
61
|
exports.deployToS3 = void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
62
|
+
var path_1 = __importDefault(require("path"));
|
|
63
|
+
var fs_1 = __importDefault(require("fs"));
|
|
64
|
+
var rnv_1 = require("rnv");
|
|
65
|
+
var constants_1 = require("../../../constants");
|
|
66
|
+
var aws = __importStar(require("./aws"));
|
|
67
|
+
var resolvers_1 = require("../../../resolvers");
|
|
68
|
+
var getConfigProp = rnv_1.Common.getConfigProp;
|
|
69
|
+
var uploadPackage = function (c, sourcePath, uploadPath) {
|
|
70
|
+
var packageOutputDirPath = sourcePath + "/output";
|
|
71
|
+
var outputFilenameList = fs_1["default"].readdirSync(packageOutputDirPath);
|
|
72
|
+
var packageFileName = outputFilenameList[0];
|
|
73
|
+
var packageLocalPath = "\"" + packageOutputDirPath + "/" + packageFileName + "\"";
|
|
74
|
+
var packageRemotePath = "\"" + uploadPath + "/build/" + packageFileName + "\"";
|
|
39
75
|
aws.cp(packageLocalPath, packageRemotePath);
|
|
40
76
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
77
|
+
var uploadPublicDir = function (sourcePath, uploadPath) {
|
|
78
|
+
var publicDirLocalPath = path_1["default"].join(sourcePath, 'project', 'public');
|
|
79
|
+
var publicDirRemotePath = uploadPath + "/public";
|
|
44
80
|
aws.cp(publicDirLocalPath, publicDirRemotePath);
|
|
45
81
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
82
|
+
var urlToS3Protocol = function (url) {
|
|
83
|
+
var hostWithPath = url.split('://')[1];
|
|
84
|
+
var bucketHostnameAwsPostfix = '.s3.amazonaws.com';
|
|
49
85
|
return hostWithPath.replace(bucketHostnameAwsPostfix, '');
|
|
50
86
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
platform,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
var deployToS3 = function (c) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
var platform, runtime, sourcePath, isBuildHosted, baseUrl, uploadPath, sourceDirPath;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
platform = c.platform, runtime = c.runtime;
|
|
91
|
+
sourcePath = runtime.appDir;
|
|
92
|
+
isBuildHosted = getConfigProp(c, platform, 'webpackConfig', {}).isBuildHosted;
|
|
93
|
+
baseUrl = resolvers_1.resolveBaseUrl({
|
|
94
|
+
platform: platform,
|
|
95
|
+
scheme: runtime.scheme || '',
|
|
96
|
+
appConfigId: runtime.appId
|
|
97
|
+
});
|
|
98
|
+
if (!baseUrl) {
|
|
99
|
+
return [2, false];
|
|
100
|
+
}
|
|
101
|
+
uploadPath = urlToS3Protocol(baseUrl);
|
|
102
|
+
aws.rm(uploadPath + "/");
|
|
103
|
+
uploadPackage(c, sourcePath, uploadPath);
|
|
104
|
+
if (platform === constants_1.Platforms.HBBTV) {
|
|
105
|
+
process.stdout.write("For " + platform + " platform, only ZIP package deployment is configured. Skipping deploying app content to AWS S3.\n");
|
|
106
|
+
process.stdout.write('Deploy done.\n');
|
|
107
|
+
return [2, true];
|
|
108
|
+
}
|
|
109
|
+
sourceDirPath = isBuildHosted ? sourcePath + "-public" : sourcePath;
|
|
110
|
+
uploadPublicDir(sourceDirPath, uploadPath);
|
|
68
111
|
process.stdout.write('Deploy done.\n');
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
uploadPublicDir(sourceDirPath, uploadPath);
|
|
73
|
-
process.stdout.write('Deploy done.\n');
|
|
74
|
-
return true;
|
|
75
|
-
};
|
|
112
|
+
return [2, true];
|
|
113
|
+
});
|
|
114
|
+
}); };
|
|
76
115
|
exports.deployToS3 = deployToS3;
|
|
@@ -18,87 +18,156 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
31
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
32
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
|
+
function step(op) {
|
|
35
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
+
while (_) try {
|
|
37
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
|
+
switch (op[0]) {
|
|
40
|
+
case 0: case 1: t = op; break;
|
|
41
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
42
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
43
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
44
|
+
default:
|
|
45
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
46
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
47
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49
|
+
if (t[2]) _.ops.pop();
|
|
50
|
+
_.trys.pop(); continue;
|
|
51
|
+
}
|
|
52
|
+
op = body.call(thisArg, _);
|
|
53
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
|
+
}
|
|
56
|
+
};
|
|
21
57
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
58
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
59
|
};
|
|
24
|
-
|
|
60
|
+
exports.__esModule = true;
|
|
25
61
|
exports.deployHbbTV = void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
var path_1 = __importDefault(require("path"));
|
|
63
|
+
var fs_1 = __importDefault(require("fs"));
|
|
64
|
+
var nodessh = __importStar(require("node-ssh"));
|
|
65
|
+
var constants_1 = require("../../../constants");
|
|
66
|
+
var resolvers_1 = require("../../../resolvers");
|
|
67
|
+
var getSshKeyAbsolutePath = function (c, sshKeyRelativePath) {
|
|
32
68
|
if (!sshKeyRelativePath)
|
|
33
69
|
return '';
|
|
34
|
-
return path_1
|
|
70
|
+
return path_1["default"].join(c.paths.project.dir, sshKeyRelativePath);
|
|
35
71
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
var makeSshConnection = function (c) { return __awaiter(void 0, void 0, void 0, function () {
|
|
73
|
+
var _a, host, username, privateKeyRelativePath, privateKey, passphrase, ssh;
|
|
74
|
+
return __generator(this, function (_b) {
|
|
75
|
+
switch (_b.label) {
|
|
76
|
+
case 0:
|
|
77
|
+
_a = resolvers_1.resolveHbbtvDeployConfig(), host = _a.host, username = _a.username, privateKeyRelativePath = _a.privateKeyRelativePath;
|
|
78
|
+
privateKey = getSshKeyAbsolutePath(c, privateKeyRelativePath);
|
|
79
|
+
passphrase = process.env.CI_SSH_KEY_PASSPHRASE;
|
|
80
|
+
if (!privateKey || !passphrase) {
|
|
81
|
+
return [2, null];
|
|
82
|
+
}
|
|
83
|
+
ssh = new nodessh.NodeSSH();
|
|
84
|
+
return [4, ssh.connect({ host: host, username: username, privateKey: privateKey, passphrase: passphrase })];
|
|
85
|
+
case 1:
|
|
86
|
+
_b.sent();
|
|
87
|
+
return [2, ssh];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}); };
|
|
91
|
+
var getBuildPackageFileName = function (c) {
|
|
92
|
+
var packageOutputDirPath = c.runtime.appDir + "/output";
|
|
93
|
+
var outputFilenameList = fs_1["default"].readdirSync(packageOutputDirPath);
|
|
50
94
|
return outputFilenameList[0];
|
|
51
95
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return path_1
|
|
96
|
+
var getLocalBuildPackagePath = function (c) {
|
|
97
|
+
var fileName = getBuildPackageFileName(c);
|
|
98
|
+
return path_1["default"].join(c.runtime.appDir, 'output', fileName);
|
|
55
99
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
100
|
+
var resolveRemotePaths = function (c) {
|
|
101
|
+
var remoteBuildDirRelativePath = resolvers_1.resolveHbbtvRemoteBuildDirRelativePath(c);
|
|
102
|
+
var _a = resolvers_1.resolveHbbtvDeployConfig(), hostHomeDir = _a.hostHomeDir, dockerHtmlRootDir = _a.dockerHtmlRootDir;
|
|
103
|
+
var hostTempDirName = 'travis-ci-temp';
|
|
60
104
|
return {
|
|
61
|
-
serverTempDirPath:
|
|
62
|
-
dockerProjectDirPath:
|
|
105
|
+
serverTempDirPath: hostHomeDir + "/" + hostTempDirName + "/" + remoteBuildDirRelativePath,
|
|
106
|
+
dockerProjectDirPath: dockerHtmlRootDir + "/" + remoteBuildDirRelativePath
|
|
63
107
|
};
|
|
64
108
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
var log = function (msg) { return process.stdout.write(msg); };
|
|
110
|
+
var deployHbbTV = function (c) { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
|
+
var _a, scheme, appId, remotePaths, dockerContainerName, remotePackagePath, dockerExecPrefix, dockerAppDirPath, ssh, indexHtmlParentDirPath, sourcePath, destPath, cmd;
|
|
112
|
+
return __generator(this, function (_b) {
|
|
113
|
+
switch (_b.label) {
|
|
114
|
+
case 0:
|
|
115
|
+
if (c.platform !== constants_1.Platforms.HBBTV)
|
|
116
|
+
return [2];
|
|
117
|
+
_a = c.runtime, scheme = _a.scheme, appId = _a.appId;
|
|
118
|
+
log('HbbTV deploy via SSH.\n\n');
|
|
119
|
+
remotePaths = resolveRemotePaths(c);
|
|
120
|
+
dockerContainerName = resolvers_1.resolveHbbtvDeployConfig().dockerContainerName;
|
|
121
|
+
remotePackagePath = remotePaths.serverTempDirPath + "/" + getBuildPackageFileName(c);
|
|
122
|
+
dockerExecPrefix = "docker exec -t " + dockerContainerName;
|
|
123
|
+
dockerAppDirPath = remotePaths.dockerProjectDirPath;
|
|
124
|
+
log('Creating connection...\n');
|
|
125
|
+
return [4, makeSshConnection(c)];
|
|
126
|
+
case 1:
|
|
127
|
+
ssh = _b.sent();
|
|
128
|
+
if (ssh === null) {
|
|
129
|
+
throw new Error('Connection failed - check "privateKeyRelativePath" or "process.env.CI_SSH_KEY_PASSPHRASE" deploy params.');
|
|
130
|
+
}
|
|
131
|
+
log('Clearing temporary dir on host side...\n');
|
|
132
|
+
return [4, ssh.execCommand("rm -Rf " + remotePaths.serverTempDirPath)];
|
|
133
|
+
case 2:
|
|
134
|
+
_b.sent();
|
|
135
|
+
log('Transferring build package from local machine to host...\n');
|
|
136
|
+
return [4, ssh.putFile(getLocalBuildPackagePath(c), remotePackagePath)];
|
|
137
|
+
case 3:
|
|
138
|
+
_b.sent();
|
|
139
|
+
log('Unzipping transferred build package...\n');
|
|
140
|
+
return [4, ssh.execCommand("unzip " + remotePackagePath, { cwd: remotePaths.serverTempDirPath })];
|
|
141
|
+
case 4:
|
|
142
|
+
_b.sent();
|
|
143
|
+
log('Removing transferred build package...\n');
|
|
144
|
+
return [4, ssh.execCommand("rm " + remotePackagePath)];
|
|
145
|
+
case 5:
|
|
146
|
+
_b.sent();
|
|
147
|
+
log('Clearing docker dir on host side...\n');
|
|
148
|
+
return [4, ssh.execCommand(dockerExecPrefix + " rm -rf " + dockerAppDirPath)];
|
|
149
|
+
case 6:
|
|
150
|
+
_b.sent();
|
|
151
|
+
indexHtmlParentDirPath = dockerAppDirPath + "/public";
|
|
152
|
+
log('Creating requested path for build in docker...\n');
|
|
153
|
+
return [4, ssh.execCommand(dockerExecPrefix + " mkdir -p " + indexHtmlParentDirPath)];
|
|
154
|
+
case 7:
|
|
155
|
+
_b.sent();
|
|
156
|
+
log('Copying unzipped build package from host to host\'s docker path...\n');
|
|
157
|
+
sourcePath = remotePaths.serverTempDirPath + "/.";
|
|
158
|
+
destPath = dockerContainerName + ":" + indexHtmlParentDirPath;
|
|
159
|
+
cmd = "docker cp " + sourcePath + " " + destPath;
|
|
160
|
+
return [4, ssh.execCommand(cmd)];
|
|
161
|
+
case 8:
|
|
162
|
+
_b.sent();
|
|
163
|
+
log('Clearing temporary dir on host side...\n');
|
|
164
|
+
return [4, ssh.execCommand("rm -Rf " + remotePaths.serverTempDirPath)];
|
|
165
|
+
case 9:
|
|
166
|
+
_b.sent();
|
|
167
|
+
log("\nThe build is deployed at " + resolvers_1.resolveHbbtvDeployUrl(c, scheme, appId) + "\n");
|
|
168
|
+
log('Deploy done.\n');
|
|
169
|
+
return [2];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}); };
|
|
104
173
|
exports.deployHbbTV = deployHbbTV;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
exports.__esModule = true;
|
|
3
3
|
exports.engineTaskList = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
var task_rnv_build_1 = require("./task.rnv.build");
|
|
5
|
+
var task_rnv_configure_1 = require("./task.rnv.configure");
|
|
6
|
+
var task_rnv_configureSoft_1 = require("./task.rnv.configureSoft");
|
|
7
|
+
var task_rnv_deploy_1 = require("./task.rnv.deploy");
|
|
8
|
+
var task_rnv_hooks_run_1 = require("./task.rnv.hooks.run");
|
|
9
|
+
var task_rnv_package_1 = require("./task.rnv.package");
|
|
10
|
+
var task_rnv_start_1 = require("./task.rnv.start");
|
|
11
|
+
var task_rnv_project_configure_1 = require("./task.rnv.project.configure");
|
|
12
|
+
var engineTaskList = [
|
|
13
13
|
task_rnv_build_1.customRnvBuildTask,
|
|
14
14
|
task_rnv_configure_1.customRnvConfigureTask,
|
|
15
15
|
task_rnv_configureSoft_1.customRnvConfigureSoftTask,
|