From 9db58af3e7258fd1c44d09e945314cd11bd95368 Mon Sep 17 00:00:00 2001 From: kbauer Date: Wed, 12 Feb 2025 16:01:59 -0800 Subject: [PATCH] refactor: define sync target in distro folder --- .github/workflows/ci-config-drift.yaml | 2 +- Makefile | 15 --------------- distributions/nrdot-collector-k8s/Makefile | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 distributions/nrdot-collector-k8s/Makefile diff --git a/.github/workflows/ci-config-drift.yaml b/.github/workflows/ci-config-drift.yaml index 8b7892ba..89eafd97 100644 --- a/.github/workflows/ci-config-drift.yaml +++ b/.github/workflows/ci-config-drift.yaml @@ -18,4 +18,4 @@ jobs: - name: Sync k8s distro configs from helm chart run: | - make k8s-configs-sync-check + make -f ./distributions/nrdot-collector-k8s/Makefile sync-configs diff --git a/Makefile b/Makefile index d418be8d..4b45a661 100644 --- a/Makefile +++ b/Makefile @@ -104,18 +104,3 @@ licenses-check: licenses exit 1;\ } \ || exit 0 - -.PHONY: sync-k8s-configs -sync-k8s-configs: - @./distributions/nrdot-collector-k8s/sync-configs.sh - -.PHONY: check-k8s-configs -check-k8s-configs: sync-k8s-configs - @git diff --name-only | grep -E 'distributions\/nrdot-collector-k8s\/config-\w*.yaml' \ - && { \ - echo "Collector configs in helm chart have changed. Adjust sync script to take changes into account.";\ - echo "Diff of $(NOTICE_OUTPUT):";\ - git --no-pager diff HEAD -- 'distributions/nrdot-collector-k8s/config-*.yaml';\ - exit 1;\ - } \ - || exit 0 diff --git a/distributions/nrdot-collector-k8s/Makefile b/distributions/nrdot-collector-k8s/Makefile new file mode 100644 index 00000000..1fa15a5a --- /dev/null +++ b/distributions/nrdot-collector-k8s/Makefile @@ -0,0 +1,16 @@ +THIS_MAKEFILE_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) + +.PHONY: sync-configs +sync-configs: + @${THIS_MAKEFILE_DIR}/sync-configs.sh + +.PHONY: check-k8s-configs +check-k8s-configs: sync-configs + @git diff --name-only | grep -E 'distributions\/nrdot-collector-k8s\/config-\w*.yaml' \ + && { \ + echo "Collector configs in helm chart have changed. Adjust sync script to take changes into account.";\ + echo "Diff of $(NOTICE_OUTPUT):";\ + git --no-pager diff HEAD -- 'distributions/nrdot-collector-k8s/config-*.yaml';\ + exit 1;\ + } \ + || exit 0