Skip to content
name: Automation - Test and Create Release Tags for OCB components
on:
push:
workflow_dispatch:
inputs:
ocb-module-version:
required: true
description: Release Tag version (Follows OTel Collector Versioning, like 0.113.0)
permissions:
id-token: write
contents: read
env:
OCB_MODULE_VERSION: 0.113.0 #${{ inputs.ocb-module-version }}
jobs:
setup-ocb-test-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: aws-ocb-dev-workflows-checkpoint
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.RELEASE_TEST_ACCOUNT_ID }}:role/${{ secrets.RELEASE_TEST_ACCOUNT_ROLE }}
aws-region: us-east-1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to private AWS ECR
uses: docker/login-action@v3
with:
registry: ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com
env:
AWS_REGION: us-east-1
- name: Update versions used in OCB testing
run: |
sed -i -e 's#${TEST_COMPONENT_GITHASH}#${{ github.sha }}#g' ./ocb-utils/builder-config-appsignals.yaml
sed -i -e 's#${OCB_VERSION}#${{ env.OCB_MODULE_VERSION }}#g' ./ocb-utils/builder-config-appsignals.yaml
sed -i -e 's#${OCB_VERSION}#${{ env.OCB_MODULE_VERSION }}#g' ./ocb-utils/Dockerfile
- name: test CAT
run: |
cat ./ocb-utils/builder-config-appsignals.yaml
cat ./ocb-utils/Dockerfile
- name: Build and push image with latest git hash as tag
uses: docker/build-push-action@v5
with:
push: true
context: ./ocb-utils/
file: ./ocb-utils/Dockerfile
platforms: linux/amd64
tags: ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ocb-release-test-collector:${{ github.sha }}
load: false
cache-from: type=gha,scope=build-${{ github.ref_name }}-ocb
cache-to: type=gha,scope=build-${{ github.ref_name }}-ocb
# ocb-e2e-test:
# secrets: inherit
# needs: [ setup-test-for-prepare-release ]
# uses: jj22ee/aws-application-signals-test-framework/.github/workflows/java-eks-otlp-ocb-test.yml@otlp-ocb-main-build
# with:
# aws-region: us-east-1
# test-cluster-name: 'e2e-otel-collector-contrib-release-test'
# caller-workflow-name: 'main-build-java-e2e-eks-otlp-ocb-canary-test'
# java-version: '11'
# e2e-otel-collector-image-tag: ${{ github.sha }}
update-canary-image-and-tag-release:
runs-on: ubuntu-latest
needs: [ setup-ocb-test-image ]
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: aws-ocb-dev-workflows
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.RELEASE_TEST_ACCOUNT_ID }}:role/${{ secrets.RELEASE_TEST_ACCOUNT_ROLE }}
aws-region: us-east-1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to private AWS ECR
uses: docker/login-action@v3
with:
registry: ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com
env:
AWS_REGION: us-east-1
- name: Build and push image with latest tag
run: |
docker image pull ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ocb-release-test-collector:${{ github.sha }}
docker tag ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ocb-release-test-collector:${{ github.sha }} ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ocb-release-test-collector:latest
docker push ${{ secrets.RELEASE_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ocb-release-test-collector:latest
# - name: Tag OCB modules
# run: |
# git tag internal/aws/cwlogs/v${{ env.OCB_MODULE_VERSION }}
# git tag internal/aws/awsutil/v${{ env.OCB_MODULE_VERSION }}
# git tag exporter/awsemfexporter/v${{ env.OCB_MODULE_VERSION }}
# git tag processor/awsapplicationsignalsprocessor/v${{ env.OCB_MODULE_VERSION }}
# - name: Publish tags for OCB modules
# run: git push --tags