Skip to content

Commit

Permalink
Merge pull request #17 from newrelic/NR-355258
Browse files Browse the repository at this point in the history
test in temp branch
  • Loading branch information
hrai-nr authored Jan 19, 2025
2 parents 488eeaf + e547b7c commit 8461fa6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and Deploy AWS Unified Firehose
on:
push:
branches:
- main
- hr_temp

jobs:
build-and-deploy:
Expand All @@ -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
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
2 changes: 1 addition & 1 deletion firehose-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]
Expand Down
1 change: 1 addition & 0 deletions version.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instrumentation_version=1.0.0

0 comments on commit 8461fa6

Please sign in to comment.