Skip to content

Commit

Permalink
Merge pull request #31 from yalattas/feat/connection
Browse files Browse the repository at this point in the history
refactor(bash): Allow insecure connection for private CM
  • Loading branch information
Goodsmileduck authored Feb 14, 2024
2 parents 06f256e + 7133d88 commit 3c64797
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
SOURCE_DIR: '.'
CHART_FOLDER: 'ecs-exporter'
FORCE: 'True'
SKIP_SECURE: 'False'
CHARTMUSEUM_URL: 'https://chartmuseum.url'
CHARTMUSEUM_USER: '${{ secrets.CHARTMUSEUM_USER }}'
CHARTMUSEUM_PASSWORD: ${{ secrets.CHARTMUSEUM_PASSWORD }}
Expand All @@ -36,6 +37,7 @@ The following settings must be passed as environment variables as shown in the e
| `CHARTMUSEUM_URL` | Chartmuseum url | `env` | **Yes** |
| `CHARTMUSEUM_USER` | Username for chartmuseum | `secret` | **Yes** |
| `CHARTMUSEUM_PASSWORD` | Password for chartmuseum | `secret` | **Yes** |
| `SKIP_SECURE` | Allowing to push using insecure connection | `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
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ elif [ "$FORCE" == "1" ] || [ "$FORCE" == "True" ] || [ "$FORCE" == "TRUE" ]; th
FORCE="-f"
fi

if [ -z "$SKIP_SECURE" ] || [ "$SKIP_SECURE" == "False" ] || [ "$SKIP_SECURE" == "FALSE" ]; then
SKIP_SECURE=""
elif [ "$SKIP_SECURE" == "1" ] || [ "$SKIP_SECURE" == "True" ] || [ "$SKIP_SECURE" == "TRUE" ]; then
SKIP_SECURE="--insecure"
fi


cd ${SOURCE_DIR}/${CHART_FOLDER}
Expand All @@ -49,4 +54,4 @@ helm dependency update .

helm package .

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

0 comments on commit 3c64797

Please sign in to comment.