Skip to content

Commit

Permalink
Add gitlab monitor update configuration
Browse files Browse the repository at this point in the history
Signed-off-by: debasishbsws <debasishbsws.dev@gmail.com>
  • Loading branch information
debasishbsws committed Jul 2, 2024
1 parent 5651eee commit 57203cc
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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 GitHub repository
TagFilterPrefix string `json:"tag-filter-prefix,omitempty" yaml:"tag-filter-prefix,omitempty"`
// Filter to apply when searching tags on a GitHub repository
TagFilterContains string `json:"tag-filter-contains,omitempty" yaml:"tag-filter-contains,omitempty"`
// Override the default of using a GitHub release to identify related tag to
// fetch. Not all projects use GitHub 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
Expand Down
38 changes: 38 additions & 0 deletions pkg/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 GitHub repository"
},
"tag-filter-contains": {
"type": "string",
"description": "Filter to apply when searching tags on a GitHub repository"
},
"use-tag": {
"type": "boolean",
"description": "Override the default of using a GitHub release to identify related tag to\nfetch. Not all projects use GitHub releases but just use tags"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"identifier"
],
"description": "GitLabMonitor indicates using the GitLab API"
},
"Group": {
"properties": {
"groupname": {
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 57203cc

Please sign in to comment.