From d67084b46b440eae9dfe2c10f44c47817bbaf83c Mon Sep 17 00:00:00 2001 From: Kofo Okesola Date: Thu, 14 Aug 2025 03:09:50 +0100 Subject: [PATCH] added drone ci step --- .drone.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..8229362 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,54 @@ +--- +kind: pipeline +type: docker +name: helm-chart-pipeline +workspace: + path: /drone/src + +# Only run this pipeline on pushes to the master branch +# Skip the pipeline when the commit message contains [CI SKIP] +trigger: + branch: + - main + event: + - push + +steps: + - name: package-and-index + image: alpine/helm:3.12.0 + commands: + # Verify the chart directory exists + - 'test -d ./servflow || (echo "Error: servflow directory not found" && exit 1)' + # Update dependencies if they exist + - "if [ -f ./servflow/Chart.lock ]; then helm dependency update ./servflow; fi" + # Make sure charts directory exists + - "mkdir -p ./charts" + # Package the Helm chart into the charts directory + - 'helm package ./servflow -d ./charts || (echo "Error: failed to package chart" && exit 1)' + # Update the Helm repository index + - "helm repo index ./charts" + # Show what was created for debugging + - "ls -la ./charts" + + - name: commit-and-push + image: alpine/git + commands: + # Configure Git + - 'git config --global user.name "Drone CI"' + - 'git config --global user.email "drone@example.com"' + + # Check if there are changes to commit + - "git add charts/" + - | + if git diff --cached --quiet; then + echo "No changes to commit" + exit 0 + fi + + # Commit and push changes + - 'git commit -m "Update Helm chart [CI SKIP]"' + - "git push origin HEAD:master" + +# Limit concurrent builds to avoid conflicts when updating the repository +concurrency: + limit: 1