diff --git a/updatecli/updatecli.d/agent.yaml b/updatecli/updatecli.d/agent.yaml deleted file mode 100644 index 3fcfe22..0000000 --- a/updatecli/updatecli.d/agent.yaml +++ /dev/null @@ -1,77 +0,0 @@ -sources: - lastGithubRelease: - kind: githubrelease - spec: - owner: 'grafana' - repository: 'agent' - token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' - versionfilter: - kind: semver - -targets: - agent_image: - name: Bump Agent image version - kind: hcl - scmid: github - spec: - file: 'locals.tf' - path: 'locals.agent_version' - transformers: - - trimprefix: "v" - operator_image: - name: Bump Operator image version - kind: yaml - scmid: github - dependson: - - agent_image - spec: - file: 'grafana/operator-values.yaml' - key: '$.image.tag' - module_version: - name: Bump Operator module version - kind: hcl - scmid: github - dependson: - - operator_image - spec: - file: 'locals.tf' - path: 'locals.version' - transformers: - - trimprefix: "v" - kubectl: - name: run kubectl when chart values changed - kind: shell - scmid: github - dependson: - - module_version - dependsonchange: true - disablesourceinput: true - spec: - command: "rm -rf grafana/charts ksm/charts && kubectl kustomize . -o grafana-agent.yaml --enable-helm && git diff --shortstat grafana-agent.yaml" - environments: - - name: PATH - -scms: - github: - kind: "github" - spec: - user: "argoyle" - email: "joakim@unbound.se" - owner: "opzkit" - repository: "terraform-aws-k8s-addons-grafana-agent-operator" - token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' - username: 'UpdateCLI' - branch: "main" - commitusingapi: true - -# Define action configurations if one needs to be created -actions: - addon: - kind: "github/pullrequest" - scmid: "github" - spec: - automerge: true - draft: false - labels: - - "dependencies" - title: "Update Grafana Agent Image versions" diff --git a/updatecli/updatecli.d/grafana.yaml b/updatecli/updatecli.d/grafana.yaml index 1831d8a..447a9da 100644 --- a/updatecli/updatecli.d/grafana.yaml +++ b/updatecli/updatecli.d/grafana.yaml @@ -1,27 +1,81 @@ sources: - lastRelease: + lastGrafanaHelmRelease: kind: helmchart spec: url: 'https://grafana.github.io/helm-charts' name: 'grafana-agent-operator' + lastKSMHelmRelease: + kind: helmchart + spec: + url: 'https://prometheus-community.github.io/helm-charts' + name: 'kube-state-metrics' + lastAgentRelease: + kind: githubrelease + spec: + owner: 'grafana' + repository: 'agent' + token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' + versionfilter: + kind: semver targets: - chart: + grafana_chart: name: bump chart version kind: yaml scmid: github + sourceid: lastGrafanaHelmRelease spec: file: 'grafana/kustomization.yaml' key: '$.helmCharts[0].version' transformers: - addprefix: "'" - addsuffix: "'" + ksm_chart: + name: bump chart version + kind: yaml + scmid: github + sourceid: lastKSMHelmRelease + spec: + file: 'ksm/kustomization.yaml' + key: '$.helmCharts[0].version' + transformers: + - addprefix: "'" + - addsuffix: "'" + agent_image: + name: Bump Agent image version + kind: hcl + scmid: github + spec: + file: 'locals.tf' + path: 'locals.agent_version' + transformers: + - trimprefix: "v" + operator_image: + name: Bump Operator image version + kind: yaml + scmid: github + spec: + file: 'grafana/operator-values.yaml' + key: '$.image.tag' + module_version: + name: Bump Operator module version + kind: hcl + scmid: github + spec: + file: 'locals.tf' + path: 'locals.version' + transformers: + - trimprefix: "v" kubectl: name: run kubectl when chart changed kind: shell scmid: github dependson: - - chart + - grafana_chart + - ksm_chart + - agent_image + - operator_image + - module_version dependsonchange: true disablesourceinput: true spec: diff --git a/updatecli/updatecli.d/ksm.yaml b/updatecli/updatecli.d/ksm.yaml deleted file mode 100644 index 79b65af..0000000 --- a/updatecli/updatecli.d/ksm.yaml +++ /dev/null @@ -1,56 +0,0 @@ -sources: - lastRelease: - kind: helmchart - spec: - url: 'https://prometheus-community.github.io/helm-charts' - name: 'kube-state-metrics' - -targets: - chart: - name: bump chart version - kind: yaml - scmid: github - spec: - file: 'ksm/kustomization.yaml' - key: '$.helmCharts[0].version' - transformers: - - addprefix: "'" - - addsuffix: "'" - kubectl: - name: run kubectl when chart changed - kind: shell - scmid: github - dependson: - - chart - dependsonchange: true - disablesourceinput: true - spec: - command: "rm -rf grafana/charts ksm/charts && kubectl kustomize . -o grafana-agent.yaml --enable-helm && git diff --shortstat grafana-agent.yaml" - environments: - - name: PATH - -scms: - github: - kind: "github" - spec: - user: "argoyle" - email: "joakim@unbound.se" - owner: "opzkit" - repository: "terraform-aws-k8s-addons-grafana-agent-operator" - token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' - username: 'UpdateCLI' - branch: "main" - commitusingapi: true - -# Define action configurations if one needs to be created -actions: - addon: - kind: "github/pullrequest" - scmid: "github" - spec: - automerge: true - draft: false - labels: - - "dependencies" - title: "Update Kube State Metrics version" -