diff --git a/pkg/config/config.go b/pkg/config/config.go index cdbd4e2e3..721196f32 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -479,6 +479,8 @@ type Update struct { ReleaseMonitor *ReleaseMonitor `json:"release-monitor,omitempty" yaml:"release-monitor,omitempty"` // The configuration block for updates tracked via the Github API GitHubMonitor *GitHubMonitor `json:"github,omitempty" yaml:"github,omitempty"` + // The configuration block for updates tracked via the GitLab rest API + GitLabMonitor *GitLabMonitor `json:"gitlab,omitempty" yaml:"gitlab,omitempty"` // The configuration block for transforming the `package.version` into an APK version VersionTransform []VersionTransform `json:"version-transform,omitempty" yaml:"version-transform,omitempty"` } @@ -513,6 +515,23 @@ type GitHubMonitor struct { UseTags bool `json:"use-tag,omitempty" yaml:"use-tag,omitempty"` } +// GitLabMonitor indicates using the GitLab API +type GitLabMonitor struct { + // Org/Subgroup/repo for GitLab + Identifier string `json:"identifier" yaml:"identifier"` + // If the version in GitLab contains a prefix which should be ignored + StripPrefix string `json:"strip-prefix,omitempty" yaml:"strip-prefix,omitempty"` + // If the version in GitLab contains a suffix which should be ignored + StripSuffix string `json:"strip-suffix,omitempty" yaml:"strip-suffix,omitempty"` + // Prefix filter to apply when searching tags on a GitLab repository + TagFilterPrefix string `json:"tag-filter-prefix,omitempty" yaml:"tag-filter-prefix,omitempty"` + // Filter to apply when searching tags on a GitLab repository + TagFilterContains string `json:"tag-filter-contains,omitempty" yaml:"tag-filter-contains,omitempty"` + // Override the default of using a GitLab release to identify related tag to + // fetch. Not all projects use GitLab releases but just use tags + UseTags bool `json:"use-tag,omitempty" yaml:"use-tag,omitempty"` +} + // VersionTransform allows mapping the package version to an APK version type VersionTransform struct { // Required: The regular expression to match against the `package.version` variable diff --git a/pkg/config/schema.json b/pkg/config/schema.json index 5ad118243..0f917b9f8 100644 --- a/pkg/config/schema.json +++ b/pkg/config/schema.json @@ -250,6 +250,40 @@ ], "description": "GitHubMonitor indicates using the GitHub API" }, + "GitLabMonitor": { + "properties": { + "identifier": { + "type": "string", + "description": "Org/Subgroup/repo for GitLab" + }, + "strip-prefix": { + "type": "string", + "description": "If the version in GitLab contains a prefix which should be ignored" + }, + "strip-suffix": { + "type": "string", + "description": "If the version in GitLab contains a suffix which should be ignored" + }, + "tag-filter-prefix": { + "type": "string", + "description": "Prefix filter to apply when searching tags on a GitLab repository" + }, + "tag-filter-contains": { + "type": "string", + "description": "Filter to apply when searching tags on a GitLab repository" + }, + "use-tag": { + "type": "boolean", + "description": "Override the default of using a GitLab release to identify related tag to\nfetch. Not all projects use GitLab releases but just use tags" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "identifier" + ], + "description": "GitLabMonitor indicates using the GitLab API" + }, "Group": { "properties": { "groupname": { @@ -900,6 +934,10 @@ "$ref": "#/$defs/GitHubMonitor", "description": "The configuration block for updates tracked via the Github API" }, + "gitlab": { + "$ref": "#/$defs/GitLabMonitor", + "description": "The configuration block for updates tracked via the GitLab rest API" + }, "version-transform": { "items": { "$ref": "#/$defs/VersionTransform"