-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathwatchrsync.js
executable file
·52 lines (44 loc) · 1.1 KB
/
watchrsync.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
#!/usr/bin/env node
const gri = require('gaze-run-interrupt');
if (!process.env.REMOTES) {
console.log("Usage: `REMOTES='[email protected],[email protected]' ./watchrsync.js`");
process.exit(1);
}
const list = ['build/install.sh', 'build/join.sh', 'build/upgrade.sh', 'build/tasks.sh', 'build/kustomize', 'build/manifests', 'build/addons']
if (!process.env.NO_BIN) {
list.push('build/krew', 'build/kurlkinds', 'build/helm', 'build/bin');
}
if (process.env.SYNC_KURL_UTIL_IMAGE) {
list.push('build/shared');
}
const commands = [
{
command: 'rm',
args: ['-rf'].concat(list),
},{
command: 'make',
args: list.concat('DEV=1'),
}
];
process.env.REMOTES.split(",").forEach(function(remote) {
commands.push({
command: 'rsync',
args: ['-r', 'build/install.sh', 'build/join.sh', 'build/upgrade.sh', 'build/tasks.sh', `${remote}:`],
});
commands.push({
command: 'rsync',
args: ['-r', 'build/', `${remote}:kurl`],
});
});
commands.push({
command: "date",
args: [],
});
commands.push({
command: "echo",
args: ["synced"],
});
gri([
'scripts/**/*',
'addons/**/*',
], commands);