From d65d20a80a366be541f69a38bd6f573e1e3c47bd Mon Sep 17 00:00:00 2001 From: Alan Moran Date: Fri, 30 Aug 2024 10:47:35 +0200 Subject: [PATCH] WIP --- .github/workflows/acceptance_tests_mta.yaml | 28 ++++++++++++++ .../workflows/acceptance_tests_mta_close.yaml | 37 +++++++++++++++++++ .../workflows/acceptance_tests_reusable.yaml | 15 ++++++++ 3 files changed, 80 insertions(+) create mode 100644 .github/workflows/acceptance_tests_mta.yaml create mode 100644 .github/workflows/acceptance_tests_mta_close.yaml diff --git a/.github/workflows/acceptance_tests_mta.yaml b/.github/workflows/acceptance_tests_mta.yaml new file mode 100644 index 0000000000..dfe0285f63 --- /dev/null +++ b/.github/workflows/acceptance_tests_mta.yaml @@ -0,0 +1,28 @@ +name: Acceptance Tests - MTA +on: + pull_request: + types: [ opened, labeled, synchronize ] + +concurrency: + group: "${{ github.workflow }}/${{ github.ref }}" + cancel-in-progress: true + +jobs: + acceptance_tests_reusable: + name: " " # Whitespace name looks nicest on Github UI + uses: ./.github/workflows/acceptance_tests_reusable.yaml + with: + deployment_name: "autoscaler-mta-${{ github.event.pull_request.number }}" + deploy_apps: true + ops_files: | + operations/add-releases.yml + operations/instance-identity-cert-from-cf.yml + operations/add-postgres-variables.yml + operations/enable-nats-tls.yml + operations/add-extra-plan.yml + operations/set-release-version.yml + operations/enable-metricsforwarder-via-syslog-agent.yml + operations/enable-scheduler-logging.yml + operations/use-cf-services.yml + secrets: + bbl_ssh_key: "${{ secrets.BBL_SSH_KEY }}" diff --git a/.github/workflows/acceptance_tests_mta_close.yaml b/.github/workflows/acceptance_tests_mta_close.yaml new file mode 100644 index 0000000000..2eca2084d7 --- /dev/null +++ b/.github/workflows/acceptance_tests_mta_close.yaml @@ -0,0 +1,37 @@ +name: Acceptance Tests Cleanup (MTA) +on: + pull_request: + types: [closed] +env: + PR_NUMBER: "${{ github.event.pull_request.number }}" + DEPLOYMENT_NAME: "autoscaler-mta-${{ github.event.pull_request.number }}" + +jobs: + deployment_cleanup: + name: Cleanup deployments + runs-on: ubuntu-latest + container: + image: ghcr.io/cloudfoundry/app-autoscaler-release-tools:main + steps: + - uses: actions/checkout@v4 + with: + path: app-autoscaler-release + ref: main + + - uses: ./app-autoscaler-release/.github/actions/setup-environment + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} + + - name: "clean up" + shell: bash + run: | + #! /usr/bin/env bash + set -eu -o pipefail + + # The subsequent assignments are needed *HERE* because of: + # or + # + export BBL_STATE_PATH="${GITHUB_WORKSPACE}/bbl/bbl-state" + declare -r AUTOSCALER_DIR="${GITHUB_WORKSPACE}/app-autoscaler-release" + + make --directory="${AUTOSCALER_DIR}" deploy-cleanup diff --git a/.github/workflows/acceptance_tests_reusable.yaml b/.github/workflows/acceptance_tests_reusable.yaml index cbf1e0fa3a..fda2f27408 100644 --- a/.github/workflows/acceptance_tests_reusable.yaml +++ b/.github/workflows/acceptance_tests_reusable.yaml @@ -12,6 +12,12 @@ on: deployment_name: required: true type: string + deploy_apps: + required: false + type: boolean + ops_files: + required: false + type: string secrets: bbl_ssh_key: required: true @@ -79,8 +85,17 @@ jobs: ssh-key: ${{ secrets.bbl_ssh_key}} - name: Deploy autoscaler shell: bash + env: + OPS_FILES: ${{ inputs.ops_files }} run: make --directory="${AUTOSCALER_DIR}" deploy-autoscaler + - name: Deploy Apps + shell: bash + run: make --directory="${AUTOSCALER_DIR}" deploy-apps + if: ${{ inputs.deploy_apps }} + + + acceptance_tests: needs: [ deploy_autoscaler ] strategy: