From 7877a98bd9c00db5e81dd2f8c734cba2bab20be7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 12 Aug 2022 09:26:17 +0200 Subject: Merging upstream version 1.36.0. Signed-off-by: Daniel Baumann --- .github/workflows/docker.yml | 88 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 3 deletions(-) (limited to '.github/workflows/docker.yml') diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b1df95c33..b7eb53c8e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,6 +59,7 @@ jobs: failure() && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/master') + && github.repository == 'netdata/netdata' }} docker-ci: @@ -114,6 +115,7 @@ jobs: failure() && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/master') + && github.repository == 'netdata/netdata' }} normalize-tag: # Fix the release tag if needed @@ -149,7 +151,7 @@ jobs: id: release-tags if: github.event.inputs.version != 'nightly' run: | - echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }})" \ + echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }} '')" \ >> "${GITHUB_ENV}" - name: Determine which tags to use id: nightly-tags @@ -168,6 +170,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Docker Hub Login id: login + if: github.repository == 'netdata/netdata' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} @@ -177,7 +180,7 @@ jobs: uses: docker/build-push-action@v3 with: platforms: linux/amd64,linux/i386,linux/arm/v7,linux/arm64,linux/ppc64le - push: true + push: ${{ github.repository == 'netdata/netdata' }} tags: ${{ env.tags }} build-args: OFFICIAL_IMAGE=${{ env.OFFICIAL_IMAGE }} - name: Failure Notification @@ -204,9 +207,10 @@ jobs: failure() && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/master') + && github.repository == 'netdata/netdata' }} - name: Trigger Helmchart PR - if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != 'nightly' + if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != 'nightly' && github.repository == 'netdata/netdata' uses: benc-uk/workflow-dispatch@v1 with: token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} @@ -214,3 +218,81 @@ jobs: workflow: Agent Version PR ref: refs/heads/master inputs: '{"agent_version": "${{ needs.normalize-tag.outputs.tag }}"}' + + docker-dbg-publish: + if: github.event_name == 'workflow_dispatch' + name: Docker Build and Publish (Debuging Image) + needs: + - docker-test + - normalize-tag + runs-on: ubuntu-latest + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Determine which tags to use + id: release-tags + if: github.event.inputs.version != 'nightly' + run: | + echo "tags=netdata/netdata-debug:latest,netdata/netdata-debug:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }} '-debug')" \ + >> "${GITHUB_ENV}" + - name: Determine which tags to use + id: nightly-tags + if: github.event.inputs.version == 'nightly' + run: | + echo "tags=netdata/netdata-debug:latest,netdata/netdata-debug:edge" >> "${GITHUB_ENV}" + - name: Mark image as official + id: env + if: github.repository == 'netdata/netdata' + run: echo "OFFICIAL_IMAGE=true" >> "${GITHUB_ENV}" + - name: Setup QEMU + id: qemu + uses: docker/setup-qemu-action@v2 + - name: Setup Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Docker Hub Login + id: login + if: github.repository == 'netdata/netdata' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Docker Build + id: build + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64,linux/i386,linux/arm/v7,linux/arm64,linux/ppc64le + push: ${{ github.repository == 'netdata/netdata' }} + tags: ${{ env.tags }} + build-args: | + OFFICIAL_IMAGE=${{ env.OFFICIAL_IMAGE }} + DEBUG_BUILD=1 + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Docker Debug Build failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to build or publish Docker debug images. + CHeckout: ${{ steps.checkout.outcome }} + Generate release tags: ${{ steps.release-tags.outcome }} + Generate nightly tags: ${{ steps.nightly-tags.outcome }} + Setup environment: ${{ steps.env.outcome }} + Setup QEMU: ${{ steps.qemu.outcome }} + Setup buildx: ${{ steps.buildx.outcome }} + Authenticate against DockerHub: ${{ steps.login.outcome }} + Build and publish images: ${{ steps.build.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name != 'pull_request' + && startsWith(github.ref, 'refs/heads/master') + && github.repository == 'netdata/netdata' + }} -- cgit v1.2.3