Skip to content

Commit

Permalink
optional fields
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
  • Loading branch information
sozercan committed Jul 8, 2024
1 parent ca7e9a6 commit 9a11e47
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions website/docs/build-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ We define the metadata of the package in the spec. This includes the name, packa
name: go-md2man
version: 2.0.3
revision: "1"
packager: Dalec Example
vendor: Dalec Example
license: MIT
description: A tool to convert markdown into man pages (roff).
packager: Dalec Example
vendor: Dalec Example
website: https://github.com/cpuguy83/go-md2man
```
:::tip
In metadata section, `packager`, `vendor` and `website` are optional fields.
:::

In the next section, we define the sources that we will be pulling from. In this case, we are pulling from a git repository.

One thing to note, in many build systems you will not have access to the Internet while building the package, and indeed that is the case with the `mariner2` target. As such, this build will fail because `go build` will try to download the go modules. For this reason, we added a `generate` section to the source to run `go mod download` in a docker image with the `src` source mounted and then extract the go modules from the resulting filesystem.
Expand Down
14 changes: 7 additions & 7 deletions website/docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ args:
## Metadata section
Metadata section is a required section. It is used to define the metadata of the spec. This metadata includes the name, packager, vendor, license, website, and description of the spec.
Metadata section is used to define the metadata of the spec. This metadata includes the name, packager, vendor, license, website, and description of the spec.
```yaml
name: My-Package
packager: Dalec Authors
vendor: Contoso
license: Apache-2.0
website: https://github.com/foo/bar
description: This is a sample package
version: ${VERSION}
revision: ${REVISION}
packager: Dalec Authors
vendor: Dalec Authors
website: https://github.com/foo/bar
```
- `name`: The name of the package.
- `packager`: The packager of the package.
- `vendor`: The vendor of the package.
- `license`: The license of the package.
- `website`: The website of the package.
- `description`: The description of the package.
- `version`: The version of the package.
- `revision`: The revision of the package.
- `packager`: The packager of the package. This is an optional field.
- `vendor`: The vendor of the package. This is an optional field.
- `website`: The website of the package. This is an optional field.

:::tip
Any field at the top-level that begins with `x-` will be ignored by Dalec. This allows for custom fields to be added to the spec. For example, `x-foo: bar`. Any other field that is not recognized by Dalec will result in a validation error.
Expand Down

0 comments on commit 9a11e47

Please sign in to comment.