Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add manual retry once, add timeout as input to action #17

Merged
merged 1 commit into from
Aug 11, 2023
Merged
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
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
Loading