-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbindown.schema.json
217 lines (217 loc) · 8.78 KB
/
bindown.schema.json
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://willabides.github.io/bindown/bindown.schema.json",
"$defs": {
"Dependency": {
"properties": {
"homepage": {
"type": "string",
"description": "The homepage for this dependency. Informational only."
},
"description": {
"type": "string",
"description": "A description of the dependency. Informational only."
},
"template": {
"type": "string",
"description": "A template for this dependency. Value is the name of a template in the templates section of this config.\nAny unset fields in this dependency will be set by values from the template. Overrides in the dependency\nand its template are concatenated with the template's overrides coming first. Vars and substitutions\nare both combined with the dependency's value taking precedence."
},
"url": {
"type": "string",
"description": "The url to download a dependency from."
},
"archive_path": {
"type": "string",
"description": "The path in the downloaded archive where the binary is located. Default is ./\u003cbin\u003e"
},
"bin": {
"type": "string",
"description": "The name of the binary to be installed. Default is the name of the dependency."
},
"link": {
"type": "boolean",
"description": "Whether to create a symlink to the bin instead of copying it."
},
"vars": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object",
"description": "A list of variables that can be used in 'url', 'archive_path' and 'bin'.\n\nTwo variables are always added based on the current environment: 'os' and 'arch'. Those are the operating\nsystem and architecture as defined by go's GOOS and GOARCH variables. I should document what those are\nsomewhere.\n\nYou can reference a variable using golang template syntax. For example, you could have a url set to\n`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`. If you define the var\n'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download\n`https://example.org/mydependency/v1.2.3/mydependency-linux-amd64.tar.gz`."
},
"overrides": {
"items": {
"$ref": "#/$defs/DependencyOverride"
},
"type": "array",
"description": "Overrides allows you to override values depending on the os and architecture of the target system."
},
"substitutions": {
"patternProperties": {
".*": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object",
"description": "Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is\na map of substitutions. { \"os\": { \"linux\": \"Linux\", \"darwin\": \"MacOS\" } } is an example of a substitution that\nwill update the os variable."
},
"systems": {
"items": {
"type": "string"
},
"type": "array",
"description": "List of systems this dependency supports. Systems are in the form of os/architecture."
},
"required_vars": {
"items": {
"type": "string"
},
"type": "array",
"description": "A list of variables that must be present for an install to succeed"
}
},
"additionalProperties": false,
"type": "object"
},
"DependencyOverride": {
"properties": {
"matcher": {
"patternProperties": {
".*": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object",
"description": "Limits the override to configurations matching all of the matchers. Keys may be \"os\", \"arch\" or any variable name.\nValues are an array of values to match. Any matching value will match. If a value can be interpreted as a\nsemantic version it will be treated as such."
},
"dependency": {
"$ref": "#/$defs/Overrideable",
"description": "Values to override the parent dependency"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"matcher",
"dependency"
]
},
"Overrideable": {
"properties": {
"url": {
"type": "string",
"description": "The url to download a dependency from."
},
"archive_path": {
"type": "string",
"description": "The path in the downloaded archive where the binary is located. Default is ./\u003cbin\u003e"
},
"bin": {
"type": "string",
"description": "The name of the binary to be installed. Default is the name of the dependency."
},
"link": {
"type": "boolean",
"description": "Whether to create a symlink to the bin instead of copying it."
},
"vars": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object",
"description": "A list of variables that can be used in 'url', 'archive_path' and 'bin'.\n\nTwo variables are always added based on the current environment: 'os' and 'arch'. Those are the operating\nsystem and architecture as defined by go's GOOS and GOARCH variables. I should document what those are\nsomewhere.\n\nYou can reference a variable using golang template syntax. For example, you could have a url set to\n`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`. If you define the var\n'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download\n`https://example.org/mydependency/v1.2.3/mydependency-linux-amd64.tar.gz`."
},
"overrides": {
"items": {
"$ref": "#/$defs/DependencyOverride"
},
"type": "array",
"description": "Overrides allows you to override values depending on the os and architecture of the target system."
},
"substitutions": {
"patternProperties": {
".*": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object",
"description": "Substitutions will substitute values from vars. The key is the name of the variable to substitute. The value is\na map of substitutions. { \"os\": { \"linux\": \"Linux\", \"darwin\": \"MacOS\" } } is an example of a substitution that\nwill update the os variable."
}
},
"additionalProperties": false,
"type": "object"
}
},
"properties": {
"cache": {
"type": "string",
"description": "The directory where bindown will cache downloads and extracted files. This is relative to the directory where\nthe configuration file resides. cache paths should always use / as a delimiter even on Windows or other\noperating systems where the native delimiter isn't /."
},
"install_dir": {
"type": "string",
"description": "The directory that bindown installs files to. This is relative to the directory where the configuration file\nresides. install_directory paths should always use / as a delimiter even on Windows or other operating systems\nwhere the native delimiter isn't /."
},
"systems": {
"items": {
"type": "string"
},
"type": "array",
"description": "List of systems supported by this config. Systems are in the form of os/architecture."
},
"dependencies": {
"patternProperties": {
".*": {
"$ref": "#/$defs/Dependency"
}
},
"type": "object",
"description": "Dependencies available for bindown to install."
},
"templates": {
"patternProperties": {
".*": {
"$ref": "#/$defs/Dependency"
}
},
"type": "object",
"description": "Templates that can be used by dependencies in this file."
},
"template_sources": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object",
"description": "Upstream sources for templates."
},
"url_checksums": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object",
"description": "Checksums of downloaded files."
}
},
"additionalProperties": false,
"type": "object"
}