Skip to content

Commit

Permalink
feat: add timeout flag ✨ (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 committed Feb 23, 2023
1 parent 41fb8d7 commit f6d5bd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
chart-dir: ./helm
chmod-kubeconfig: "1" # `chmod 600 kubeconfig-filepath`
cleanup: "1" # delete all the files i.e. kubeconfig & values
cleanup-on-fail: "1" # delete newly created resources on failure
create-namespace: "0"
helm-version: "v3.10.1" # https://github.com/helm/helm/releases
namespace: default
release-name: ${{ github.event.repository.name }}
timeout: 10m
update-dependencies: "1" # helm dep update
values: image.tag=${{ github.sha }} # comma separated key=value pairs
values-string: key1=value1,key2=value2 # comma separated key=value pairs
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ inputs:
default: "1"
description: Whether or not to delete all the kubeconfig & values files after deployment
required: false
cleanup-on-fail:
default: "1"
description: Whether or not to delete all the newly created resources on failure
required: false
create-namespace:
default: "0"
description: Whether or not to pass `--create-namespace` to Helm
Expand All @@ -48,6 +52,9 @@ inputs:
release-name:
default: ${{ github.event.repository.name }}
required: false
timeout:
default: 10m
description: The maximum amount of time to wait for the deployment to complete
update-dependencies:
default: "1"
description: Whether or not to run `helm dependency update` before deployment
Expand Down Expand Up @@ -133,9 +140,11 @@ runs:
helm ${{ inputs.action }} ${{ inputs.release-name }} ${{ inputs.chart-dir }} \
--kubeconfig ${{ inputs.kubeconfig-filepath || steps.generate-random-filepath.outputs.KUBECONFIG_FILEPATH }} \
--namespace ${{ inputs.namespace }} \
--timeout ${{ inputs.timeout }} \
$([[ "${{ inputs.create-namespace }}" == "1" ]] && echo '--create-namespace') \
$([[ "${{ inputs.atomic }}" == "1" ]] && echo '--atomic') \
$([[ "${{ inputs.wait }}" == "1" ]] && echo '--wait') \
$([[ "${{ inputs.cleanup-on-fail }}" == "1" ]] && echo '--cleanup-on-fail') \
$([[ "${{ inputs.values-file }}" != "" ]] && echo "--values ${{ github.run_id }}") \
$([[ "${{ inputs.values-filepath }}" != "" ]] && echo "--values ${{ inputs.values-filepath }}") \
$([[ "${{ inputs.values }}" != "" ]] && echo "--set ${{ inputs.values }}") \
Expand Down

0 comments on commit f6d5bd8

Please sign in to comment.