Nomad
kind: nomad
Description
The Nomad crawler looks recursively for all Nomad manifests from a specific root directory. Then, for each of them, it tries to update each Docker image tag found.
Updatecli looks for the following file patterns:
*.nomad
*.hcl
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 "Autodiscovery" page.
Usage
The nomad autodiscovery can use with or without manifest.
Without manifest
Without manifest available, Updatecli will enable all default crawlers, including nomad.
updatecli diff
to run updatecli in dryrun
updatecli apply
to apply the changes locally
With a manifest
If a manifest is provided, Updatecli will only execute crawlers specified in the manifest such as in the following example
updatecli diff --config updatecli.d/default.yaml
to run updatecli in dryrunupdatecli apply --config updatecli.d/default.yaml
to apply the changes
# updatecli.d/default.yaml
name: "Nomad autodiscovery using GitHub"
scms:
default:
kind: github
spec:
owner: updatecli-test
repository: nomad-demo
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: master
actions:
default:
scmid: default
kind: github/pullrequest
spec:
labels:
- "dependencies"
autodiscovery:
scmid: default
actionid: default
crawlers:
nomad:
ignore:
- path: 'services/cache.nomad'
# jobs:
# - traefik
# only:
# # - path: <filepath relative from the scm repository>
# jobs: <Nomad job name to match>
# image: <docker image to match>
Manifest
Parameters
Name | Type | Description | Required |
---|---|---|---|
auths | object | auths provides a map of registry credentials where the key is the registry URL without scheme | |
digest | boolean | digest provides parameters to specify if the generated manifest should use a digest on top of the tag. | |
filematch | array | FileMatch allows to override default docker-compose.yaml file matching. Default [“docker-compose.yaml”,“docker-compose.yml”,“docker-compose..yaml”,“docker-compose..yml”] | |
ignore | array | ignore allows to specify rule to ignore autodiscovery a specific Helm based on a rule | |
images | array | Image specifies a list of docker image | |
jobs | array | Jobs specifies a list of Nomad job | |
path | string | Path specifies a Nomad path pattern, the pattern requires to match all of name, not just a substring. | |
only | array | only allows to specify rule to only autodiscover manifest for a specific Helm based on a rule | |
images | array | Image specifies a list of docker image | |
jobs | array | Jobs specifies a list of Nomad job | |
path | string | Path specifies a Nomad path pattern, the pattern requires to match all of name, not just a substring. | |
rootdir | string | rootDir defines the root directory used to recursively search for Nomad files If rootDir is not provided, the current working directory will be used. If rootDir is provided as an absolute path, scmID will be ignored. If rootDir is not provided but a scmid is, then rootDir will be set to the git repository root directory. | |
versionfilter | object | versionfilter provides parameters to specify the version pattern used when generating manifest. More information available at https://www.updatecli.io/docs/core/versionfilter/ kind - semver
versionfilter of kind kind - regex
versionfilter of kind example:
and its type like regex, semver, or just latest. | |
kind | string | specifies the version kind such as semver, regex, or latest | |
pattern | string | specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format | |
regex | string | specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used. | |
strict | boolean | strict enforce strict versioning rule. Only used for semantic versioning at this time |
Docker Image Tag
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.
That being said we are still interested in an autodiscovery feature that would detect as many cases as possible. This section is about documentation what is covered and what’s missing. Do not hesitate to look at the contributing section
Semantic Versioning
In the Docker ecosystem, many tags look like semver but are not.
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
.
This means that we would expect a newer version with the -alpine
such as node:19.0.0-alpine
.
The docker-compose autodiscovery will handle the following scenarios
1
will suggest a version such2
otherwise stick to1
1-alpine
will suggest a version such2-alpine
otherwise stick to1-alpine
1.0
will suggest a version such2.1
otherwise stick to1.0
1.0-alpine
will suggest a version such2.1-alpine
otherwise stick to1.0-alpine
1.0.0
will suggest a version such2.1.0
otherwise stick to1.0.0
1.0.0-alpine
will suggest a version such2.1.0-alpine
otherwise stick to1.0.0-alpine
Any other version pattern such as PEP 440 are ignored in the current state. We are planning to add new versionFilter kinds in the future as the need raise.
Feel free to: