-
Notifications
You must be signed in to change notification settings - Fork 3
/
manifest.example.js
198 lines (187 loc) · 4.98 KB
/
manifest.example.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
import os from 'os'
/* Prefix for all source paths
* except for unlinks and symlinks which use targetRoot below.
*
* Use process.cwd() for the current working directory.
*
* Default: the current working directory.
*/
const originRoot = os.homedir()
/* Prefix for all destination paths.
* For unlinks and symlinks, the source is also prefixed.
*
* Use process.cwd() for the current working directory.
*
* Default: a ./dest folder under the current working directory.
*/
const targetRoot = os.homedir()
/* Package lookup backend to use:
* pacman, dpkg, homebrew, pkgng, or noop.
*
* The special value noop will assume all packages are installed.
*
* Default: attempt to autodetect, fallback to noop.
*/
const pkgType = 'homebrew'
/* I/O backend to use:
* linux, macos, or noop.
*
* The special value noop will not perform any modifications
* and only log what actions would be taken.
*
* Default: attempt to autodetect, fallback to noop.
*/
const ioType = 'macos'
/* Defaults to use for each operation.
*
* Default: shown below.
*/
const defaults = {
order: 100, // all operations start with this order value
dmode: '0750', // files have user write, group read, other no access
fmode: '0640', // directories have user write, group read, other no access
user: process.getuid(), // current user
group: process.getgid() // current group
}
/* Operations to perform by type.
*
* Operations always happen in this order: unlinks, directories, files, and symlinks.
*
* Each type of operations waits until the previous type has completed successfully.
*
* Operations of each type with equal order value are always done in parallel,
* but operations with a later order do not start until earlier ones complete.
*
* Specifying an array of hostnames will restrict that
* operation to matching hosts (case insensitive).
*
* Specifying an array of packages will restrict that
* operation to hosts with all packages installed (case insensitive).
*
* All operation types will default to an empty array if unset.
*/
/* Unlink (unconditionally remove) the directory, file, or symlink at src.
*
* The src is relative to the global targetRoot option.
*/
const unlinks = [
{
// Remove ~/intruders on all hosts.
src: 'intruders'
},
{
// Remove ~/warpcore on host enterprise, if the eject package is installed.
src: 'warpcore',
hosts: ['enterprise'],
pkgs: ['eject']
}
]
/* Synchronize the contents of the directory at src to dst
* and sets the directory and file permissions.
*
* The src is relative to the global originRoot option.
* The dst is relative to the global targetRoot option.
*
* NOTE: this WILL remove files in dst that are not in src.
*
* If dst is not given, will use src as the subpath.
*/
const directories = [
{
// Synchronize ./holodeck to ~/holodeck on all hosts.
src: 'holodeck'
},
{
// Synchronize ./panels/exploding to ~/bridge/panels
// on hosts enterprise and defiant,
// if the turbolift and transporter packages are installed,
// and set specific user, group, and access permissions.
src: 'panels/exploding',
dst: 'bridge/panels',
user: 'numberone',
group: 'officers',
dmode: '0755',
fmode: '0644',
hosts: ['enterprise', 'defiant'],
pkgs: ['turbolift', 'transporter']
},
{
// Install sickbay first, then install the beds and meds.
src: 'decks/sickbay',
dst: 'sickbay',
order: 10
},
{
src: 'beds',
dst: 'sickbay/beds',
order: 11
},
{
src: 'meds',
dst: 'sickbay/meds',
order: 11
}
]
/* Copy the file at src to dst
* and sets the file permissions.
*
* The src is relative to the global originRoot option.
* The dst is relative to the global targetRoot option.
*
* NOTE: this WILL replace the file at dst.
*
* If dst is not given, will use src as the subpath.
*/
const files = [
{
// Copy ./bay/torpedo to ~/bay/torpedo on all hosts.
src: 'bay/torpedo'
},
{
// Copy ./phaser to ~/brig/phaser
// on host defiant, if the stun package is installed,
// and set the user, group, and access permissions.
src: 'phaser',
dst: 'brig/phaser',
user: 'warf',
group: 'security',
fmode: '0600',
hosts: ['defiant'],
pkgs: ['stun']
}
]
/* Create a system link (symlink) at src pointing to dst.
*
* The src and dst are relative to the global targetRoot option.
*
* NOTE: this WILL replace the file at src.
*/
const symlinks = [
{
// Create a symlink from ~/drink to ~/tea/earlgray/hot on all hosts.
src: 'drink',
dst: 'tea/earlgray/hot'
},
{
// Create a symlink from ~/hypospray to ~/hyposprays/norepinephrine
// on host enterprise if the sickbay package is installed.
src: 'hypospray',
dst: 'hyposprays/norepinephrine',
hosts: ['enterprise'],
pkgs: ['sickbay']
}
]
/* Export each value set above.
* Simply do not export an option to use the default.
*/
export default {
unlinks,
directories,
files,
symlinks,
originRoot,
targetRoot,
ioType,
pkgType,
defaults
}