Files
helm/script.sh
2023-02-15 00:01:39 +03:00

29 lines
629 B
Bash
Executable File

#!/bin/sh
helm lint .
export HELM_REPO_USERNAME="$PLUGIN_USERNAME"
export HELM_REPO_PASSWORD="$PLUGIN_PASSWORD"
repo="$PLUGIN_REGISTRY"/"$PLUGIN_NAME"
helm repo add "$PLUGIN_NAME" "$repo"
previousVersion=$(helm search repo "$PLUGIN_NAME" -o yaml | yq '.[0].version')
bump="patch"
case "${DRONE_COMMIT_MESSAGE:0:8}" in
Major* ) bump="major";;
feat* ) bump="minor";;
esac
new_version=$(semver bump "$bump" "$previousVersion")
yq -i '.version = "'"$new_version"'"' Chart.yaml
# TODO add dependencies dynamically
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependency build
helm cm-push . "$repo"