Skip to content

Commit 6b91a0a

Browse files
authored
doc: init nomad autodiscovery plugin documentation (#2151)
* fix: add missing updatecli/values.d/releasepost.yaml * doc: init nomad autodiscovery plugin documentation * fix: cleanup local file changes
1 parent 4dd5c41 commit 6b91a0a

File tree

2 files changed

+122
-0
lines changed
  • assets/code_example/docs/plugins/autodiscovery/nomad/updatecli.d
  • content/en/docs/plugins/autodiscovery

2 files changed

+122
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Nomad autodiscovery using GitHub"
2+
scms:
3+
default:
4+
kind: github
5+
spec:
6+
owner: updatecli-test
7+
repository: nomad-demo
8+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
9+
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
10+
branch: master
11+
12+
actions:
13+
default:
14+
scmid: default
15+
kind: github/pullrequest
16+
spec:
17+
labels:
18+
- "dependencies"
19+
20+
autodiscovery:
21+
scmid: default
22+
actionid: default
23+
crawlers:
24+
nomad:
25+
ignore:
26+
- path: 'services/cache.nomad'
27+
# jobs:
28+
# - traefik
29+
# only:
30+
# # - path: <filepath relative from the scm repository>
31+
# jobs: <Nomad job name to match>
32+
# image: <docker image to match>
33+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: "Nomad"
3+
description: "Discover Docker image tag update from Nomad job files"
4+
lead: "kind: nomad"
5+
draft: false
6+
images: []
7+
menu:
8+
docs:
9+
parent: "plugin-autodiscovery"
10+
weight: 130
11+
toc: true
12+
plugins:
13+
- autodiscovery
14+
---
15+
16+
== Description
17+
18+
The Nomad crawler looks recursively for all Nomad manifests from a specific root directory.
19+
Then, for each of them, it tries to update each Docker image tag found.
20+
21+
Updatecli looks for the following file patterns:
22+
23+
* `*.nomad`
24+
* `*.hcl`
25+
26+
The automatic discovery behavior can be tuned by providing a YAML manifest with a `nomad` crawler in top-level directive `autodiscovery` as explained in the link:/docs/core/autodiscovery/#_parameters["Autodiscovery" page].
27+
28+
=== Usage
29+
30+
The nomad autodiscovery can use with or without manifest.
31+
32+
**Without manifest**
33+
34+
Without manifest available, Updatecli will enable all default crawlers, including nomad.
35+
36+
`updatecli diff` to run updatecli in dryrun
37+
`updatecli apply` to apply the changes locally
38+
39+
**With a manifest**
40+
41+
If a manifest is provided, Updatecli will only execute crawlers specified in the manifest such as in the following example
42+
43+
44+
* `updatecli diff --config updatecli.d/default.yaml` to run updatecli in dryrun
45+
* `updatecli apply --config updatecli.d/default.yaml` to apply the changes
46+
47+
[source,yaml]
48+
----
49+
# updatecli.d/default.yaml
50+
{{<include "assets/code_example/docs/plugins/autodiscovery/nomad/updatecli.d/default.yaml">}}
51+
----
52+
53+
== Manifest
54+
55+
=== Parameters
56+
57+
{{< autodiscoveryparameters "nomad" >}}
58+
59+
=== Docker Image Tag
60+
61+
The Docker ecosystem has no versioning guidelines. This means that it's the wild west out there and pretty much impossible to detect all cases. Hence why Updatecli manifest was created.
62+
63+
That being said we are still interested in an autodiscovery feature that would detect as many cases as possible.
64+
This section is about documentation what is covered and what's missing.
65+
Do not hesitate to look at the contributing section
66+
67+
**Semantic Versioning**
68+
69+
In the Docker ecosystem, many tags look like semver but are not.
70+
For instance, `node:18.12.1-alpine` would match the semver regular expression but the prerelease `-alpine` is not a prerelease information as per semver convention but a variant of `node:18.12.1-buster` or `node:18.12.1`.
71+
This means that we would expect a newer version with the `-alpine` such as `node:19.0.0-alpine`.
72+
73+
The docker-compose autodiscovery will handle the following scenarios
74+
75+
* `1` will suggest a version such `2` otherwise stick to `1`
76+
* `1-alpine` will suggest a version such `2-alpine` otherwise stick to `1-alpine`
77+
* `1.0` will suggest a version such `2.1` otherwise stick to `1.0`
78+
* `1.0-alpine` will suggest a version such `2.1-alpine` otherwise stick to `1.0-alpine`
79+
* `1.0.0` will suggest a version such `2.1.0` otherwise stick to `1.0.0`
80+
* `1.0.0-alpine` will suggest a version such `2.1.0-alpine` otherwise stick to `1.0.0-alpine`
81+
82+
Any other version pattern such as PEP 440 are ignored in the current state.
83+
We are planning to add new versionFilter kinds in the future as the need raise.
84+
85+
Feel free to:
86+
87+
1. Open an link:https://github.com/updatecli/updatecli/issues/new/choose[issue] explaining the version pattern you are looking for.
88+
2. Add a `+1` to an existing link:https://github.com/updatecli/updatecli/issues[issue] as it helps us to prioritise
89+
3. Contribute to an existing one as it will move things faster.

0 commit comments

Comments
 (0)