From bf17138e184b2d290203c6b61111c9e769f7788d Mon Sep 17 00:00:00 2001 From: Tai Lee Date: Wed, 24 Mar 2021 00:33:06 +1100 Subject: [PATCH] Build multiarch image (7.8) via GitHub Actions. --- .github/dependabot.yml | 7 +++ .github/workflows/ci.yml | 98 ++++++++++++++++++++++++++++++++++++++++ 7/Dockerfile | 2 +- codefresh.yml | 97 --------------------------------------- 4 files changed, 106 insertions(+), 98 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 codefresh.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5b1b32f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 + +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e0c3914 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,98 @@ +name: Continuous Integration + +on: + push: + branches: '*' + schedule: + - cron: '0 17 * * *' + +jobs: + image-x64: + runs-on: + - linux + - self-hosted + - x64 + steps: + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push Image + uses: docker/build-push-action@v2 + with: + file: ${{ matrix.version }}/Dockerfile + push: true + tags: + - ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:${{ matrix.version }} + - ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }} + strategy: + matrix: + version: + - 1 + - 1-alpine + - 2.4 + - 2.4-alpine + - 5 + - 5.alpine + - 6 + + image-multiarch: + runs-on: + - ${{ matrix.arch }} + - linux + - self-hosted + steps: + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push Image + uses: docker/build-push-action@v2 + with: + file: ${{ matrix.version }}/Dockerfile + push: true + tags: ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }}-${{ matrix.arch }} + strategy: + matrix: + arch: + - arm64 + - x64 + version: + - 7 + + manifest: + needs: image-multiarch + runs-on: + - linux + - self-hosted + steps: + # Transform ${{ git.ref }} from `refs/heads/` to `${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:`. + - name: Docker Meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }} + tag-latest: false + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Create and Push Manifest List (Branch) + run: | + docker manifest create ${{ steps.docker_meta.outputs.tags }}-${{ matrix.version }} \ + --amend ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }}-arm64 \ + --amend ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }}-x64 + docker manifest push ${{ steps.docker_meta.outputs.tags }}-${{ matrix.version }} + - name: Create and Push Manifest List (SHA) + run: | + docker manifest create ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }} \ + --amend ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }}-arm64 \ + --amend ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }}-x64 + docker manifest push ${{ secrets.DOCKER_ORG }}/${{ secrets.DOCKER_REPO }}:sha-${{ github.sha }}-${{ matrix.version }} + strategy: + matrix: + version: + - 7 diff --git a/7/Dockerfile b/7/Dockerfile index a5ace36..57fc0bd 100644 --- a/7/Dockerfile +++ b/7/Dockerfile @@ -1,3 +1,3 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.7.1 +FROM docker.elastic.co/elasticsearch/elasticsearch:7.8.1 RUN elasticsearch-plugin install analysis-icu diff --git a/codefresh.yml b/codefresh.yml deleted file mode 100644 index edbf67c..0000000 --- a/codefresh.yml +++ /dev/null @@ -1,97 +0,0 @@ -version: '1.0' -steps: - build_image_7: - type: build - title: Building Docker Image (7) - dockerfile: 7/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '7' - push_image_7: - type: push - title: Pushing Docker Image to Registry (7) - candidate: '${{build_image_7}}' - tag: '7' - - build_image_6: - type: build - title: Building Docker Image (6) - dockerfile: 6/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '6' - push_image_6: - type: push - title: Pushing Docker Image to Registry (6) - candidate: '${{build_image_6}}' - tag: '6' - - build_image_5: - type: build - title: Building Docker Image (5) - dockerfile: 5/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '5' - push_image_5: - type: push - title: Pushing Docker Image to Registry (5) - candidate: '${{build_image_5}}' - tag: '5' - - build_image_5_alpine: - type: build - title: Building Docker Image (5-alpine) - dockerfile: 5-alpine/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '5-alpine' - push_image_5_alpine: - type: push - title: Pushing Docker Image to Registry (5-alpine) - candidate: '${{build_image_5_alpine}}' - tag: '5-alpine' - - build_image_24: - type: build - title: Building Docker Image (2.4) - dockerfile: 2.4/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '2.4' - push_image_24: - type: push - title: Pushing Docker Image to Registry (2.4) - candidate: '${{build_image_24}}' - tag: '2.4' - - build_image_24_alpine: - type: build - title: Building Docker Image (2.4-alpine) - dockerfile: 2.4-alpine/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '2.4-alpine' - push_image_24_alpine: - type: push - title: Pushing Docker Image to Registry (2.4-alpine) - candidate: '${{build_image_24_alpine}}' - tag: '2.4-alpine' - - build_image_1: - type: build - title: Building Docker Image (1) - dockerfile: 1/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '1' - push_image_1: - type: push - title: Pushing Docker Image to Registry (1) - candidate: '${{build_image_1}}' - tag: '1' - - build_image_1_alpine: - type: build - title: Building Docker Image (1-alpine) - dockerfile: 1-alpine/Dockerfile - image_name: interaction/elasticsearch-icu - tag: '1-alpine' - push_image_1_alpine: - type: push - title: Pushing Docker Image to Registry (1-alpine) - candidate: '${{build_image_1_alpine}}' - tag: '1-alpine'