@ -14,11 +14,6 @@ steps:
image : alpine/helm:latest
commands:
- mkdir -p charts/dist
# Debug: List repository contents
- echo "Repository root contents:"
- ls -la .
- echo "Charts directory contents:"
- ls -la charts/ || echo "No charts/ directory found"
# Find all versioned chart directories
- ALL_CHARTS=$(find charts -maxdepth 2 -type d | grep "/v[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$")
- "echo \"Detected charts: $ALL_CHARTS\""
@ -32,12 +27,14 @@ steps:
- name : push-to-harbor
image : alpine/helm:latest
commands:
# Install helm cm-push plugin
- helm plugin install https://github.com/chartmuseum/helm-push.git || true
# Fail if credentials are missing
- "if [ -z \"$HARBOR_USERNAME\" ] || [ -z \"$HARBOR_PASSWORD\" ]; then echo \"Error: HARBOR_USERNAME or HARBOR_PASSWORD not set\"; exit 1; fi"
# Login to Harbor regist ry
- "helm registry login -u \"$HARBOR_USERNAME\" -p \"$HARBOR_PASSWORD\" https://porto.interlegis.leg.br"
# Push each chart to Harbor (OCI format, Helm 3.8+)
- for CHART in charts/dist/*.tgz; do helm push "$CHART" oci://porto.interlegis.leg.br/seit; done
# Add the seit chart reposito ry
- helm repo add seit https://porto.interlegis.leg.br/chartrepo/seit --username "$HARBOR_USERNAME" --password "$HARBOR_PASSWORD" --force-update || true
# Push all .tgz files to the seit chart repository
- if ls charts/dist/*.tgz >/dev/null 2>&1; then for CHART in charts/dist/*.tgz; do helm cm-push "$CHART" seit; done; else echo "No .tgz files to push"; exit 0; fi
environment:
HARBOR_USERNAME:
from_secret : harbor_username