Skip to content

Commit

Permalink
YAMLize netkan spec
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Sep 17, 2021
1 parent c087675 commit 05e3f33
Showing 1 changed file with 26 additions and 42 deletions.
68 changes: 26 additions & 42 deletions Spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ consumes `.netkan` files to produce `.ckan` files. `.netkan` files are a *strict

##### YAML Option

A `.netkan` file may be in either JSON or YAML format. All examples shown below assume JSON, but the YAML equivalents will work the same way.
A `.netkan` file may be in either JSON or YAML format. All examples shown below assume YAML, but the JSON equivalents will work the same way.

Note that `#` is the comment character in YAML, so even if you choose YAML syntax, you still can't omit the quotes around a value that includes `#`, such as typical values of `$kref` and `$vref`:

Expand Down Expand Up @@ -790,10 +790,8 @@ Optionally, one of `asset_match` with `:filter_regexp` *or* `version_from_asset`

An example `.netkan` excerpt:

```json
{
"$kref": "#/ckan/github/pjf/DogeCoinFlag/version_from_asset/^DogeCoinFlag-(?<version>.+).zip$"
}
```yaml
$kref: '#/ckan/github/pjf/DogeCoinFlag/version_from_asset/^DogeCoinFlag-(?<version>.+).zip$'
```

An `x_netkan_github` field may be provided to customize how the metadata is fetched from GitHub. It is an `object` with the following fields:
Expand Down Expand Up @@ -822,7 +820,7 @@ an `object` with the following fields:
Specifies the type of build to use. Possible values are `"any"`, `"completed"`, `"failed"`, `"stable"`,
`"successful"`, `"unstable"`, or `"unsuccessful"`. Many of these values do not make sense to use in practice but
are provided for completeness.
- `asset_match` (type: `string`, regex) (default: `"\\.zip$"`)<br/>
- `asset_match` (type: `string`, regex) (default: `"\.zip$"`)<br/>
Specifies a regex which selects which artifact to use by filename (case-insensitively). Not having exactly one
matching asset is an error.
- `use_filename_version` (type: `boolean`, default: `false`)<br/>
Expand All @@ -835,15 +833,12 @@ If any options are not present their default values are used.

An example `.netkan` excerpt:

```json
{
"$kref": "#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/",
"x_netkan_jenkins": {
"build": "stable",
"asset_match": "\\.zip$",
"use_filename_version": false
}
}
```yaml
$kref: '#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/'
x_netkan_jenkins:
build: stable
asset_match: \.zip$
use_filename_version: false
```

###### `#/ckan/http/:url`
Expand Down Expand Up @@ -896,12 +891,10 @@ The following conditions apply:

An example `.netkan` including all required fields for a valid metanetkan:

```json
{
"spec_version": 1,
"identifier": "AwesomeMod",
"$kref": "#/ckan/netkan/https://www.kspmods.example/AwesomeMod.netkan"
}
```yaml
spec_version: 1,
identifier: AwesomeMod
$kref: '#/ckan/netkan/https://www.kspmods.example/AwesomeMod.netkan'
```

##### `$vref`
Expand Down Expand Up @@ -949,10 +942,8 @@ release.

An example `.netkan` excerpt:

```json
{
"x_netkan_epoch": 1
}
```yaml
x_netkan_epoch: 1
```

##### `x_netkan_allow_out_of_order`
Expand All @@ -966,10 +957,8 @@ of order version.

An example `.netkan` excerpt:

```json
{
"x_netkan_allow_out_of_order": true
}
```yaml
x_netkan_allow_out_of_order: true
```

##### `x_netkan_force_v`
Expand All @@ -982,10 +971,8 @@ field *only* contains the actual version string.

An example `.netkan` excerpt:

```json
{
"x_netkan_force_v": true
}
```yaml
x_netkan_force_v: true
```

##### `x_netkan_version_edit`
Expand All @@ -1008,15 +995,12 @@ the default values for the `replace` and `strict` fields are used.

An example `.netkan` excerpt:

```json
{
"$kref": "#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/",
"x_netkan_version_edit": {
"find": "^[vV]?(?<version>.+)$",
"replace": "${version}",
"strict": true
}
}
```yaml
$kref: '#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/'
x_netkan_version_edit:
find: ^[vV]?(?<version>.+)$
replace: ${version}
strict: true
```

##### `x_netkan_override`
Expand Down

0 comments on commit 05e3f33

Please sign in to comment.