Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,29 @@ else
FORCE=""
fi

if [ "$UPDATE_DEPENDENCIES" == "1" ] || [ "$UPDATE_DEPENDENCIES" == "True" ] || [ "$UPDATE_DEPENDENCIES" == "TRUE" ] || [ "$UPDATE_DEPENDENCIES" == "true" ]; then
if [ "$UPDATE_DEPENDENCIES" == "1" ] || [[ "$UPDATE_DEPENDENCIES" == [Tt][Rr][Uu][Ee] ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice.

UPDATE_DEPENDENCIES="-u"
else
UPDATE_DEPENDENCIES=""
fi

if [ "$REGISTRY_VERSION" ]; then
echo "Version is defined, using as parameter."
REGISTRY_VERSION="--version ${REGISTRY_VERSION}"
fi

if [ "$REGISTRY_APPVERSION" ]; then
echo "App version is defined, using as parameter."
REGISTRY_APPVERSION="--app-version ${REGISTRY_APPVERSION}"
fi

if [ "$USE_OCI_REGISTRY" == "TRUE" ] || [ "$USE_OCI_REGISTRY" == "true" ]; then
export HELM_EXPERIMENTAL_OCI=1
echo "OCI SPECIFIED, USING HELM OCI FEATURES"
REGISTRY=$(echo "${REGISTRY_URL}" | awk -F[/:] '{print $4}') # Get registry host from url
echo "${REGISTRY_ACCESS_TOKEN}" | helm registry login -u ${REGISTRY_USERNAME} --password-stdin ${REGISTRY} # Authenticate registry
echo "Packaging chart '$CHART_FOLDER'"
PKG_RESPONSE=$(helm package $CHART_FOLDER $UPDATE_DEPENDENCIES) # package chart
PKG_RESPONSE=$(helm package ${CHART_FOLDER} ${REGISTRY_VERSION} ${REGISTRY_APPVERSION} ${UPDATE_DEPENDENCIES}) # package chart
echo "$PKG_RESPONSE"
CHART_TAR_GZ=$(basename "$PKG_RESPONSE") # extract tar name from helm package stdout
echo "Pushing chart $CHART_TAR_GZ to '$REGISTRY_URL'"
Expand All @@ -61,16 +71,6 @@ if [ "$REGISTRY_PASSWORD" ]; then
REGISTRY_PASSWORD="--password ${REGISTRY_PASSWORD}"
fi

if [ "$REGISTRY_VERSION" ]; then
echo "Version is defined, using as parameter."
REGISTRY_VERSION="--version ${REGISTRY_VERSION}"
fi

if [ "$REGISTRY_APPVERSION" ]; then
echo "App version is defined, using as parameter."
REGISTRY_APPVERSION="--app-version ${REGISTRY_APPVERSION}"
fi

if [ "$ADD_REPOSITORIES" != "" ]; then
while read addRepositoryArgs;
do
Expand Down