Skip to content

Commit

Permalink
Merge branch 'main' into feature/bump-updatecli-discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
olblak authored Sep 8, 2024
2 parents 5640cc3 + 5e9c3dd commit 0aed20f
Show file tree
Hide file tree
Showing 14 changed files with 206 additions and 0 deletions.
5 changes: 5 additions & 0 deletions updatecli/policies/autodiscovery/prow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0

* Init policy
14 changes: 14 additions & 0 deletions updatecli/policies/autodiscovery/prow/Policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
authors:
- loispostula <lois@postu.la>

url: "https://github.com/updatecli/policies/"
documentation: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/prow/README.md"
source: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/prow/"
version: 0.1.0
vendor: Updatecli Project

licenses:
- "Apache-2.0 license"

description: |
Prow Autodiscovery
3 changes: 3 additions & 0 deletions updatecli/policies/autodiscovery/prow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# README

This Updatecli policy tries to detected available Prow update.
10 changes: 10 additions & 0 deletions updatecli/policies/autodiscovery/prow/testdata/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
scm:
enabled: true
user: updatecli-bot
email: updatecli-bot@updatecli.io
owner: infra.git
repository: infra
#token: "xxx"
username: "updatecli-bot"
branch: master

50 changes: 50 additions & 0 deletions updatecli/policies/autodiscovery/prow/updatecli.d/default.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# Helpers
# {{ $GitHubUser := env ""}}
# {{ $GitHubRepositoryList := env "GITHUB_REPOSITORY" | split "/"}}
# {{ $GitHubPAT := env "GITHUB_TOKEN"}}
# {{ $GitHubUsername := env "GITHUB_ACTOR"}}

name: '{{ .name }}'
#{{ if .pipelineid }}
pipelineid: '{{ .pipelineid }}'
#{{ end }}

autodiscovery:
groupby: {{ .groupby }}
#{{ if or (.scm.enabled) (env "GITHUB_REPOSITORY") }}
scmid: default
actionid: default
# {{ end }}

crawlers:
prow:
{{ .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 }}'
#{{ if .scm.commitusingapi }}
commitusingapi: {{ .scm.commitusingapi }}
# {{ end }}

actions:
default:
kind: "github/pullrequest"
scmid: "default"
spec:
automerge: {{ .automerge }}
labels:
- dependencies
{{ end }}

18 changes: 18 additions & 0 deletions updatecli/policies/autodiscovery/prow/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "deps(prow): bump all dependencies"
#pipelineid: prow/autodiscovery
automerge: false

scm:
enabled: false
user: updatecli-bot
#email: updatecli-bot@updatecli.io
#owner: updatecli
#repository: "repository"
#token: "xxx"
username: "updatecli-bot"
branch: main
# commitusingapi: false

# spec:
groupby: all

5 changes: 5 additions & 0 deletions updatecli/policies/autodiscovery/terragrunt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0

* Init policy
14 changes: 14 additions & 0 deletions updatecli/policies/autodiscovery/terragrunt/Policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
authors:
- loispostula <lois@postu.la>

url: "https://github.com/updatecli/policies/"
documentation: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/terragrunt/README.md"
source: "https://github.com/updatecli/policies/tree/main/updatecli/policies/autodiscovery/terragrunt/"
version: 0.1.0
vendor: Updatecli Project

licenses:
- "Apache-2.0 license"

description: |
Terragrunt Autodiscovery
3 changes: 3 additions & 0 deletions updatecli/policies/autodiscovery/terragrunt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# README

This Updatecli policy tries to detected available terraform module update in terragrunt files`.
10 changes: 10 additions & 0 deletions updatecli/policies/autodiscovery/terragrunt/testdata/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
scm:
enabled: true
user: updatecli-bot
email: updatecli-bot@updatecli.io
owner: updatecli
repository: terragrunt-example
#token: "xxx"
username: "updatecli-bot"
branch: main

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# Helpers
# {{ $GitHubUser := env ""}}
# {{ $GitHubRepositoryList := env "GITHUB_REPOSITORY" | split "/"}}
# {{ $GitHubPAT := env "GITHUB_TOKEN"}}
# {{ $GitHubUsername := env "GITHUB_ACTOR"}}

name: '{{ .name }}'
#{{ if .pipelineid }}
pipelineid: '{{ .pipelineid }}'
#{{ end }}

autodiscovery:
groupby: {{ .groupby }}
#{{ if or (.scm.enabled) (env "GITHUB_REPOSITORY") }}
scmid: default
actionid: default
# {{ end }}

crawlers:
terragrunt:
{{ .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 }}'
#{{ if .scm.commitusingapi }}
commitusingapi: {{ .scm.commitusingapi }}
# {{ end }}

actions:
default:
kind: "github/pullrequest"
scmid: "default"
spec:
automerge: {{ .automerge }}
labels:
- dependencies
{{ end }}

18 changes: 18 additions & 0 deletions updatecli/policies/autodiscovery/terragrunt/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "deps(terragrunt): bump all policies"
#pipelineid: terragrunt/autodiscovery
automerge: false

scm:
enabled: false
user: updatecli-bot
#email: updatecli-bot@updatecli.io
#owner: updatecli
#repository: "repository"
#token: "xxx"
username: "updatecli-bot"
branch: main
# commitusingapi: false

# spec:
groupby: all

4 changes: 4 additions & 0 deletions updatecli/policies/autodiscovery/updatecli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.6.0

* Allow to opt out `scm.email`.

## 0.5.0

* Allow to set commit with GitHub GraphQL API using `scm.commitusingapi`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ scms:
spec:
# Priority set to the environment variable
user: '{{ default $GitHubUser .scm.user }}'
#{{ if .scm.email }}
email: '{{ .scm.email }}'
# {{ end }}
owner: '{{ default $GitHubRepositoryList._0 .scm.owner }}'
repository: '{{ default $GitHubRepositoryList._1 .scm.repository }}'
token: '{{ default $GitHubPAT .scm.token }}'
Expand Down

0 comments on commit 0aed20f

Please sign in to comment.