From 907bc88a7dbcb1eae8249c4bde3d797e040b35e4 Mon Sep 17 00:00:00 2001 From: rahul Date: Thu, 13 Feb 2025 10:36:46 +0530 Subject: [PATCH] Testing new way to get folder --- .github/workflows/push_pr.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 18cc14ce..cf79cd79 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -62,8 +62,18 @@ jobs: - name: Create image for chart testing if: steps.list-changed.outputs.changed == 'true' run: | - TAG=test GOOS=linux GOARCH=amd64 make ci/build - sudo cp ./dist/nri-prometheus-nix_linux_amd64/nri-prometheus ./bin/nri-prometheus + export TAG=test + export GOOS=linux + export GOARCH=amd64 + make ci/build + # Find the highest versioned amd64 build directory + # Sort numerically on the version suffix (e.g., _v1, _v2) + latest_dir=$(ls -d ./dist/nri-prometheus-nix_linux_amd64* | sort -V | tail -n1) + if [ -z "$latest_dir" ]; then + echo "Error: No matching build directory found" + exit 1 + fi + sudo cp "${latest_dir}/nri-prometheus" ./bin/nri-prometheus DOCKER_BUILDKIT=1 docker build -t e2e/nri-prometheus:test . -f Dockerfile.dev minikube image load e2e/nri-prometheus:test - name: Test install charts