From e547b7cdbe863d20913880ef1b0bdee94fba2550 Mon Sep 17 00:00:00 2001 From: Himanshu Rai Date: Sun, 19 Jan 2025 23:34:38 +0530 Subject: [PATCH] test in temp branch --- .github/workflows/release.yaml | 29 +++++++++++------------------ firehose-template.yaml | 2 +- version.cfg | 1 + 3 files changed, 13 insertions(+), 19 deletions(-) create mode 100644 version.cfg diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e3129b1..5ce80ce 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: Build and Deploy AWS Unified Firehose on: push: branches: - - main + - hr_temp jobs: build-and-deploy: @@ -15,21 +15,14 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v3 - with: - role-to-assume: ${{ secrets.AWS_S3_PUBLISHER_ROLE }} - aws-region: us-east-2 - - - name: Install AWS SAM CLI + - name: Check if version.cfg is updated run: | - pip install aws-sam-cli - - - name: Build SAM Application - run: sam build --template-file firehose-template.yaml --region us-east-2 - - - name: Package SAM Application - run: sam package --s3-bucket unified-lambda-serverless --output-template-file firehose-template.yaml --region us-east-2 - - - name: Upload CloudFormation Template to S3 - run: aws s3 cp firehose-template.yaml s3://unified-lambda-serverless/firehose-template.yaml \ No newline at end of file + if ! git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "version.cfg"; then + echo "Error: version.cfg must be updated in this pull request." + exit 1 + fi + + - name: Update Instrumentation Version + run: | + version=$(grep 'instrumentation_version' version.cfg | cut -d '=' -f2) + sed -i "s/{{INSTRUMENTATION_VERSION}}/$version/" firehose-template.yaml \ No newline at end of file diff --git a/firehose-template.yaml b/firehose-template.yaml index fb1424f..f92ed33 100644 --- a/firehose-template.yaml +++ b/firehose-template.yaml @@ -295,7 +295,7 @@ Resources: {"AttributeName": "aws.region", "AttributeValue": region}, {"AttributeName": "instrumentation.provider", "AttributeValue": "aws"}, {"AttributeName": "instrumentation.name", "AttributeValue": "firehose"}, - {"AttributeName": "instrumentation.version", "AttributeValue": "1.0.0"}, + {"AttributeName": "instrumentation.version", "AttributeValue": "{{INSTRUMENTATION_VERSION}}"}, {"AttributeName": "aws.realm", "AttributeValue": awsRealm} ] diff --git a/version.cfg b/version.cfg new file mode 100644 index 0000000..6c8760b --- /dev/null +++ b/version.cfg @@ -0,0 +1 @@ +instrumentation_version=1.0.0 \ No newline at end of file