-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b22ec9
commit 6491b61
Showing
1 changed file
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
name: Release-test | ||
|
||
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: ubuntu-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 |