🪲 Destroy Test Infra #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🪲 Destroy Test Infra | |
on: | |
workflow_dispatch: | |
inputs: | |
unique_tag: | |
description: 'Unique tag or prefix' | |
required: true | |
clean_packaging_infra: | |
description: 'Destroy packaging infra?' | |
required: true | |
type: boolean | |
default: false | |
clean_canary_infra: | |
description: 'Destroy canary infra?' | |
required: true | |
type: boolean | |
default: false | |
platform: | |
description: 'Platform prefix for canary ec2 names' | |
required: true | |
type: string | |
default: "linux" | |
permissions: | |
id-token: write | |
jobs: | |
clean-infra: | |
name: Clean infra | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
aws-region: us-east-2 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set branch name | |
run: | | |
# Short name for current branch. For PRs, use target branch (base ref) | |
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
# Is the ref a tag? If so, remove refs/tags/ prefix | |
GIT_BRANCH=${GIT_BRANCH#refs/tags/} | |
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV | |
- name: Clean packaging infra | |
uses: newrelic/fargate-runner-action@main | |
if: ${{ inputs.clean_packaging_infra }} | |
with: | |
aws_region: us-east-2 | |
container_make_target: "test/provision-clean TAG_OR_UNIQUE_NAME=otel-${{ inputs.unique_tag }}" | |
ecs_cluster_name: caos_otel_releases | |
task_definition_name: otel-releases | |
cloud_watch_logs_group_name: /ecs/test-prerelease-otel-releases | |
cloud_watch_logs_stream_name: ecs/test-otel-releases | |
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }} | |
repo_name: "newrelic/opentelemetry-collector-releases" | |
ref: "${{ env.GIT_BRANCH }}" | |
log_filters: | | |
Destroy\scomplete! | |
- name: Clean canary infra | |
uses: newrelic/fargate-runner-action@main | |
if: ${{ inputs.clean_canary_infra }} | |
with: | |
aws_region: us-east-2 | |
container_make_target: "test/provision-clean TAG_OR_UNIQUE_NAME=otel-canary:${{ inputs.unique_tag }}-${{ inputs.platform }}" | |
ecs_cluster_name: caos_otel_releases | |
task_definition_name: otel-releases | |
cloud_watch_logs_group_name: /ecs/test-prerelease-otel-releases | |
cloud_watch_logs_stream_name: ecs/test-otel-releases | |
aws_vpc_subnet: ${{ secrets.AWS_VPC_SUBNET }} | |
repo_name: "newrelic/opentelemetry-collector-releases" | |
ref: "${{ env.GIT_BRANCH }}" | |
log_filters: | | |
Destroy\scomplete! |