Skip to content

Commit

Permalink
Upload support bundles as GH artifacts (#4621)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored May 15, 2024
1 parent 9ada8ed commit 710df61
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 96 deletions.
30 changes: 15 additions & 15 deletions .github/actions/generate-support-bundle/action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
name: 'Generate Support Bundle'
description: 'Composite action for generating a support bundle'
inputs:
aws-access-key-id:
description: 'AWS access key id for uploading support bundle'
artifact-name:
description: 'Name of the artifact to be uploaded'
required: true
aws-secret-access-key:
description: 'AWS secret access key for uploading support bundle'
required: true
aws-region:
description: 'AWS region for uploading support bundle'
default: 'us-east-1'
required: false
kots-namespace:
description: 'KOTS namespace'
required: true
runs:
using: "composite"
steps:
- name: Generate support bundle on failure
- id: generate-support-bundle
env:
AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }}
AWS_DEFAULT_REGION: ${{ inputs.aws-region }}
KOTS_NAMESPACE: ${{ inputs.kots-namespace }}
run: |
RELEASE="$(
Expand All @@ -33,6 +23,16 @@ runs:
tar xzf support-bundle_linux_amd64.tar.gz
./support-bundle https://kots.io
BUNDLE="$(ls -1 | grep 'support-bundle-.*.tar.gz')"
aws s3 cp "${BUNDLE}" "s3://kots-e2e-build-test-support-bundles/${BUNDLE}"
echo "::notice ::support bundle uploaded to aws replicated-dev account s3://kots-e2e-build-test-support-bundles/${BUNDLE}"
echo "bundle-name=$BUNDLE" >> "$GITHUB_OUTPUT"
shell: bash

- id: upload-support-bundle
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: ${{ steps.generate-support-bundle.outputs.bundle-name }}

- name: Print support bundle URL
shell: bash
run: |
echo "::notice ::support bundle can be downloaded from: ${{ steps.upload-support-bundle.outputs.artifact-url }}"
16 changes: 2 additions & 14 deletions .github/actions/kots-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ inputs:
description: 'Run KOTS with the --airgap flag'
default: "false"
required: false
aws-access-key-id:
description: 'AWS access key id for uploading support bundle'
required: false
aws-secret-access-key:
description: 'AWS secret access key for uploading support bundle'
required: false
aws-region:
description: 'AWS region for uploading support bundle'
default: 'us-east-1'
required: false
replicated-api-token:
description: 'Replicated API token for C11y matrix'
required: false
Expand Down Expand Up @@ -171,12 +161,10 @@ runs:
shell: bash

- name: Generate support bundle on failure
if: ${{ failure() && inputs.aws-access-key-id && inputs.aws-secret-access-key }}
if: ${{ failure() }}
uses: ./.github/actions/generate-support-bundle
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
artifact-name: ${{ github.job }}-${{ inputs.k8s-distribution }}-${{ inputs.k8s-version }}-support-bundle

- name: Remove Cluster
id: remove-cluster
Expand Down
Loading

0 comments on commit 710df61

Please sign in to comment.