Skip to content

Commit

Permalink
add manual retry once, add timeout as input to action (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored Aug 11, 2023
1 parent 0abfd1e commit 785d32a
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ inputs:
description: "Kubernetes namespace to deploy helm charts on (default: ci-{github.repository}-{github.workflow}-{github.ref} )"
required: false
default: ""
timeout:
description: "Timeout for helm install (default: 10m)"
required: false
default: "10m"

outputs:
namespace:
Expand Down Expand Up @@ -114,14 +118,13 @@ runs:
helm search repo starship/devnet
shell: bash

- name: Helm delete before install
run: |
helm delete ${{ inputs.name }} --debug --namespace ${{ steps.set-namespace.outputs.namespace }} --wait || true
shell: bash

- name: Helm install
id: helm-install-1
continue-on-error: true
run: |
helm install -f ${{ inputs.name }}-values.yaml ${{ inputs.name }} ${{ inputs.chart }} --wait --debug --version ${{ inputs.version }} --timeout 30m0s --namespace ${{ steps.set-namespace.outputs.namespace }} --create-namespace
helm delete ${{ inputs.name }} --debug --namespace ${{ steps.set-namespace.outputs.namespace }} --wait || true
sleep 5
helm install -f ${{ inputs.name }}-values.yaml ${{ inputs.name }} ${{ inputs.chart }} --wait --debug --version ${{ inputs.version }} --timeout ${{ inputs.timeout }} --namespace ${{ steps.set-namespace.outputs.namespace }} --create-namespace
shell: bash

- name: Logs
Expand All @@ -140,6 +143,16 @@ runs:
NAMESPACE: ${{ steps.set-namespace.outputs.namespace }}
shell: bash

- name: Helm install again
id: helm-install-2
if: steps.helm-install-1.outcome == 'failure'
run: |
helm delete ${{ inputs.name }} --debug --namespace ${{ steps.set-namespace.outputs.namespace }} --wait || true
sleep 5
kubectl get pods --namespace ${{ steps.set-namespace.outputs.namespace }}
helm install -f ${{ inputs.name }}-values.yaml ${{ inputs.name }} ${{ inputs.chart }} --wait --debug --version ${{ inputs.version }} --timeout ${{ inputs.timeout }} --namespace ${{ steps.set-namespace.outputs.namespace }} --create-namespace
shell: bash

- name: Port forward
if: ${{ inputs.port-forward == 'true' }}
run: ${{ github.action_path }}/port_forward.sh --config=$VALUES_FILE
Expand Down

0 comments on commit 785d32a

Please sign in to comment.