diff --git a/Dockerfile b/Dockerfile index 6e9b6d1..17173b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1 @@ -FROM flownative/base:1 - -ENV HELM_VERSION v3.0.2 -ENV HELM_HOME=/root/.helm - -# We need Git for "helm plugin install" -RUN apt-get update \ - && apt-get install git \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/log/apt \ - && rm -rf /var/log/dpkg.log - -RUN curl -sSL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar xz \ - && mv linux-amd64/helm /usr/local/bin/helm \ - && rm -rf linux-amd64 - -COPY entrypoint.sh /entrypoint.sh -RUN chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] +FROM flownative/action-helm-release:1 diff --git a/README.md b/README.md index 3d99235..8fa360c 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,10 @@ jobs: repository_user: '${{ secrets.CHARTMUSEUM_USER }}' repository_password: '${{ secrets.CHARTMUSEUM_PASSWORD }}' ```` + +## Implementation Note + +The repository of this action does not contain the actual implementation code. Instead, it's referring to a pre-build +image in its `Dockerfile` in order to save resources and speed up workflow runs. + +The code of this action can be found [here](https://github.com/flownative/docker-action-helm-release). diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 9e77720..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -set -ex - -helm plugin install https://github.com/chartmuseum/helm-push.git - -export INPUT_CHARTS_FOLDER=${INPUT_CHARTS_FOLDER:-.} - -if [ -z "${INPUT_CHART_NAME}" ]; then - echo "chart_name is not set" - exit 1 -fi - -if [ -z "${INPUT_REPOSITORY_URL}" ]; then - echo "repository_url is not set" - exit 1 -fi - -if [ -z "${INPUT_REPOSITORY_USER}" ]; then - echo "repository_user is not set" - exit 1 -fi - -if [ -z "${INPUT_REPOSITORY_PASSWORD}" ]; then - echo "repository_password is not set" - exit 1 -fi - -if [ -z "${INPUT_CHART_VERSION}" ]; then - echo "chart_version is not set" - exit 1 -fi - -if [ -z "${INPUT_APP_VERSION}" ]; then - echo "app_version is not set" - exit 1 -fi - -INPUT_CHART_VERSION=$(echo "${INPUT_CHART_VERSION}" | sed -e 's|refs/tags||' | sed -e 's/^v//') -INPUT_APP_VERSION=$(echo "${INPUT_APP_VERSION}" | sed -e 's|refs/tags||' | sed -e 's/^v//' | sed -e 's/+.*//') - -cd "${INPUT_CHARTS_FOLDER}" - -helm inspect chart "${INPUT_CHART_NAME}" -helm package --app-version "${INPUT_APP_VERSION}" --version "${INPUT_CHART_VERSION}" "${INPUT_CHART_NAME}" -helm push "${INPUT_CHART_NAME}-${INPUT_CHART_VERSION}.tgz" "${INPUT_REPOSITORY_URL}" --username "${INPUT_REPOSITORY_USER}" --password "${INPUT_REPOSITORY_PASSWORD}" --force