Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzofenix committed Aug 30, 2024
1 parent 3c00ea7 commit 172411a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/acceptance_tests_mta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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"
secrets:
bbl_ssh_key: "${{ secrets.BBL_SSH_KEY }}"
37 changes: 37 additions & 0 deletions .github/workflows/acceptance_tests_mta_close.yaml
Original file line number Diff line number Diff line change
@@ -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:
# <https://github.com/actions/runner/issues/2058> or
# <https://github.com/actions/checkout/issues/785>
export BBL_STATE_PATH="${GITHUB_WORKSPACE}/bbl/bbl-state"
declare -r AUTOSCALER_DIR="${GITHUB_WORKSPACE}/app-autoscaler-release"
make --directory="${AUTOSCALER_DIR}" deploy-cleanup
9 changes: 9 additions & 0 deletions .github/workflows/acceptance_tests_reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
deployment_name:
required: true
type: string
deploy_apps:
required: false
type: boolean
secrets:
bbl_ssh_key:
required: true
Expand Down Expand Up @@ -80,6 +83,12 @@ jobs:
- name: Deploy autoscaler
shell: bash
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 ]
Expand Down

0 comments on commit 172411a

Please sign in to comment.