From aaa7f2257b8f6ee5d95e7d8fff0a3657883d10d7 Mon Sep 17 00:00:00 2001 From: cleverchuk Date: Tue, 25 Jun 2024 15:37:55 -0400 Subject: [PATCH] NH-37575: upgrade to `joboe:10.0.6` --- .github/workflows/release-test.yml | 136 +++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 .github/workflows/release-test.yml diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 00000000..f0b7df3e --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,136 @@ +name: Push + +on: + workflow_dispatch: + push: + +permissions: + packages: write + contents: read + id-token: write + +env: + SW_APM_DEBUG_LEVEL: trace + AGENT_DOWNLOAD_URL: https://agent-binaries.global.st-ssp.solarwinds.com/apm/java/latest/solarwinds-apm-agent.jar + SW_APM_COLLECTOR: apm.collector.na-01.st-ssp.solarwinds.com + OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }} + SW_APM_SERVICE_KEY_AO: ${{ secrets.SW_APM_SERVICE_KEY_AO }} + SW_APM_SERVICE_KEY: ${{ secrets.SW_APM_SERVICE_KEY }} + GITHUB_USERNAME: ${{ github.actor }} + SWO_LOGIN_URL: ${{ secrets.SWO_LOGIN_URL }} + SWO_HOST_URL: ${{ secrets.SWO_HOST_URL }} + SWO_EMAIL: ${{ secrets.SWO_EMAIL }} + SWO_PWORD: ${{ secrets.SWO_PWORD }} + STAGE_BUCKET: ${{ secrets.STAGE_BUCKET }} + +jobs: + s3-stage-upload: # this job uploads the jar to stage s3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_S3_ROLE_ARN_SSP_STAGE }} + aws-region: "us-east-1" + + - name: Build agent + run: ./gradlew clean build -x test + + - name: Set agent version env + run: | + echo "AGENT_VERSION=$(cd agent/build/libs && unzip -p solarwinds-apm-agent.jar META-INF/MANIFEST.MF | grep Implementation-Version | awk '{ print $2 }')" >> $GITHUB_ENV + + - name: Copy to S3 + run: | + ls -al + aws s3 cp agent/build/libs/solarwinds-apm-agent.jar \ + s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-agent.jar \ + --acl public-read + + aws s3 cp agent-lambda/build/libs/solarwinds-apm-agent-lambda.jar \ + s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-agent-lambda.jar \ + --acl public-read + + aws s3 cp custom/shared/src/main/resources/solarwinds-apm-config.json \ + s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-config.json \ + --acl public-read + + - name: Copy to S3(latest) + run: | + aws s3 cp s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-agent.jar \ + s3://$STAGE_BUCKET/apm/java/latest/solarwinds-apm-agent.jar \ + --acl public-read + + aws s3 cp s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-agent-lambda.jar \ + s3://$STAGE_BUCKET/apm/java/latest/solarwinds-apm-agent-lambda.jar \ + --acl public-read + + aws s3 cp s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-config.json \ + s3://$STAGE_BUCKET/apm/java/latest/solarwinds-apm-config.json \ + --acl public-read + + touch VERSION + echo "version: $AGENT_VERSION" >> VERSION + SHA256=$(sha256sum agent/build/libs/solarwinds-apm-agent.jar) + echo "sha256: $SHA256" >> VERSION + + aws s3 cp VERSION \ + s3://$STAGE_BUCKET/apm/java/latest/VERSION \ + --acl public-read + + release-test: + runs-on: windows-latest + env: + LAMBDA: "false" + needs: + - s3-stage-upload + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Docker login + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin + + - name: Build smoke-test + run: | + cd smoke-tests + ./gradlew build -x test + + - name: Build webmvc jar + run: | + cd smoke-tests + ./gradlew :spring-boot-webmvc:build + + - name: Build webmvc image + run: | + cd smoke-tests/spring-boot-webmvc + docker image build --tag smt:webmvc . + + - name: Execute smoke tests + run: | + cd smoke-tests + ./gradlew test + + - uses: actions/upload-artifact@v3 + if: always() + with: + path: smoke-tests/build/reports/tests/test + + - name: Docker logout + run: docker logout