Skip to content

S3 ec2 deploy #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/django-sample-app-s3-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
## SPDX-License-Identifier: Apache-2.0

name: App Signals Enablement - S3 Springboot Sample App Deployment
on:
workflow_dispatch: # be able to run the workflow on demand

permissions:
id-token: write
contents: read

jobs:
upload-sample-app-zip:
strategy:
fail-fast: false
matrix:
aws-region: [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
'us-east-1','us-east-2', 'us-west-1', 'us-west-2' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# TODO: Remove this step after ADOT python published to PyPI
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::637423224110:role/pulse-enablement-workflow-role
aws-region: us-east-1

# TODO: Remove this step after ADOT python published to PyPI
- name: Get Adot Wheel file
run: aws s3 cp s3://adot-autoinstrumentation-python-staging/${{ secrets.ADOT_WHEEL_NAME }} ./sample-apps/python/${{ secrets.ADOT_WHEEL_NAME }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.E2E_SECRET_TEST_ROLE_ARN }}
aws-region: us-east-1

- name: Retrieve account
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids:
ACCOUNT_ID, region-account/${{ matrix.aws-region }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }}
aws-region: ${{ matrix.aws-region }}



- name: Build Sample App Zip
working-directory: sample-apps/python
run: zip -r python-sample-app.zip .

# TODO: Remove put ADOT_WHEEL_NAME to S3 after ADOT python published to PyPI
- name: Upload to S3
working-directory: sample-apps/python
run: |
aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./${{ secrets.ADOT_WHEEL_NAME }} --key ${{ secrets.ADOT_WHEEL_NAME }}
aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./python-sample-app.zip --key python-sample-app.zip