-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add updatecli autodiscovery policy
Signed-off-by: Olivier Vernin <[email protected]>
- Loading branch information
Showing
6 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
|
||
## 0.2.0 | ||
|
||
* Set default groupby to "all" | ||
* Set pipelineid | ||
* Update pipeline name | ||
* Swap default order for scm configuration to use environment variable if nothing else is defined | ||
|
||
## 0.1.0 | ||
|
||
* Init policy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
authors: | ||
- Olblak <[email protected]> | ||
|
||
url: "https://github.com/updatecli/policies/" | ||
documentation: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/updatecli/README.md" | ||
source: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/updatecli/" | ||
version: 0.2.0 | ||
vendor: Updatecli Project | ||
|
||
licenses: | ||
- "Apache-2.0 license" | ||
|
||
description: | | ||
Updatecli Autodiscovery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# README | ||
|
||
This Updatecli policy tries to detected available Updatecli policies update in file `update-compose.yaml` |
10 changes: 10 additions & 0 deletions
10
updatecli/policies/autodiscovery/updatecli/testdata/values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
scm: | ||
enabled: true | ||
user: updatecli-bot | ||
email: [email protected] | ||
owner: updatecli | ||
repository: website | ||
#token: "xxx" | ||
username: "updatecli-bot" | ||
branch: master | ||
|
45 changes: 45 additions & 0 deletions
45
updatecli/policies/autodiscovery/updatecli/updatecli.d/default.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
# Helpers | ||
# {{ $GitHubUser := env ""}} | ||
# {{ $GitHubRepositoryList := env "GITHUB_REPOSITORY" | split "/"}} | ||
# {{ $GitHubPAT := env "GITHUB_TOKEN"}} | ||
# {{ $GitHubUsername := env "GITHUB_ACTOR"}} | ||
|
||
name: "deps(updatecli): bump all policies" | ||
pipelineid: {{ .pipelineid }} | ||
|
||
autodiscovery: | ||
groupby: {{ .groupby }} | ||
#{{ if or (.scm.enabled) (env "GITHUB_REPOSITORY") }} | ||
scmid: default | ||
actionid: default | ||
# {{ end }} | ||
|
||
crawlers: | ||
updatecli: | ||
{{ .spec | toYaml | indent 6 }} | ||
|
||
{{ if or (.scm.enabled) (env "GITHUB_REPOSITORY") }} | ||
scms: | ||
default: | ||
kind: "github" | ||
spec: | ||
# Priority set to the environment variable | ||
user: '{{ default $GitHubUser .scm.user }}' | ||
email: '{{ .scm.email }}' | ||
owner: '{{ default $GitHubRepositoryList._0 .scm.owner }}' | ||
repository: '{{ default $GitHubRepositoryList._1 .scm.repository }}' | ||
token: '{{ default $GitHubPAT .scm.token }}' | ||
username: '{{ default $GitHubUsername .scm.username }}' | ||
branch: '{{ .scm.branch }}' | ||
|
||
actions: | ||
default: | ||
kind: "github/pullrequest" | ||
scmid: "default" | ||
spec: | ||
automerge: {{ .automerge }} | ||
labels: | ||
- dependencies | ||
{{ end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pipelineid: updatecli_policies | ||
automerge: false | ||
|
||
scm: | ||
enabled: false | ||
user: updatecli-bot | ||
#email: [email protected] | ||
#owner: updatecli | ||
#repository: "repository" | ||
#token: "xxx" | ||
username: "updatecli-bot" | ||
branch: main | ||
|
||
# spec: | ||
groupby: all | ||
|