51a71e26b2
* allow chart name to be customised * Calculate the chart name in github workflow * publish of helm chart allows registry & repository to be configured (Helm chart currently publishes to ghcr)
26 lines
628 B
Bash
26 lines
628 B
Bash
#!/bin/bash
|
|
set -eo pipefail
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
# shellcheck disable=SC1090,SC1091
|
|
source "${SCRIPT_DIR}/common.sh"
|
|
|
|
if [[ "${GITHUB_REF_NAME}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "speckle-server-chart"
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
|
|
echo "speckle-server-chart"
|
|
exit 0
|
|
fi
|
|
|
|
# if branch name truncated contains an underscore, we should exit
|
|
if [[ "${BRANCH_NAME_TRUNCATED}" =~ "_" ]]; then
|
|
echo "Branch name contains an underscore, exiting"
|
|
exit 1
|
|
fi
|
|
|
|
echo "speckle-server-chart-${BRANCH_NAME_TRUNCATED}"
|
|
exit 0
|