From 787fe8de2a8c1db5f3aca91545dccea22d108328 Mon Sep 17 00:00:00 2001 From: Dmitry Gurevich Date: Mon, 27 Jan 2025 14:30:02 +0200 Subject: [PATCH] Add ECH agentless and agent-based installation workflow (#2919) * add ech agentless wf * update wf * enable wf run by pull_request * remove pull_request and enable jobs * update wf params --- .github/workflows/test-ech-agentless.yml | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/test-ech-agentless.yml diff --git a/.github/workflows/test-ech-agentless.yml b/.github/workflows/test-ech-agentless.yml new file mode 100644 index 0000000000..a42cdf5274 --- /dev/null +++ b/.github/workflows/test-ech-agentless.yml @@ -0,0 +1,57 @@ +name: Test ECH Environment +run-name: Creating ECH Environment by @${{ github.actor }} + +on: + workflow_dispatch: + schedule: + - cron: '0 4 * * *' # every day at 04:00 + +jobs: + naming: + runs-on: ubuntu-latest + outputs: + deployment_name: ${{ steps.set-variables.outputs.date-name }} + stack_version: ${{ steps.set-variables.outputs.stack-version }} + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Hermit Environment + uses: ./.github/actions/hermit + + - name: Set variables + id: set-variables + env: + STACK_VERSION: ${{ env.ELK_VERSION }} + run: | + date_name=$(echo "prd-ech-$(date +'%d%b%H%M')" | tr '[:upper:]' '[:lower:]') + echo "date-name=$date_name" >> $GITHUB_OUTPUT + echo "stack-version=$STACK_VERSION" >> $GITHUB_OUTPUT + + deploy: + needs: naming + uses: ./.github/workflows/test-environment.yml + secrets: inherit + # Required for the 'Deploy' job in the 'test-environment.yml' to authenticate with Google Cloud (gcloud). + permissions: + contents: 'read' + id-token: 'write' + with: + deployment_name: ${{ needs.naming.outputs.deployment_name }} + elk-stack-version: ${{ needs.naming.outputs.stack_version }} + ess-region: "gcp-us-west2" + serverless_mode: false + run-sanity-tests: true + expiration_days: 0 + + destroy_environment: + needs: ["naming", "deploy"] + uses: ./.github/workflows/destroy-environment.yml + secrets: inherit + # Required for the 'Destroy' job in the 'destroy-environment.yml' + permissions: + contents: 'read' + id-token: 'write' + if: success() + with: + prefix: ${{ needs.naming.outputs.deployment_name }}