Browse Source

Fix push-to-branch

master
Fábio Kaiser Rauber 2 weeks ago
parent
commit
0128e7a63c
  1. 7
      .drone.yml

7
.drone.yml

@ -49,14 +49,17 @@ steps:
commands: commands:
# Debug: Verify API key presence # Debug: Verify API key presence
- test -n "$GITEA_API_KEY" || { echo "GITEA_API_KEY is not set"; exit 1; } - test -n "$GITEA_API_KEY" || { echo "GITEA_API_KEY is not set"; exit 1; }
# Debug: Confirm key presence without exposing it
- "echo API key length: ${#GITEA_API_KEY}"
# Check if gh-pages exists remotely, fetch it if it does, otherwise create it # Check if gh-pages exists remotely, fetch it if it does, otherwise create it
- git ls-remote --heads origin gh-pages | grep -q gh-pages && git fetch origin gh-pages && git checkout gh-pages || git checkout -b gh-pages - git ls-remote --heads origin gh-pages | grep -q gh-pages && git fetch origin gh-pages && git checkout gh-pages || git checkout -b gh-pages
# Stage the charts/dist directory (already in the working directory) # Stage the charts/dist directory (already in the working directory)
- git add charts/dist/* - git add charts/dist/*
# Commit changes # Commit changes
- git commit -m "Update Helm charts from commit ${DRONE_COMMIT}" || echo "No changes to commit" - git commit -m "Update Helm charts from commit ${DRONE_COMMIT}" || echo "No changes to commit"
# Push with API key in URL and check for failure # Push with API key, ensuring proper variable expansion
- git push https://x:${GITEA_API_KEY}@git.interlegis.leg.br/SEIT/rancher-charts.git HEAD:gh-pages --force || { echo "Git push failed"; exit 1; } - PUSH_URL="https://x:${GITEA_API_KEY}@git.interlegis.leg.br/SEIT/rancher-charts.git"
- git push "$PUSH_URL" HEAD:gh-pages --force || { echo "Git push failed"; exit 1; }
environment: environment:
GITEA_API_KEY: GITEA_API_KEY:
from_secret: gitea_api_key from_secret: gitea_api_key

Loading…
Cancel
Save