@24i/smartapps-bigscreen-rnv-build-engine 0.17.16 → 0.17.18
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.
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const child_process_1 = require("child_process");
|
|
4
|
+
const resolvers_1 = require("../resolvers");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const purgeCloudfrontCache = () => {
|
|
7
|
+
const alternateDomainName = process.argv[2];
|
|
8
|
+
const scheme = process.argv[3];
|
|
9
|
+
if (!scheme) {
|
|
10
|
+
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
11
|
+
}
|
|
12
|
+
console.log(`Alternative domain name is ${alternateDomainName}`);
|
|
13
|
+
const paths = getPathsToPurge(scheme);
|
|
14
|
+
const distributionId = (0, child_process_1.execSync)(`aws cloudfront list-distributions --query "DistributionList.Items[?Aliases.Items[0] == '${alternateDomainName}'].{Id:Id}" --output text`).toString().trim();
|
|
15
|
+
if (!distributionId) {
|
|
16
|
+
throw new Error('Distribution ID is empty. No matching distribution found for the given alternate domain name.');
|
|
17
|
+
}
|
|
18
|
+
console.log(`CloudFront Distribution ID: ${distributionId}`);
|
|
19
|
+
console.log(`Paths that will be purged: ${paths}`);
|
|
20
|
+
const result = (0, child_process_1.execSync)(`aws cloudfront create-invalidation --distribution-id "${distributionId}" --paths ${paths}`).toString();
|
|
21
|
+
console.log(result);
|
|
22
|
+
};
|
|
23
|
+
const getPathsToPurge = (scheme) => {
|
|
24
|
+
const supportedSet = getSupportedSet(scheme);
|
|
25
|
+
const env = (0, resolvers_1.resolveBuildEnvName)(scheme);
|
|
26
|
+
const paths = [];
|
|
27
|
+
if (scheme === constants_1.BuildSchemes.RC_PROD_LATEST) {
|
|
28
|
+
const limitedSet = getLimitedSetForRC(supportedSet);
|
|
29
|
+
limitedSet.forEach(({ platform, flavour }) => {
|
|
30
|
+
paths.push(`"/builds/${platform}/${flavour}/latest/rc/${env}*"`);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw new Error(`Not supported for scheme: ${scheme}`);
|
|
35
|
+
}
|
|
36
|
+
return paths.join(' ');
|
|
37
|
+
};
|
|
38
|
+
const getLimitedSetForRC = (supportedSet) => {
|
|
39
|
+
const limitedSet = [];
|
|
40
|
+
supportedSet.forEach((item) => {
|
|
41
|
+
if (item.flavour === 'animated_1080') {
|
|
42
|
+
limitedSet.push(item);
|
|
43
|
+
}
|
|
44
|
+
else if (item.flavour === 'animated_720') {
|
|
45
|
+
const platformSet = supportedSet.filter(({ platform }) => item.platform === platform);
|
|
46
|
+
const hasAnimated1080 = platformSet.find(({ flavour }) => flavour === 'animated_1080');
|
|
47
|
+
if (!hasAnimated1080) {
|
|
48
|
+
limitedSet.push(item);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return limitedSet;
|
|
53
|
+
};
|
|
54
|
+
const getSupportedSet = (scheme) => {
|
|
55
|
+
const supportedSet = [];
|
|
56
|
+
const c = (0, resolvers_1.getBaseConfig)();
|
|
57
|
+
const supportedPlatforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
|
|
58
|
+
supportedPlatforms.forEach((platform) => {
|
|
59
|
+
c.runtime.scheme = scheme;
|
|
60
|
+
const supportedFlavours = (0, resolvers_1.resolveSupportedFlavoursForPlatform)(c, platform);
|
|
61
|
+
supportedFlavours.forEach((flavour) => {
|
|
62
|
+
supportedSet.push({ scheme, platform, flavour });
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
return supportedSet;
|
|
66
|
+
};
|
|
67
|
+
const startTimestamp = Date.now();
|
|
68
|
+
purgeCloudfrontCache();
|
|
69
|
+
const msPerSecond = 1000;
|
|
70
|
+
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
71
|
+
console.log(`purgeCloudfrontCache: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -31,17 +31,21 @@ const smokeTest = async () => {
|
|
|
31
31
|
const command = process.argv[2];
|
|
32
32
|
const tokenId = process.env.SUITEST_TOKEN_ID ?? '';
|
|
33
33
|
const tokenPassword = process.env.SUITEST_TOKEN_PASSWORD ?? '';
|
|
34
|
+
const suitestUserName = process.env.SUITEST_USERNAME ?? '';
|
|
35
|
+
const suitestUserPassword = process.env.SUITEST_PASSWORD ?? '';
|
|
34
36
|
const logDir = './testbed_log/';
|
|
35
37
|
let cmd = command ?? [
|
|
36
38
|
`npx testbed run`,
|
|
37
39
|
tokenId ? `-k ${tokenId}` : '',
|
|
38
40
|
tokenPassword ? `-p ${tokenPassword}` : '',
|
|
39
|
-
`-
|
|
41
|
+
suitestUserName ? `-u ${suitestUserName}` : '',
|
|
42
|
+
suitestUserPassword ? `-up ${suitestUserPassword}` : '',
|
|
43
|
+
`-C .suitestrc_tizen`,
|
|
40
44
|
`--log-dir ${logDir}`,
|
|
41
45
|
`--log-level "normal"`,
|
|
42
46
|
`-- mocha "./test/platforms/common/smoke.test-suite.ts"`,
|
|
43
47
|
].filter(Boolean).join(' ');
|
|
44
|
-
const c = (0, resolvers_1.getBaseConfig)({ platform: constants_1.Platforms.
|
|
48
|
+
const c = (0, resolvers_1.getBaseConfig)({ platform: constants_1.Platforms.TIZEN });
|
|
45
49
|
const { status, suitestConfigId } = await (0, smokeTestUtils_1.execTestbedCmd)(cmd);
|
|
46
50
|
if (status) {
|
|
47
51
|
(0, smokeTestUtils_1.sendSuccessToSlack)(c, suitestConfigId);
|
|
@@ -168,6 +168,7 @@ function generateConfig(config) {
|
|
|
168
168
|
environment: config.environment,
|
|
169
169
|
baseUrl,
|
|
170
170
|
},
|
|
171
|
+
hash: true,
|
|
171
172
|
xhtml: PLATFORM === smartapps_bigscreen_rnv_build_engine_1.Constants.Platforms.HBBTV,
|
|
172
173
|
}),
|
|
173
174
|
harddisk: new html_webpack_harddisk_plugin_1.default(),
|
|
@@ -14,4 +14,5 @@
|
|
|
14
14
|
<tizen:privilege name="http://tizen.org/privilege/internet"/>
|
|
15
15
|
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
|
|
16
16
|
<tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
|
|
17
|
+
<tizen:metadata key="http://samsung.com/tv/metadata/use.voiceguide" value="false"/>
|
|
17
18
|
</widget>
|