Skip to content

Commit

Permalink
Merge pull request #65 from RADAR-base/easy-update
Browse files Browse the repository at this point in the history
Update external charts via Makefile
  • Loading branch information
Bdegraaf1234 authored Jul 11, 2024
2 parents 541c9f1 + 326da2f commit 1b9fd10
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check-missing-update-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check Missing Update Targets

on:
pull_request:
branches:
- main

jobs:
check-missing-update-targets:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Make
run: sudo apt-get install make

- name: Run make list-missing-update-targets
id: check
run: |
OUTPUT=$(make list-missing-update-targets)
if [ -n "$OUTPUT" ]; then
echo "Missing update targets detected:"
echo "$OUTPUT"
exit 1
fi
120 changes: 116 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,119 @@
.PHONY: gen
gen: gen-chart-doc
EXTERNAL_CHARTS = $(shell grep -P "^update-\S+:$$" Makefile | cut -d: -f1)
EXTERNAL_CHARTS_ACTUAL = $(shell find external -mindepth 1 -maxdepth 1 -type d | sed 's/external\//update-/')
MISSING_UPDATE_TARGETS = $(shell echo $(EXTERNAL_CHARTS_ACTUAL) $(EXTERNAL_CHARTS) | sed 's/ /\n/g' | sort | uniq -u)

.PHONY: gen-chart-doc
gen-chart-doc:
generate-docs:
@echo "Generate chart docs"
@helm-docs -s file --template-files=charts/_templates.gotmpl --template-files=DOCS.md.gotmpl --template-files=README.md.gotmpl

list-missing-update-targets:
@echo $(MISSING_UPDATE_TARGETS) | sed 's/ /\n/g'

deps: $(EXTERNAL_CHARTS)
@echo "Updated chart dependencies"

update-cert-manager:
@echo "Updating cert-manager"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://charts.jetstack.io
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-common:
@echo "Updating common"
@helm repo add bitnami https://charts.bitnami.com/bitnami
@rm -rf external/$(patsubst update-%,%,$@)
@helm pull -d external --untar bitnami/$(patsubst update-%,%,$@)
@echo ""

update-elasticsearch:
@echo "Updating elasticsearch"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://helm.elastic.co
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-fluent-bit:
@echo "Updating fluent-bit"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://fluent.github.io/helm-charts
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-grafana:
@echo "Updating grafana"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://grafana.github.io/helm-charts
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-graylog:
@echo "Updating graylog"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://charts.kong-z.com
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-ingress-nginx:
@echo "Updating ingress-nginx"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://kubernetes.github.io/ingress-nginx
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-kratos:
@echo "Updating kratos"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://k8s.ory.sh/helm/charts
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-kratos-selfservice-ui-node:
@echo "Updating kratos-selfservice-ui-node"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://k8s.ory.sh/helm/charts
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-minio:
@echo "Updating minio"
@helm repo add bitnami https://charts.bitnami.com/bitnami
@rm -rf external/$(patsubst update-%,%,$@)
@helm pull -d external --untar bitnami/$(patsubst update-%,%,$@)
@echo ""

update-mongodb:
@echo "Updating mongodb"
@helm repo add bitnami https://charts.bitnami.com/bitnami
@rm -rf external/$(patsubst update-%,%,$@)
@helm pull -d external --untar bitnami/$(patsubst update-%,%,$@)
@echo ""

update-postgresql:
@echo "Updating postgresql"
@helm repo add bitnami https://charts.bitnami.com/bitnami
@rm -rf external/$(patsubst update-%,%,$@)
@helm pull -d external --untar bitnami/$(patsubst update-%,%,$@)
@echo ""

update-redis:
@echo "Updating redis"
@helm repo add bitnami https://charts.bitnami.com/bitnami
@rm -rf external/$(patsubst update-%,%,$@)
@helm pull -d external --untar bitnami/$(patsubst update-%,%,$@)
@echo ""

update-trivy:
@echo "Updating trivy"
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://aquasecurity.github.io/helm-charts/
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

update-velero:
@echo "Updating velero"
@helm repo add bitnami https://charts.bitnami.com/bitnami
@rm -rf external/$(patsubst update-%,%,$@)
@helm repo add $(patsubst update-%,%,$@) https://vmware-tanzu.github.io/helm-charts
@helm pull -d external --untar $(patsubst update-%,%,$@)/$(patsubst update-%,%,$@)
@echo ""

0 comments on commit 1b9fd10

Please sign in to comment.