revamping the sample application #7
This file contains hidden or 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: Deploy using AWS CLI | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'README.md' | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| integration-tests: | |
| name: Run Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Build Lambdas | |
| run: cd lambda-functions && mvn clean package shade:shade | |
| - name: Spin up LocalStack | |
| run: | | |
| docker compose up -d | |
| sleep 120 | |
| env: | |
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} | |
| - name: Setup the solutions | |
| run: | | |
| pip install awscli-local | |
| bash solutions/dynamodb-outage.sh | |
| bash solutions/route53-failover.sh | |
| - name: Debug steps | |
| run: | | |
| dig @127.0.0.1 test.hello-localstack.com CNAME +short | |
| export PRIMARY_API_REGION=us-east-1 | |
| curl -L --request POST 'http://localhost:4566/_localstack/chaos/faults' \ | |
| --header 'Content-Type: application/json' \ | |
| --data "[ | |
| {\"service\": \"apigateway\", \"region\": \"${PRIMARY_API_REGION}\"}, | |
| {\"service\": \"lambda\", \"region\": \"${PRIMARY_API_REGION}\"} | |
| ]" | |
| sleep 40 | |
| dig @127.0.0.1 test.hello-localstack.com CNAME +short | |
| curl --location --request POST 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \ | |
| --header 'Content-Type: application/json' \ | |
| --data '[]' | |
| sleep 30 | |
| dig @127.0.0.1 test.hello-localstack.com CNAME +short | |
| - name: Run Integration Tests | |
| run: | | |
| pip3 install boto3 pytest requests dnspython | |
| pytest | |
| env: | |
| AWS_DEFAULT_REGION: us-east-1 | |
| AWS_REGION: us-east-1 | |
| AWS_ACCESS_KEY_ID: test | |
| AWS_SECRET_ACCESS_KEY: test | |
| - name: Logs out of LocalStack | |
| if: always() | |
| run: | | |
| docker compose logs |