Skip to content

Commit dabb6ea

Browse files
committed
docs: Document configuration options more
1 parent dfa0e7b commit dabb6ea

File tree

1 file changed

+43
-27
lines changed

1 file changed

+43
-27
lines changed

pyaptly/config.schema.json

+43-27
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
"title": "Pyaptly Configuration Schema",
55
"description": "The schema used for pyaptly configurations. See also https://github.com/adfinis/pyaptly/tree/main/pyaptly/tests for examples using the TOML language.",
66
"type": "object",
7+
"$defs": {
8+
"timestamp-reference": {
9+
"description": "if the 'current' (newest) snapshot should be used or the 'previous'ly created (e.g. from a week ago). Useful to delay a publish for a certain period.",
10+
"enum": [ "current", "previous", 0, 1 ]
11+
},
12+
"snapshot-reference": {
13+
"description": "A pointer to an existing snapshot.",
14+
"type": "object",
15+
"additionalProperties": false,
16+
"properties": {
17+
"name": { "type": "string", "description": "name of the snapshot" },
18+
"timestamp": { "$ref": "#/$defs/timestamp-reference" }
19+
}
20+
}
21+
},
722
"examples": [
823
{
924
"mirror": {
@@ -79,16 +94,16 @@
7994
"patternProperties": { ".*": {
8095
"type": "object", "additionalProperties": false,
8196
"properties": {
82-
"archive": { "type": "string", "description": "The URL of a remote archive to sync" },
83-
"architectures": { "type": "array", "description": "A list of architectures. E.g. ['amd64']", "items": { "type": "string" } },
84-
"components": { "type": ["array", "string"], "description": "A single component or list of components to download", "items": { "type": "string" } },
85-
"distribution": { "type": "string", "description": "The Distribution of the mirror, e.g. 'squeeze'. Use './' for flat repositories." },
97+
"archive": { "type": "string", "description": "The aptly 'archive' argument" },
98+
"architectures": { "type": "array", "description": "Set '-architectures' for aptly", "items": { "type": "string" } },
99+
"components": { "type": ["array", "string"], "description": "The aptly 'component' arguments", "items": { "type": "string" } },
100+
"distribution": { "type": "string", "description": "The aptly 'distribution' argument" },
86101
"gpg-keys": { "type": "array", "description": "List of GPG Key Fingerprints used to sign the packages and metadata", "items": { "type": "string" } },
87102
"gpg-urls": { "type": "array", "description": "List of URLs to retrieve the GPG keys", "items": { "type": "string" } },
88103
"keyserver": { "type": "string", "description": "A PGP Key Server to retrieve keys for verification" },
89-
"max-tries": { "type": "integer", "description": "Number of tries when updating package contents" },
90-
"sources": { "type": "boolean", "description": "If '-with-sources' should be passed to aptly" },
91-
"udeb": { "type": "boolean", "description": "If '-with-udebs' should be passed to aptly" }
104+
"max-tries": { "type": "integer", "description": "Set '-max-tries' for 'aptly repo update'" },
105+
"sources": { "type": "boolean", "description": "Set '-with-sources' for aptly" },
106+
"udeb": { "type": "boolean", "description": "Set '-with-udebs' for aptly" }
92107
}
93108
} }
94109
},
@@ -111,35 +126,35 @@
111126
}
112127
}
113128
],
114-
"patternProperties": { ".*": {
129+
"patternProperties": {
130+
".*": {
115131
"type": "object", "additionalProperties": false,
116132
"properties": {
117133
"filter": { "type": "object", "additionalProperties": false, "properties": {
118134
"query": { "type": "string" },
119-
"source": { "type": "object", "additionalProperties": false, "properties": {
120-
"name": { "type": "string" },
121-
"timestamp": { "type": "string" }
122-
} }
123-
} },
135+
"source": { "$ref": "#/$defs/snapshot-reference" }
136+
}
137+
},
124138
"merge": {
125139
"type": "array",
126140
"items": {
127141
"type": ["string", "object"],
128142
"properties": {
129143
"name": { "type": "string" },
130-
"timestamp": { "enum": ["current", "previous", 0] }
144+
"timestamp": { }
131145
}
132146
}
133147
},
134148
"mirror": { "type": "string" },
135149
"timestamp": { "type": "object", "additionalProperties": false, "properties": {
136150
"time": { "type": "string" },
137-
"repeat-weekly": { "type": "string" }
151+
"repeat-weekly": { "enum": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] }
138152
}
139153
},
140154
"repo": { "type": "string" }
141155
}
142-
} }
156+
}
157+
}
143158
},
144159
"publish": {
145160
"type": "object", "additionalProperties": false,
@@ -175,18 +190,19 @@
175190
"patternProperties": { ".*": {
176191
"type": "array", "items": { "type": "object", "additionalProperties": false,
177192
"properties": {
178-
"architectures": { "type": "array", "description": "Which architectures should be in the publish", "items": { "type": "string" } },
193+
"architectures": { "type": "array", "description": "Set '-architectures' for aptly", "items": { "type": "string" } },
179194
"automatic-update": { "type": "boolean", "description": "If the publish should be updated when it's not explicitly mentioned as argument to pyaptly" },
180-
"components": { "type": ["array", "string"], "description": "A single component or list of components to download", "items": { "type": "string" } },
181-
"distribution": { "type": "string" },
182-
"gpg-key": { "type": "string" },
183-
"publish": { "type": "string" },
184-
"repo": { "type": "string" },
185-
"skip-contents": { "type": "boolean" },
186-
"snapshots": { "type": "array", "items": { "type": ["object", "string"], "additionalProperties": false, "properties": {
187-
"name": { "type": "string" },
188-
"timestamp": { "type": "string" },
189-
"archive-on-update": { "type": "string" }
195+
"components": { "type": ["array", "string"], "description": "Set '-component' for aptly", "items": { "type": "string" } },
196+
"distribution": { "type": "string", "description": "Set '-distribution' for aptly" },
197+
"gpg-key": { "type": "string", "description": "Set '-gpg-key' for aptly" },
198+
"publish": { "type": "string", "description": "Use the snapshots of another named publish. Space separated name and component. E.g. 'fakerepo01 main'" },
199+
"repo": { "type": "string", "description": "Use 'publish repo' with this repo name" },
200+
"skip-contents": { "type": "boolean", "description": "Set '-skip-contents' for aptly" },
201+
"snapshots": { "type": "array", "description": "A list of snapshots to be merged", "items": {
202+
"type": ["object", "string"], "additionalProperties": false, "properties": {
203+
"name": { "type": "string", "description": "Name of the snapshot" },
204+
"timestamp": { "$ref": "#/$defs/timestamp-reference" },
205+
"archive-on-update": { "type": "string", "description": "Rename the Snapshot to this and replace %T with the current timestamp on update. E.g. 'archive-snap-%T'" }
190206
} } }
191207
} }
192208
} }

0 commit comments

Comments
 (0)