-
Notifications
You must be signed in to change notification settings - Fork 2
/
bindown.schema.yml
189 lines (185 loc) · 7.47 KB
/
bindown.schema.yml
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
$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.
Any unset fields in this dependency will be set by values from the template. Overrides in the dependency
and its template are concatenated with the template's overrides coming first. Vars and substitutions
are 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 ./<bin>
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'.
Two variables are always added based on the current environment: 'os' and 'arch'. Those are the operating
system and architecture as defined by go's GOOS and GOARCH variables. I should document what those are
somewhere.
You can reference a variable using golang template syntax. For example, you could have a url set to
`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`. If you define the var
'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download
`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
a map of substitutions. { "os": { "linux": "Linux", "darwin": "MacOS" } } is an example of a substitution that
will 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.
Values are an array of values to match. Any matching value will match. If a value can be interpreted as a
semantic 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 ./<bin>
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'.
Two variables are always added based on the current environment: 'os' and 'arch'. Those are the operating
system and architecture as defined by go's GOOS and GOARCH variables. I should document what those are
somewhere.
You can reference a variable using golang template syntax. For example, you could have a url set to
`https://example.org/mydependency/v{{.version}}/mydependency-{{.os}}-{{.arch}}.tar.gz`. If you define the var
'version: 1.2.3' and run bindown on a 64-bit Linux system, it will download
`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
a map of substitutions. { "os": { "linux": "Linux", "darwin": "MacOS" } } is an example of a substitution that
will 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
the configuration file resides. cache paths should always use / as a delimiter even on Windows or other
operating 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
resides. install_directory paths should always use / as a delimiter even on Windows or other operating systems
where 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