From 4a415790d0d54fefa95608576e337263a0c01053 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 16:37:41 +0200 Subject: [PATCH 1/9] Added GitHub Action to update repository description --- agent/alpine/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index eb0a3f5b4..977e873ce 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -1,5 +1,6 @@ ![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) + # What is Zabbix? Zabbix is an enterprise-class open source distributed monitoring solution. From e157425aa3e5f1e5af04d85c358617ea44fe411b Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 16:48:34 +0200 Subject: [PATCH 2/9] Added GitHub Action to update repository description --- README.md | 1 + agent/alpine/README.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 063712bb0..d032bb2ee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ ![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) + ![CI](https://github.com/zabbix/zabbix-docker/workflows/CI/badge.svg?branch=master&event=release) ![CI](https://github.com/zabbix/zabbix-docker/workflows/CI/badge.svg?branch=master&event=push) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index 977e873ce..eb0a3f5b4 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -1,6 +1,5 @@ ![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) - # What is Zabbix? Zabbix is an enterprise-class open source distributed monitoring solution. From 64ec173cae54589383aa199602b9c7db2a390ad6 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 16:54:07 +0200 Subject: [PATCH 3/9] Added GitHub Action to update repository description --- agent/alpine/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index eb0a3f5b4..977e873ce 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -1,5 +1,6 @@ ![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) + # What is Zabbix? Zabbix is an enterprise-class open source distributed monitoring solution. From a549c5037c9261ac9cc93b2d6abe5e4f3741f844 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 16:56:45 +0200 Subject: [PATCH 4/9] Added GitHub Action to update repository description --- agent/alpine/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index 977e873ce..b4359343e 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -1,6 +1,5 @@ ![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png) - # What is Zabbix? Zabbix is an enterprise-class open source distributed monitoring solution. @@ -29,7 +28,7 @@ These are the only official Zabbix agent Docker images. They are based on Alpine Zabbix agent 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix agent 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix agent 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) - Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest) + Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest ) Zabbix agent 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, centos-5.0.*) Zabbix agent 5.2 (tags: alpine-5.2-latest, ubuntu-5.2-latest, centos-5.2-latest, alpine-latest, ubuntu-latest, centos-latest, latest) Zabbix agent 5.2.* (tags: alpine-5.2.*, ubuntu-5.2.*, centos-5.2.*) From 4bdbe4c9beb97bde948fda6bb64f427fc7f38dbb Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 17:06:24 +0200 Subject: [PATCH 5/9] Added GitHub Action to update repository description --- agent/alpine/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index b4359343e..eb0a3f5b4 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -28,7 +28,7 @@ These are the only official Zabbix agent Docker images. They are based on Alpine Zabbix agent 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix agent 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix agent 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) - Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest ) + Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest) Zabbix agent 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, centos-5.0.*) Zabbix agent 5.2 (tags: alpine-5.2-latest, ubuntu-5.2-latest, centos-5.2-latest, alpine-latest, ubuntu-latest, centos-latest, latest) Zabbix agent 5.2.* (tags: alpine-5.2.*, ubuntu-5.2.*, centos-5.2.*) From 233666281cc0b2f5f149957361ae8abc1d626eab Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 17:18:59 +0200 Subject: [PATCH 6/9] Added GitHub Action to update repository description --- .github/workflows/CI.yml | 134 +++++++------------- .github/workflows/dockerhub_description.yml | 43 +++++++ 2 files changed, 87 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/dockerhub_description.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6f573fbc6..6db7c8bf3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,6 +9,7 @@ on: - '3.0' - '4.0' - '5.0' + - '5.2' - 'trunk' paths-ignore: - '.env*' @@ -22,6 +23,7 @@ defaults: jobs: build: + timeout-minutes: 70 env: LATEST_BRANCH: "${{ github.event.repository.default_branch }}" DOCKER_REPOSITORY: "zabbix" @@ -51,41 +53,31 @@ jobs: - os: ubuntu build: agent2 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - + uses: actions/checkout@v2 - - name: Install buildx - env: - DOCKER_CLI_EXPERIMENTAL: enabled - run: | - BUILDX_VERSION="0.4.2" - QEMU_TAG="latest" - mkdir -p ~/.docker/cli-plugins/ - curl -L https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64 \ - -o ~/.docker/cli-plugins/docker-buildx - chmod +x ~/.docker/cli-plugins/docker-buildx - docker pull -q multiarch/qemu-user-static:latest - docker run --rm --privileged multiarch/qemu-user-static:${QEMU_TAG} --reset -p yes --credential yes - docker buildx create --name builder-${GITHUB_SHA::8} --driver docker-container --use - docker buildx inspect --bootstrap - docker info - docker buildx inspect - - - name: Available platforms - run: docker buildx inspect | grep Platforms + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Prepare platform list id: platform run: | - DOCKER_PLATFORM="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le" + DOCKER_PLATFORM="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le" if [ "${{ matrix.os }}" == "ubuntu" ]; then - DOCKER_PLATFORM="linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le" - fi - - if [ "${{ matrix.os }}" == "ubuntu" ] && [ "${{ matrix.build }}" == "snmptraps" ]; then - DOCKER_PLATFORM="linux/amd64,linux/arm64" + DOCKER_PLATFORM="linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le" fi if [ "${{ matrix.os }}" == "centos" ]; then @@ -124,17 +116,12 @@ jobs: TAGS_ARRAY+=("$IMAGE_NAME:${{ matrix.os }}-latest") fi - TAGS=$(printf -- "--tag %s " "${TAGS_ARRAY[@]}") + TAGS=$(printf -- "%s, " "${TAGS_ARRAY[@]}") echo "::debug::Tags - ${TAGS}" echo ::set-output name=image_name::${IMAGE_NAME} - echo ::set-output name=image_tag_versions::$(printf -- "|%s" "${TAGS_ARRAY[@]}") - echo ::set-output name=buildx_args::--platform "${{ steps.platform.outputs.list }}" \ - --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ - --build-arg VCS_REF=${GITHUB_SHA::8} \ - ${TAGS} \ - --file ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile ./${{ matrix.build }}/${{ matrix.os }} + echo ::set-output name=image_tag_versions::$(printf -- "%s," "${TAGS_ARRAY[@]}") - name: Prepare environment (release) if: github.event_name == 'release' && github.event.action == 'published' @@ -158,68 +145,35 @@ jobs: TAGS=$(printf -- "--tag %s " "${TAGS_ARRAY[@]}") echo ::set-output name=image_name::${IMAGE_NAME} - echo ::set-output name=image_tag_versions::$(printf -- "|%s" "${TAGS_ARRAY[@]}") - echo ::set-output name=buildx_args::--platform "${{ steps.platform.outputs.list }}" \ - --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ - --build-arg VCS_REF=${GITHUB_SHA::8} \ - $TAGS \ - --file ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile ./${{ matrix.build }}/${{ matrix.os }} + echo ::set-output name=image_tag_versions::$(printf -- ",%s" "${TAGS_ARRAY[@]}") - - name: Build images - env: - DOCKER_CLI_EXPERIMENTAL: enabled + - name: Prepare tags + id: prepare_tags run: | - if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then - BUILDX_ARGS="${{ steps.prepare_push.outputs.buildx_args }}" - elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then - BUILDX_ARGS="${{ steps.prepare_release.outputs.buildx_args }}" + if [ ! -z "${{ steps.prepare_push.outputs.image_tag_versions }}" ]; then + TAGS="${{ steps.prepare_push.outputs.image_tag_versions }}" + IMAGE_NAME="${{ steps.prepare_push.outputs.image_name }}" + elif [ ! -z "${{ steps.prepare_release.outputs.image_tag_versions }}" ]; then + TAGS="${{ steps.prepare_release.outputs.image_tag_versions }}" + IMAGE_NAME="${{ steps.prepare_release.outputs.image_name }}" else exit 1 fi - docker buildx build --cache-to "type=local,dest=/tmp/.buildx-cache" \ - --output "type=image,push=false" \ - ${BUILDX_ARGS} + echo ::set-output name=image_tag_versions::${TAGS} + echo ::set-output name=image_name::${IMAGE_NAME} - - name: Docker Hub login - if: success() - uses: docker/login-action@v1 + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + context: ./${{ matrix.build }}/${{ matrix.os }} + file: ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile + platforms: ${{ steps.platform.outputs.list }} + push: ${{ secrets.AUTO_PUSH_IMAGES }} + tags: ${{ steps.prepare_tags.outputs.image_tag_versions }} - - name: Push images from cache - if: success() - env: - DOCKER_CLI_EXPERIMENTAL: enabled - run: | - if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then - BUILDX_ARGS="${{ steps.prepare_push.outputs.buildx_args }}" - elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then - BUILDX_ARGS="${{ steps.prepare_release.outputs.buildx_args }}" - fi - - docker buildx build --cache-from "type=local,src=/tmp/.buildx-cache" \ - --output "type=image,push=${{ secrets.AUTO_PUSH_IMAGES }}" \ - ${BUILDX_ARGS} - - - name: Inspect images - run: | - echo "::debug::push - ${{ steps.prepare_push.outputs.buildx_args }}" - echo "::debug::release - ${{ steps.prepare_release.outputs.buildx_args }}" - - if [ ! -z "${{ steps.prepare_push.outputs.image_tag_versions }}" ]; then - IMAGE_TAG_VERSIONS="${{ steps.prepare_push.outputs.image_tag_versions }}" - echo "::debug::tags push raw - $IMAGE_TAG_VERSIONS" - elif [ ! -z "${{ steps.prepare_release.outputs.image_tag_versions }}" ]; then - IMAGE_TAG_VERSIONS="${{ steps.prepare_release.outputs.image_tag_versions }}" - echo "::debug::tags release raw - $IMAGE_TAG_VERSIONS" - fi - - IMAGE_TAG_VERSIONS=${IMAGE_TAG_VERSIONS%%+(|)} - IFS='|' read -r -a IMAGE_TAG_VERSIONS <<< $IMAGE_TAG_VERSIONS - - for version in ${IMAGE_TAG_VERSIONS[@]}; do - echo "Checking \"$version\"... " - docker buildx imagetools inspect $version - done + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/.github/workflows/dockerhub_description.yml b/.github/workflows/dockerhub_description.yml new file mode 100644 index 000000000..831d9b5f8 --- /dev/null +++ b/.github/workflows/dockerhub_description.yml @@ -0,0 +1,43 @@ +name: DockerHub Description + +on: + push: + branches: + - 'master' + paths: + - "*/*/README.md" + workflow_dispatch: + +jobs: + main: + runs-on: ubuntu-latest + env: + DOCKER_REPOSITORY: "zabbix" + SUBDIR: "alpine" + strategy: + fail-fast: false + matrix: + build: + - agent + - agent2 + - java-gateway + - proxy-mysql + - proxy-sqlite3 + - server-mysql + - server-pgsql + - snmptraps + - web-apache-mysql + - web-apache-pgsql + - web-nginx-mysql + - web-nginx-pgsql + steps: + - + uses: actions/checkout@v2 + - + name: Update DockerHub repo description + uses: peter-evans/dockerhub-description@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }} + readme-filepath: ./${{ matrix.build }}/${{ env.SUBDIR }}/README.md From 30858245af64bf1b826aba3c9fb026fcba851128 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 17:19:26 +0200 Subject: [PATCH 7/9] Added GitHub Action to update repository description --- agent/alpine/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index eb0a3f5b4..b4359343e 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -28,7 +28,7 @@ These are the only official Zabbix agent Docker images. They are based on Alpine Zabbix agent 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix agent 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix agent 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) - Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest) + Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest ) Zabbix agent 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, centos-5.0.*) Zabbix agent 5.2 (tags: alpine-5.2-latest, ubuntu-5.2-latest, centos-5.2-latest, alpine-latest, ubuntu-latest, centos-latest, latest) Zabbix agent 5.2.* (tags: alpine-5.2.*, ubuntu-5.2.*, centos-5.2.*) From b48b9cbdaa3ef8366f1ba2f0cb1d616ebe7f1380 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 17:20:31 +0200 Subject: [PATCH 8/9] Added GitHub Action to update repository description --- .github/workflows/dockerhub_description.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub_description.yml b/.github/workflows/dockerhub_description.yml index 831d9b5f8..dff7e256c 100644 --- a/.github/workflows/dockerhub_description.yml +++ b/.github/workflows/dockerhub_description.yml @@ -3,7 +3,7 @@ name: DockerHub Description on: push: branches: - - 'master' + - 'trunk' paths: - "*/*/README.md" workflow_dispatch: From bcdf7aee4135e2b679aef006832076a487466858 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 15 Feb 2021 17:20:51 +0200 Subject: [PATCH 9/9] Added GitHub Action to update repository description --- agent/alpine/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/alpine/README.md b/agent/alpine/README.md index b4359343e..eb0a3f5b4 100644 --- a/agent/alpine/README.md +++ b/agent/alpine/README.md @@ -28,7 +28,7 @@ These are the only official Zabbix agent Docker images. They are based on Alpine Zabbix agent 4.2.* (tags: alpine-4.2.*, ubuntu-4.2.*, centos-4.2.*) (unsupported) Zabbix agent 4.4 (tags: alpine-4.4-latest, ubuntu-4.4-latest, centos-4.4-latest) (unsupported) Zabbix agent 4.4.* (tags: alpine-4.4.*, ubuntu-4.4.*, centos-4.4.*) (unsupported) - Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest ) + Zabbix agent 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, centos-5.0-latest) Zabbix agent 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, centos-5.0.*) Zabbix agent 5.2 (tags: alpine-5.2-latest, ubuntu-5.2-latest, centos-5.2-latest, alpine-latest, ubuntu-latest, centos-latest, latest) Zabbix agent 5.2.* (tags: alpine-5.2.*, ubuntu-5.2.*, centos-5.2.*)