From f8b12f5249df023f2170f6c41d0847506945cc8e Mon Sep 17 00:00:00 2001 From: cleverchuk Date: Thu, 19 Sep 2024 16:44:19 -0400 Subject: [PATCH] NH-90479: add building auto-instrumentation docker image --- .github/workflows/push.yml | 39 ++++++++++++++++++++++++++++++++++- .github/workflows/release.yml | 9 +++++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4c6f1afb..5defa9db 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -508,4 +508,41 @@ jobs: echo "AGENT_VERSION=${{ steps.set_version.outputs.version }}.$GIT_HASH" >> $GITHUB_ENV - name: Publish - run: ./gradlew publish \ No newline at end of file + run: ./gradlew publish + + docker_image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Set agent version + id: set_version + uses: ./.github/actions/version + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Package Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + context: agent + platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le + tags: solarwinds/autoinstrumentation-java:${{ steps.set_version.outputs.version }},solarwinds/autoinstrumentation-java:latest \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b9de30c..4f73aed7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -387,7 +387,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ steps.set_version.outputs.version }} - docker_hub: + docker_image: runs-on: ubuntu-latest needs: - github_release @@ -417,6 +417,13 @@ jobs: username: ${{ secrets.DOCKER_HUB_CI_USER }} password: ${{ secrets.DOCKER_HUB_CI_PASSWORD }} + - name: Login to GitHub Package Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push uses: docker/build-push-action@v5 with: