This repository has been archived by the owner on Sep 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
cache.js
87 lines (76 loc) · 3.4 KB
/
cache.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { Scheduler } from 'taskcluster-client';
import run from './run';
import { generateCacheGraph, generateCloneTaskDefinition, generateRepoCacheTaskDefinition } from './task';
// import cache config
async function main(argv) {
var clones = [
'https://github.com/walac/gecko-dev',
'https://github.com/lightsofapollo/build-mozharness',
'https://hg.mozilla.org/build/mozharness',
'https://hg.mozilla.org/build/tools',
'https://hg.mozilla.org/mozilla-central',
'https://hg.mozilla.org/mozilla-central/',
'https://hg.mozilla.org/integration/b2g-inbound/',
'https://hg.mozilla.org/integration/b2g-inbound',
'https://hg.mozilla.org/integration/mozilla-inbound',
'https://hg.mozilla.org/integration/mozilla-inbound/',
'https://hg.mozilla.org/integration/gaia',
'https://hg.mozilla.org/integration/gaia/',
'https://hg.mozilla.org/integration/gaia-2_5',
'https://hg.mozilla.org/integration/gaia-2_5/',
'https://hg.mozilla.org/integration/gaia-2_2r',
'https://hg.mozilla.org/integration/gaia-2_2r/',
'https://hg.mozilla.org/integration/fx-team/',
'https://hg.mozilla.org/integration/fx-team',
'https://git.mozilla.org/b2g/B2G.git',
'https://hg.mozilla.org/integration/gaia-central',
'https://hg.mozilla.org/integration/gaia-central/',
'https://git.mozilla.org/b2g/B2G',
'https://github.com/mozilla-b2g/gaia',
'https://github.com/mozilla-b2g/B2G',
'https://github.com/mozilla-b2g/B2G-manifest',
'https://github.com/mozilla-b2g/moztt',
'https://github.com/mozilla/gecko-dev',
'https://git.mozilla.org/build/tooltool.git',
'https://git.mozilla.org/external/google/gerrit/git-repo.git',
'https://hg.mozilla.org/projects/alder',
'https://hg.mozilla.org/projects/alder/',
'https://hg.mozilla.org/releases/mozilla-b2g34_v2_1',
'https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/',
'https://hg.mozilla.org/releases/mozilla-b2g37_v2_2r',
'https://hg.mozilla.org/releases/mozilla-b2g37_v2_2r/',
'https://hg.mozilla.org/releases/mozilla-b2g37_v2_2r/',
'https://hg.mozilla.org/releases/mozilla-b2g44_v2_5',
'https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/',
'https://hg.mozilla.org/releases/b2g-ota',
'https://hg.mozilla.org/releases/b2g-ota/'
];
var emulators = [
['emulator_url', 'emulator-ics'],
['emulator_url', 'emulator'],
['emulator_url', 'emulator-jb'],
['emulator_url', 'emulator-kk'],
['emulator_url', 'aries'],
['emulator_url', 'nexus-5-l'],
['emulator_url', 'emulator-l'],
['g_emulator_url', 'emulator.xml'],
['g_emulator_url', 'emulator-jb.xml'],
['g_emulator_url', 'emulator-kk.xml'],
['g_emulator_url', 'emulator-l.xml']
];
var scheduler = new Scheduler();
var tasks = [];
for (var url of clones) {
tasks.push(generateCloneTaskDefinition(url));
}
for (var emulator of emulators) {
tasks.push(generateRepoCacheTaskDefinition(emulator[1], emulator[0]));
}
let {graphId, graph} = generateCacheGraph(tasks);
console.log(`Creating cache graph '${graphId}'`);
await scheduler.createTaskGraph(graphId, graph);
};
main(process.argv).catch((err) => {
console.log(JSON.stringify(err));
process.exit(1);
});