Skip to content

Commit

Permalink
Fixing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeniawhite committed Oct 27, 2024
1 parent 77da7a6 commit 0d6b37e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ concurrency:
cancel-in-progress: true

jobs:
check-asset-inventory-supported-version:
name: Check Asset Inventory supported version
runs-on: ubuntu-20.04
outputs:
asset_inventory_supported: ${{ steps.check-asset-inventory-supported-version.outputs.asset_inventory_supported }}
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Check Asset Inventory supported version
id: check-asset-inventory-supported-version
run: |
MIN_VERSION="8.16.0"
if [[ "$(echo -e "$MIN_VERSION\n${{ env.ELK_VERSION }}" | sort -V | head -n 1)" == "$MIN_VERSION" ]]; then
echo "Stack version meets the requirement: ${{ env.ELK_VERSION }} >= $MIN_VERSION."
echo "asset_inventory_supported=true" >> $GITHUB_ENV
else
echo "Stack version is below the requirement: ${{ env.ELK_VERSION }} < $MIN_VERSION."
echo "asset_inventory_supported=false" >> $GITHUB_ENV
fi
init-hermit:
name: Init Hermit Tools
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -55,9 +76,10 @@ jobs:
azure-client-secret: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientSecret }}

ci-azure-asset-inventory:
needs: [ init-hermit ]
needs: [ init-hermit, check-asset-inventory-supported-version ]
name: Azure Asset Inventory CI
runs-on: ubuntu-22.04
if: needs.check-asset-inventory-supported-version.outputs.asset_inventory_supported == 'true'
timeout-minutes: 60
permissions:
contents: "read"
Expand Down Expand Up @@ -101,9 +123,10 @@ jobs:
aws-account-type: single-account

ci-aws-asset-inventory:
needs: [ init-hermit ]
needs: [ init-hermit, check-asset-inventory-supported-version ]
name: AWS Asset Inventory CI
runs-on: ubuntu-22.04
if: needs.check-asset-inventory-supported-version.outputs.asset_inventory_supported == 'true'
timeout-minutes: 60
permissions:
contents: "read"
Expand Down Expand Up @@ -147,9 +170,10 @@ jobs:
gcp-account-type: 'single-account'

ci-gcp-asset-inventory:
needs: [init-hermit]
needs: [ init-hermit, check-asset-inventory-supported-version ]
name: GCP Asset Inventory CI
runs-on: ubuntu-22.04
if: needs.check-asset-inventory-supported-version.outputs.asset_inventory_supported == 'true'
timeout-minutes: 60
permissions:
contents: "read"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@ jobs:
aws s3 cp "./kspm_d4c.yaml" "$S3_BUCKET/kspm_d4c.yaml"
aws s3 cp "./kspm_eks.yaml" "$S3_BUCKET/kspm_eks.yaml"
aws s3 cp "./cspm-linux.sh" "$S3_BUCKET/cspm-linux.sh"
aws s3 cp "./aws-asset-inventory-linux.sh" "$S3_BUCKET/aws-asset-inventory-linux.sh"
if [[ "${env.asset_inventory_supported}" == "true" ]]; then
aws s3 cp "./aws-asset-inventory-linux.sh" "$S3_BUCKET/aws-asset-inventory-linux.sh"
fi
aws s3 cp "./state_data.json" "$S3_BUCKET/state_data.json"
- name: Install Agentless integrations
Expand Down

0 comments on commit 0d6b37e

Please sign in to comment.