Golang module
kind: golang/module
source | condition | target |
---|---|---|
✔ | ✔ | ✗ |
source
The Golang module "source" retrieves the Golang module version matching then versioning rule.
condition
The Golang module "condition" checks if the Golang module version matching then versioning rule exist.
target
the Golang module "target" is not supported.
Parameter
Name | Type | Description | Required |
---|---|---|---|
module | string | [S][C] Module specifies the name of the module | |
proxy | string | Proxy may have the schemes https, http. file is not supported at this time. If a URL has no scheme, https is assumed [S][C] Proxy allows to override GO proxy similarly to GOPROXY environment variable. | |
version | string | [C] Defines a specific package version | |
versionfilter | object | [S] VersionFilter provides parameters to specify version pattern 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 | |
strict | boolean | strict enforce strict versioning rule. Only used for semantic versioning at this time |
Example
# updatecli.yaml
name: "Golang module example"
sources:
default:
kind: golang/module
name: Get the latest Golang module version for github.com/Masterminds/semver/v3
spec:
module: "github.com/Masterminds/semver/v3"
semver:
kind: golang/module
name: Get Golang module version for github.com/Masterminds/semver/v3 matching version 3.2
spec:
module: "github.com/Masterminds/semver/v3"
versionfilter:
kind: semver
pattern: "3.2"
conditions:
default:
# The version is set by the sourceid "default"
kind: golang/module
name: Checks if version v3.2.0 exists for Golang module github.com/Masterminds/semver/v3
sourceid: default
spec:
module: "github.com/Masterminds/semver/v3"
noSourceInput:
disablesourceinput: true
kind: golang/module
name: Checks if version v3.2.0 exists for Golang module github.com/Masterminds/semver/v3
spec:
module: "github.com/Masterminds/semver/v3"
version: "v3.2.0"