From ad713fc161fa057bb9c494da7b3617f3be7f3b2c Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Mon, 5 May 2025 23:53:56 +0300 Subject: [PATCH] Try real pipeline --- .woodpecker.yml | 39 ++++++++++++++------------------- woodpecker-pipeline-example.yml | 28 +++++++++++++++++++++++ 2 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 woodpecker-pipeline-example.yml diff --git a/.woodpecker.yml b/.woodpecker.yml index f2df436..1d18343 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,28 +1,23 @@ steps: - - name: step-1 - image: alpine + - name: detect-and-validate + image: alpine:latest commands: - - echo "🚀 Step 1 Starting preview pipeline" + - apk add --no-cache bash git curl jq + - echo "🔍 Detecting changed apps with values-int.yaml" + - | + CHANGED_APPS=$(git diff --name-only origin/master | grep 'manifest/.*/values-int.yaml' | cut -d'/' -f2 | sort -u) - - name: step-2 - image: alpine - commands: - - echo "🔧 Step 2 Simulating Helm Lint" + if [ -z "$CHANGED_APPS" ]; then + echo "✅ No values-int.yaml changes detected. Skipping." + exit 0 + fi - - name: step-3 - image: alpine - commands: - - echo "📦 Step 3 Would validate ArgoCD YAML here" + echo "Changed apps: $CHANGED_APPS" - - name: step-4 - image: alpine - commands: - - echo "🌐 Step 4 Would create Cloudflare DNS record here" + for app in $CHANGED_APPS; do + echo "🔧 Validating app: $app" + helm lint charts/$app || exit 1 + helm template charts/$app -f manifest/$app/values-int.yaml || exit 1 + done - - name: done - image: alpine - commands: - - echo "✅ Pipeline finished successfully" - -when: - event: push + - echo "✅ All changed apps passed lint and render. ArgoCD will sync them automatically." diff --git a/woodpecker-pipeline-example.yml b/woodpecker-pipeline-example.yml new file mode 100644 index 0000000..f2df436 --- /dev/null +++ b/woodpecker-pipeline-example.yml @@ -0,0 +1,28 @@ +steps: + - name: step-1 + image: alpine + commands: + - echo "🚀 Step 1 Starting preview pipeline" + + - name: step-2 + image: alpine + commands: + - echo "🔧 Step 2 Simulating Helm Lint" + + - name: step-3 + image: alpine + commands: + - echo "📦 Step 3 Would validate ArgoCD YAML here" + + - name: step-4 + image: alpine + commands: + - echo "🌐 Step 4 Would create Cloudflare DNS record here" + + - name: done + image: alpine + commands: + - echo "✅ Pipeline finished successfully" + +when: + event: push