Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ The following settings must be passed as environment variables as shown in the e
| `CHARTMUSEUM_USER` | Username for chartmuseum | `secret` | **Yes** |
| `CHARTMUSEUM_PASSWORD` | Password for chartmuseum | `secret` | **Yes** |
| `SKIP_SECURE` | Allowing to push using insecure connection | `env` | No |
| `SSL_CERTIFICATE_PATH` | Allowing to use custom SSL certificate | `env` | No |
| `SSL_CERTIFICATE_CA_PATH` | Allowing to use custom SSL certificate bundle | `env` | No |
| `SSL_CERTIFICATE_KEY_PATH` | Allowing to provide custom SSL key | `env` | No |
| `DEBUG` | add `--debug` flag to ChartMuseum push command | `env` | No |
| `FORCE` | Force chart upload (in case version exist in chartmuseum, upload will fail without `FORCE`). Defaults is `False` if not provided. | `env` | No |
| `SOURCE_DIR` | The local directory you wish to upload. If your chart is in nested folder, `SOURCE_DIR` should be the path from root to the last folder before the one that stores the chart. For example, if your chart is in `./charts/app`, the `SOURCE_DIR` is `./charts/`. Defaults to the root of your repository (`.`) if not provided. | `env` | No |
| `CHART_FOLDER` | Folder with charts in repo. This should be the name of the folder where the chart is in. For example, if your chart is in `./charts/app`, the `CHART_FOLDER` is `app` | `env` | **Yes** |
Expand Down
27 changes: 26 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@ elif [ "$SKIP_SECURE" == "1" ] || [ "$SKIP_SECURE" == "True" ] || [ "$SKIP_SECUR
SKIP_SECURE="--insecure"
fi

if [ -z "$SSL_CERTIFICATE_PATH" ]; then
SSL_CERTIFICATE_PATH=""
elif [ "$SSL_CERTIFICATE_PATH" != "" ]; then
SSL_CERTIFICATE_PATH="--cert-file ../../${SSL_CERTIFICATE_PATH}"
fi

if [ -z "$SSL_CERTIFICATE_CA_PATH" ]; then
SSL_CERTIFICATE_CA_PATH=""
elif [ "$SSL_CERTIFICATE_CA_PATH" != "" ]; then
SSL_CERTIFICATE_CA_PATH="--ca-file ../../${SSL_CERTIFICATE_CA_PATH}"
fi

if [ -z "$SSL_CERTIFICATE_KEY_PATH" ]; then
SSL_CERTIFICATE_KEY_PATH=""
elif [ "$SSL_CERTIFICATE_KEY_PATH" != "" ]; then
SSL_CERTIFICATE_KEY_PATH="--key-file ../../${SSL_CERTIFICATE_KEY_PATH}"
fi

if [ -z "$DEBUG" ]; then
DEBUG_FLAG=""
elif [ "$DEBUG" == "1" ] || [ "$DEBUG" == "True" ] || [ "$DEBUG" == "TRUE" ]; then
DEBUG_FLAG="--debug"
fi



cd ${SOURCE_DIR}/${CHART_FOLDER}

Expand All @@ -54,4 +79,4 @@ helm dependency update .

helm package .

helm cm-push ${CHART_FOLDER}-* ${CHARTMUSEUM_URL} -u ${CHARTMUSEUM_USER} -p ${CHARTMUSEUM_PASSWORD} ${FORCE} ${SKIP_SECURE}
helm cm-push ${CHART_FOLDER}-* ${CHARTMUSEUM_URL} -u ${CHARTMUSEUM_USER} -p ${CHARTMUSEUM_PASSWORD} ${FORCE} ${SKIP_SECURE} ${SSL_CERTIFICATE_PATH} ${SSL_CERTIFICATE_CA_PATH} ${SSL_CERTIFICATE_KEY_PATH} ${DEBUG_FLAG}