Skip to content

Commit

Permalink
Make --skip-reindex optional (#29)
Browse files Browse the repository at this point in the history
* Make --skip-reindex optional

* BUMP version on readme

* Fix pre-commit checks
  • Loading branch information
mbovo authored Feb 13, 2023
1 parent 567a33c commit c2bf6ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# run:

- name: "Helm checks"
uses: mbovo/action-helm-artifactory@v1.0.0
uses: mbovo/action-helm-artifactory@v1.0.5
with:
action: "check"
env:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
# run:

- name: "Helm publish"
uses: mbovo/action-helm-artifactory@v1.0.0
uses: mbovo/action-helm-artifactory@v1.0.5
with:
action: "push"
env:
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ inputs:
action:
description: "Type of action to perform [check, dependency, lint, package, check_push, push]"
required: true
skip_reindex:
description: "Skip reindexing of the helm repo"
required: false
default: "false"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
- run: ${{ github.action_path }}/main.sh
env:
ACTION: ${{ inputs.action }}
SKIP_REINDEX: ${{inputs.skip_reindex}}
shell: bash
- run: ${{ github.action_path }}/main.sh
env:
Expand Down
9 changes: 7 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ helm_package(){

helm_push(){
print_title "Push chart"
if [[ "${SKIP_REINDEX}" == "true" ]]; then
extra_args="--skip-reindex"
else
extra_args=""
fi
if [[ -v ARTIFACTORY_API_KEY ]]; then
helm push-artifactory "${CHART_DIR}" "${ARTIFACTORY_URL}" --api-key "${ARTIFACTORY_API_KEY}" --version "${CHART_VERSION}" --skip-reindex
helm push-artifactory "${CHART_DIR}" "${ARTIFACTORY_URL}" --api-key "${ARTIFACTORY_API_KEY}" --version "${CHART_VERSION}" "${extra_args}"
elif [[ -v ARTIFACTORY_PASSWORD ]] && [[ -v ARTIFACTORY_USERNAME ]]; then
helm push-artifactory "${CHART_DIR}" "${ARTIFACTORY_URL}" --username "${ARTIFACTORY_USERNAME}" --password "${ARTIFACTORY_PASSWORD}" --version "${CHART_VERSION}" --skip-reindex
helm push-artifactory "${CHART_DIR}" "${ARTIFACTORY_URL}" --username "${ARTIFACTORY_USERNAME}" --password "${ARTIFACTORY_PASSWORD}" --version "${CHART_VERSION}" "${extra_args}"
else
echo "ARTIFACTORY_API_KEY or ARTIFACTORY_PASSWORD and ARTIFACTORY_USERNAME must be set"
exit 1
Expand Down

0 comments on commit c2bf6ce

Please sign in to comment.