Workflow file for this run
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
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
## SPDX-License-Identifier: Apache-2.0 | |
# This workflow is for building and uploading the Java sample application to S3 bucket. Java 11 will be built and uploaded to all regions to be used by the canary while other versions (8, 17, 21, 22) | |
# will be uploaded to us-east-1 for the purpose of testing ADOT Java | |
name: Sample App Deployment - Java S3 | |
on: | |
push: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} | |
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} | |
jobs: | |
java-main: | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: [ '22' ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java-version }} | |
check-latest: true | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} | |
aws-region: us-east-1 | |
- name: Build and Upload Main Jar | |
working-directory: sample-apps/java/springboot-main-service | |
run: | | |
# For Java 8, springboot must be lower than version 3 | |
# For Java 11,17,21, they are compatible with both springboot version | |
# For Java 22 and above, springboot must be version 3 or higher | |
if [ "${{ matrix.java-version }}" = "22" ]; then | |
sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts | |
cat build.gradle.kts | |
fi | |
gradle build -PjavaVersion=${{ matrix.java-version }} | |
aws s3api put-object --bucket aws-appsignals-sample-app-prod-us-east-1 --body ./build/libs/springboot-*-SNAPSHOT.jar --key java-main-service-v${{ matrix.java-version }}.jar | |
java-remote: | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: [ '22' ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java-version }} | |
check-latest: true | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} | |
aws-region: us-east-1 | |
- name: Build and Upload Remote Jar | |
working-directory: sample-apps/java/springboot-remote-service | |
run: | | |
# For Java 8, springboot must be lower than version 3 | |
# For Java 11,17,21, they are compatible with both springboot version | |
# For Java 22 and above, springboot must be version 3 or higher | |
if [ "${{ matrix.java-version }}" = "22" ]; then | |
sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts | |
cat build.gradle.kts | |
fi | |
gradle build -PjavaVersion=${{ matrix.java-version }} | |
aws s3api put-object --bucket aws-appsignals-sample-app-prod-us-east-1 --body ./build/libs/springboot-remote-service-*-SNAPSHOT.jar --key java-remote-service-v${{ matrix.java-version }}.jar | |