fix: move dependencies before lint, use set -e
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
17
script.sh
17
script.sh
@ -1,29 +1,32 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
eval "$(yq -o=j -I=0 '.dependencies[]' Chart.yaml | yq '"helm repo add " + .name + " " + .repository' -)"
|
||||||
|
helm dependency build
|
||||||
|
|
||||||
|
# Lint
|
||||||
helm lint --strict .
|
helm lint --strict .
|
||||||
|
|
||||||
|
# Add current repo
|
||||||
export HELM_REPO_USERNAME="$PLUGIN_USERNAME"
|
export HELM_REPO_USERNAME="$PLUGIN_USERNAME"
|
||||||
export HELM_REPO_PASSWORD="$PLUGIN_PASSWORD"
|
export HELM_REPO_PASSWORD="$PLUGIN_PASSWORD"
|
||||||
REGISTRY=${PLUGIN_REGISTRY:-"https://harbor.grachevko.ru/chartrepo"}
|
REGISTRY=${PLUGIN_REGISTRY:-"https://harbor.grachevko.ru/chartrepo"}
|
||||||
REPO=${PLUGIN_NAME:-${DRONE_REPO_OWNER}}
|
REPO=${PLUGIN_NAME:-${DRONE_REPO_OWNER}}
|
||||||
|
|
||||||
repo="$REGISTRY"/"$REPO"
|
repo="$REGISTRY"/"$REPO"
|
||||||
|
|
||||||
helm repo add "$REPO" "$repo"
|
helm repo add "$REPO" "$repo"
|
||||||
|
|
||||||
|
# Bump version
|
||||||
previousVersion=$(helm search repo "$REPO" -o yaml | yq '.[0].version')
|
previousVersion=$(helm search repo "$REPO" -o yaml | yq '.[0].version')
|
||||||
|
|
||||||
bump="patch"
|
bump="patch"
|
||||||
case "${DRONE_COMMIT_MESSAGE:0:8}" in
|
case "${DRONE_COMMIT_MESSAGE:0:8}" in
|
||||||
Major* ) bump="major";;
|
Major* ) bump="major";;
|
||||||
feat* ) bump="minor";;
|
feat* ) bump="minor";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
new_version=$(semver bump "$bump" "$previousVersion")
|
new_version=$(semver bump "$bump" "$previousVersion")
|
||||||
|
|
||||||
yq -i '.version = "'"$new_version"'"' Chart.yaml
|
yq -i '.version = "'"$new_version"'"' Chart.yaml
|
||||||
|
|
||||||
eval "$(yq -o=j -I=0 '.dependencies[]' Chart.yaml | yq '"helm repo add " + .name + " " + .repository' -)"
|
# Push new version
|
||||||
helm dependency build
|
|
||||||
|
|
||||||
helm cm-push . "$repo"
|
helm cm-push . "$repo"
|
||||||
|
Reference in New Issue
Block a user