diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 9749057..d457b65 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -4,19 +4,22 @@ on: push: branches: - master + - release # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. pull_request: branches: - master - jobs: - build-v1-21-0-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-22-0-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.21.0-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-alpine-3.8 + VARIANT_TAG: v1.22.0-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.22.0-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.22.0-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -29,96 +32,125 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + - name: Login to docker registry run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + ${{ github.repository }}:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - name: Clean-up run: docker logout if: always() - build-v1-21-0-git-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-22-0-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.21.0-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-git-alpine-3.8 + VARIANT_TAG: v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -131,45 +163,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-21-0-jq-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-21-0-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.21.0-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-jq-alpine-3.8 + VARIANT_TAG: v1.21.0-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.21.0-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.21.0-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -182,45 +293,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-21-0-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.21.0-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-kustomize-alpine-3.8 + VARIANT_TAG: v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -233,45 +423,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-21-0-ssh-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-20-4-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.21.0-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-ssh-alpine-3.8 + VARIANT_TAG: v1.20.4-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.20.4-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.20.4-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -284,45 +553,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 + VARIANT_TAG: v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -335,45 +683,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-20-4-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-19-7-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.20.4-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-alpine-3.8 + VARIANT_TAG: v1.19.7-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.19.7-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.19.7-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -386,45 +813,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-20-4-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.20.4-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-envsubst-alpine-3.8 + VARIANT_TAG: v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -437,45 +943,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-20-4-git-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-18-15-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.20.4-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-git-alpine-3.8 + VARIANT_TAG: v1.18.15-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.18.15-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.18.15-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -488,1932 +1073,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - name: Clean-up run: docker logout if: always() - build-v1-15-12-ssh-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.15.12-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-ssh-alpine-3.8 + VARIANT_TAG: v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2426,45 +1203,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-17-17-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 + VARIANT_TAG: v1.17.17-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.17.17-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.17.17-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2477,45 +1333,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-14-10-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.14.10-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-alpine-3.8 + VARIANT_TAG: v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2528,45 +1463,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-14-10-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-16-15-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.14.10-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-envsubst-alpine-3.8 + VARIANT_TAG: v1.16.15-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.16.15-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.16.15-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2579,45 +1593,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-14-10-git-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.14.10-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-git-alpine-3.8 + VARIANT_TAG: v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2630,45 +1723,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-14-10-jq-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-15-12-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.14.10-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-jq-alpine-3.8 + VARIANT_TAG: v1.15.12-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.15.12-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.15.12-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2681,45 +1853,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-14-10-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.14.10-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-kustomize-alpine-3.8 + VARIANT_TAG: v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2732,45 +1983,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() - build-v1-14-10-ssh-alpine-3-8: - runs-on: ubuntu-18.04 + + build-v1-14-10-alpine-3-8: + runs-on: ubuntu-latest env: - VARIANT_TAG: v1.14.10-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-ssh-alpine-3.8 + VARIANT_TAG: v1.14.10-alpine-3.8 + # VARIANT_TAG_WITH_REF: v1.14.10-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v1.14.10-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2783,45 +2113,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8 # VARIANT_TAG_WITH_REF: v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} VARIANT_BUILD_DIR: variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8 steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2834,37 +2243,130 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + converge-master-and-release-branches: + needs: [build-v1-22-0-alpine-3-8, build-v1-22-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-21-0-alpine-3-8, build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-20-4-alpine-3-8, build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-19-7-alpine-3-8, build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-18-15-alpine-3-8, build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-17-17-alpine-3-8, build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-16-15-alpine-3-8, build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-15-12-alpine-3-8, build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-14-10-alpine-3-8, build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8] + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Merge release into master (fast-forward) + run: | + git checkout master + git merge release + git push origin master + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. resolve-release-tag: runs-on: ubuntu-latest outputs: @@ -2899,8 +2401,9 @@ jobs: echo "::set-output name=TAG::$TAG" - name: Print outputs run: echo ${{ steps.resolve-release-tag.outputs.TAG }} + update-draft-release: - needs: [build-v1-21-0-alpine-3-8, build-v1-21-0-envsubst-alpine-3-8, build-v1-21-0-git-alpine-3-8, build-v1-21-0-jq-alpine-3-8, build-v1-21-0-kustomize-alpine-3-8, build-v1-21-0-ssh-alpine-3-8, build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-20-4-alpine-3-8, build-v1-20-4-envsubst-alpine-3-8, build-v1-20-4-git-alpine-3-8, build-v1-20-4-jq-alpine-3-8, build-v1-20-4-kustomize-alpine-3-8, build-v1-20-4-ssh-alpine-3-8, build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-19-7-alpine-3-8, build-v1-19-7-envsubst-alpine-3-8, build-v1-19-7-git-alpine-3-8, build-v1-19-7-jq-alpine-3-8, build-v1-19-7-kustomize-alpine-3-8, build-v1-19-7-ssh-alpine-3-8, build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-18-15-alpine-3-8, build-v1-18-15-envsubst-alpine-3-8, build-v1-18-15-git-alpine-3-8, build-v1-18-15-jq-alpine-3-8, build-v1-18-15-kustomize-alpine-3-8, build-v1-18-15-ssh-alpine-3-8, build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-17-17-alpine-3-8, build-v1-17-17-envsubst-alpine-3-8, build-v1-17-17-git-alpine-3-8, build-v1-17-17-jq-alpine-3-8, build-v1-17-17-kustomize-alpine-3-8, build-v1-17-17-ssh-alpine-3-8, build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-16-15-alpine-3-8, build-v1-16-15-envsubst-alpine-3-8, build-v1-16-15-git-alpine-3-8, build-v1-16-15-jq-alpine-3-8, build-v1-16-15-kustomize-alpine-3-8, build-v1-16-15-ssh-alpine-3-8, build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-15-12-alpine-3-8, build-v1-15-12-envsubst-alpine-3-8, build-v1-15-12-git-alpine-3-8, build-v1-15-12-jq-alpine-3-8, build-v1-15-12-kustomize-alpine-3-8, build-v1-15-12-ssh-alpine-3-8, build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-14-10-alpine-3-8, build-v1-14-10-envsubst-alpine-3-8, build-v1-14-10-git-alpine-3-8, build-v1-14-10-jq-alpine-3-8, build-v1-14-10-kustomize-alpine-3-8, build-v1-14-10-ssh-alpine-3-8, build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8, resolve-release-tag] + needs: [build-v1-22-0-alpine-3-8, build-v1-22-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-21-0-alpine-3-8, build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-20-4-alpine-3-8, build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-19-7-alpine-3-8, build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-18-15-alpine-3-8, build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-17-17-alpine-3-8, build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-16-15-alpine-3-8, build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-15-12-alpine-3-8, build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-14-10-alpine-3-8, build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8, resolve-release-tag] if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: @@ -2918,3 +2421,21 @@ jobs: tag: ${{ needs.resolve-release-tag.outputs.TAG }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-draft-release: + needs: [build-v1-22-0-alpine-3-8, build-v1-22-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-21-0-alpine-3-8, build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-20-4-alpine-3-8, build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-19-7-alpine-3-8, build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-18-15-alpine-3-8, build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-17-17-alpine-3-8, build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-16-15-alpine-3-8, build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-15-12-alpine-3-8, build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-14-10-alpine-3-8, build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8, converge-master-and-release-branches] + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: true + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml deleted file mode 100644 index 5c0a94e..0000000 --- a/.github/workflows/ci-release.yml +++ /dev/null @@ -1,3040 +0,0 @@ -name: ci-release - -on: - push: - branches: - - release - -jobs: - build-v1-21-0-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-envsubst-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-envsubst-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-envsubst-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-envsubst-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-git-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-git-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-git-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-git-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-jq-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-jq-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-jq-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-jq-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-kustomize-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-kustomize-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-kustomize-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-kustomize-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8 - # VARIANT_TAG_WITH_REF: v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8 - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - converge-master-and-release-branches: - needs: [build-v1-21-0-alpine-3-8, build-v1-21-0-envsubst-alpine-3-8, build-v1-21-0-git-alpine-3-8, build-v1-21-0-jq-alpine-3-8, build-v1-21-0-kustomize-alpine-3-8, build-v1-21-0-ssh-alpine-3-8, build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-20-4-alpine-3-8, build-v1-20-4-envsubst-alpine-3-8, build-v1-20-4-git-alpine-3-8, build-v1-20-4-jq-alpine-3-8, build-v1-20-4-kustomize-alpine-3-8, build-v1-20-4-ssh-alpine-3-8, build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-19-7-alpine-3-8, build-v1-19-7-envsubst-alpine-3-8, build-v1-19-7-git-alpine-3-8, build-v1-19-7-jq-alpine-3-8, build-v1-19-7-kustomize-alpine-3-8, build-v1-19-7-ssh-alpine-3-8, build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-18-15-alpine-3-8, build-v1-18-15-envsubst-alpine-3-8, build-v1-18-15-git-alpine-3-8, build-v1-18-15-jq-alpine-3-8, build-v1-18-15-kustomize-alpine-3-8, build-v1-18-15-ssh-alpine-3-8, build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-17-17-alpine-3-8, build-v1-17-17-envsubst-alpine-3-8, build-v1-17-17-git-alpine-3-8, build-v1-17-17-jq-alpine-3-8, build-v1-17-17-kustomize-alpine-3-8, build-v1-17-17-ssh-alpine-3-8, build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-16-15-alpine-3-8, build-v1-16-15-envsubst-alpine-3-8, build-v1-16-15-git-alpine-3-8, build-v1-16-15-jq-alpine-3-8, build-v1-16-15-kustomize-alpine-3-8, build-v1-16-15-ssh-alpine-3-8, build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-15-12-alpine-3-8, build-v1-15-12-envsubst-alpine-3-8, build-v1-15-12-git-alpine-3-8, build-v1-15-12-jq-alpine-3-8, build-v1-15-12-kustomize-alpine-3-8, build-v1-15-12-ssh-alpine-3-8, build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-14-10-alpine-3-8, build-v1-14-10-envsubst-alpine-3-8, build-v1-14-10-git-alpine-3-8, build-v1-14-10-jq-alpine-3-8, build-v1-14-10-kustomize-alpine-3-8, build-v1-14-10-ssh-alpine-3-8, build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8] - if: github.ref == 'refs/heads/release' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Merge release into master (fast-forward) - run: | - git checkout master - git merge release - git push origin master - resolve-release-tag: - runs-on: ubuntu-latest - outputs: - TAG: ${{ steps.resolve-release-tag.outputs.TAG }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Resolve release tag - id: resolve-release-tag - run: | - set +e - # E.g. 20210402 - TODAYS_DATE=$( date -u '+%Y%m%d' ) - # Is this the first tag for this date? - TODAYS_DATE_TAGS=$( git tag --list | grep "^$TODAYS_DATE" ) - TAG= - if [ -z "$TODAYS_DATE_TAGS" ]; then - # E.g. 20210402.0.0 - TAG="$TODAYS_DATE.0.0" # Send this to stdout - else - # E.g. if there are 20210402.0.0, 20210402.0.1, 20210402.0.2, this returns 2 - VERSION_MINOR_LATEST=$( echo "$TODAYS_DATE_TAGS" | cut -d '.' -f 3 | sort -nr | head -n1 ) - # Minor version - VERSION_MINOR=$( expr "$VERSION_MINOR_LATEST" + 1 ) - # E.g. 20210402.0.3 - TAG="$TODAYS_DATE.0.$VERSION_MINOR" # Send this to stdout - fi - echo "TODAYS_DATE: $TODAYS_DATE" - echo "TODAYS_DATE_TAGS: $TODAYS_DATE_TAGS" - echo "TAG: $TAG" - echo "::set-output name=TAG::$TAG" - - name: Print outputs - run: echo ${{ steps.resolve-release-tag.outputs.TAG }} - publish-draft-release: - needs: [build-v1-21-0-alpine-3-8, build-v1-21-0-envsubst-alpine-3-8, build-v1-21-0-git-alpine-3-8, build-v1-21-0-jq-alpine-3-8, build-v1-21-0-kustomize-alpine-3-8, build-v1-21-0-ssh-alpine-3-8, build-v1-21-0-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-20-4-alpine-3-8, build-v1-20-4-envsubst-alpine-3-8, build-v1-20-4-git-alpine-3-8, build-v1-20-4-jq-alpine-3-8, build-v1-20-4-kustomize-alpine-3-8, build-v1-20-4-ssh-alpine-3-8, build-v1-20-4-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-19-7-alpine-3-8, build-v1-19-7-envsubst-alpine-3-8, build-v1-19-7-git-alpine-3-8, build-v1-19-7-jq-alpine-3-8, build-v1-19-7-kustomize-alpine-3-8, build-v1-19-7-ssh-alpine-3-8, build-v1-19-7-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-18-15-alpine-3-8, build-v1-18-15-envsubst-alpine-3-8, build-v1-18-15-git-alpine-3-8, build-v1-18-15-jq-alpine-3-8, build-v1-18-15-kustomize-alpine-3-8, build-v1-18-15-ssh-alpine-3-8, build-v1-18-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-17-17-alpine-3-8, build-v1-17-17-envsubst-alpine-3-8, build-v1-17-17-git-alpine-3-8, build-v1-17-17-jq-alpine-3-8, build-v1-17-17-kustomize-alpine-3-8, build-v1-17-17-ssh-alpine-3-8, build-v1-17-17-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-16-15-alpine-3-8, build-v1-16-15-envsubst-alpine-3-8, build-v1-16-15-git-alpine-3-8, build-v1-16-15-jq-alpine-3-8, build-v1-16-15-kustomize-alpine-3-8, build-v1-16-15-ssh-alpine-3-8, build-v1-16-15-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-15-12-alpine-3-8, build-v1-15-12-envsubst-alpine-3-8, build-v1-15-12-git-alpine-3-8, build-v1-15-12-jq-alpine-3-8, build-v1-15-12-kustomize-alpine-3-8, build-v1-15-12-ssh-alpine-3-8, build-v1-15-12-envsubst-git-jq-kustomize-ssh-alpine-3-8, build-v1-14-10-alpine-3-8, build-v1-14-10-envsubst-alpine-3-8, build-v1-14-10-git-alpine-3-8, build-v1-14-10-jq-alpine-3-8, build-v1-14-10-kustomize-alpine-3-8, build-v1-14-10-ssh-alpine-3-8, build-v1-14-10-envsubst-git-jq-kustomize-ssh-alpine-3-8, converge-master-and-release-branches] - if: github.ref == 'refs/heads/release' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - with: - config-name: release-drafter.yml - publish: true - name: ${{ needs.resolve-release-tag.outputs.TAG }} - tag: ${{ needs.resolve-release-tag.outputs.TAG }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index fdc96db..3173000 100644 --- a/README.md +++ b/README.md @@ -10,60 +10,22 @@ Dockerized `kubectl` with useful tools. | Tag | Dockerfile Build Context | |:-------:|:---------:| -| `:v1.21.0-alpine-3.8`, `:latest` | [View](variants/v1.21.0-alpine-3.8 ) | -| `:v1.21.0-envsubst-alpine-3.8` | [View](variants/v1.21.0-envsubst-alpine-3.8 ) | -| `:v1.21.0-git-alpine-3.8` | [View](variants/v1.21.0-git-alpine-3.8 ) | -| `:v1.21.0-jq-alpine-3.8` | [View](variants/v1.21.0-jq-alpine-3.8 ) | -| `:v1.21.0-kustomize-alpine-3.8` | [View](variants/v1.21.0-kustomize-alpine-3.8 ) | -| `:v1.21.0-ssh-alpine-3.8` | [View](variants/v1.21.0-ssh-alpine-3.8 ) | +| `:v1.22.0-alpine-3.8`, `:latest` | [View](variants/v1.22.0-alpine-3.8 ) | +| `:v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | +| `:v1.21.0-alpine-3.8` | [View](variants/v1.21.0-alpine-3.8 ) | | `:v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.20.4-alpine-3.8` | [View](variants/v1.20.4-alpine-3.8 ) | -| `:v1.20.4-envsubst-alpine-3.8` | [View](variants/v1.20.4-envsubst-alpine-3.8 ) | -| `:v1.20.4-git-alpine-3.8` | [View](variants/v1.20.4-git-alpine-3.8 ) | -| `:v1.20.4-jq-alpine-3.8` | [View](variants/v1.20.4-jq-alpine-3.8 ) | -| `:v1.20.4-kustomize-alpine-3.8` | [View](variants/v1.20.4-kustomize-alpine-3.8 ) | -| `:v1.20.4-ssh-alpine-3.8` | [View](variants/v1.20.4-ssh-alpine-3.8 ) | | `:v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.19.7-alpine-3.8` | [View](variants/v1.19.7-alpine-3.8 ) | -| `:v1.19.7-envsubst-alpine-3.8` | [View](variants/v1.19.7-envsubst-alpine-3.8 ) | -| `:v1.19.7-git-alpine-3.8` | [View](variants/v1.19.7-git-alpine-3.8 ) | -| `:v1.19.7-jq-alpine-3.8` | [View](variants/v1.19.7-jq-alpine-3.8 ) | -| `:v1.19.7-kustomize-alpine-3.8` | [View](variants/v1.19.7-kustomize-alpine-3.8 ) | -| `:v1.19.7-ssh-alpine-3.8` | [View](variants/v1.19.7-ssh-alpine-3.8 ) | | `:v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.18.15-alpine-3.8` | [View](variants/v1.18.15-alpine-3.8 ) | -| `:v1.18.15-envsubst-alpine-3.8` | [View](variants/v1.18.15-envsubst-alpine-3.8 ) | -| `:v1.18.15-git-alpine-3.8` | [View](variants/v1.18.15-git-alpine-3.8 ) | -| `:v1.18.15-jq-alpine-3.8` | [View](variants/v1.18.15-jq-alpine-3.8 ) | -| `:v1.18.15-kustomize-alpine-3.8` | [View](variants/v1.18.15-kustomize-alpine-3.8 ) | -| `:v1.18.15-ssh-alpine-3.8` | [View](variants/v1.18.15-ssh-alpine-3.8 ) | | `:v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.17.17-alpine-3.8` | [View](variants/v1.17.17-alpine-3.8 ) | -| `:v1.17.17-envsubst-alpine-3.8` | [View](variants/v1.17.17-envsubst-alpine-3.8 ) | -| `:v1.17.17-git-alpine-3.8` | [View](variants/v1.17.17-git-alpine-3.8 ) | -| `:v1.17.17-jq-alpine-3.8` | [View](variants/v1.17.17-jq-alpine-3.8 ) | -| `:v1.17.17-kustomize-alpine-3.8` | [View](variants/v1.17.17-kustomize-alpine-3.8 ) | -| `:v1.17.17-ssh-alpine-3.8` | [View](variants/v1.17.17-ssh-alpine-3.8 ) | | `:v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.16.15-alpine-3.8` | [View](variants/v1.16.15-alpine-3.8 ) | -| `:v1.16.15-envsubst-alpine-3.8` | [View](variants/v1.16.15-envsubst-alpine-3.8 ) | -| `:v1.16.15-git-alpine-3.8` | [View](variants/v1.16.15-git-alpine-3.8 ) | -| `:v1.16.15-jq-alpine-3.8` | [View](variants/v1.16.15-jq-alpine-3.8 ) | -| `:v1.16.15-kustomize-alpine-3.8` | [View](variants/v1.16.15-kustomize-alpine-3.8 ) | -| `:v1.16.15-ssh-alpine-3.8` | [View](variants/v1.16.15-ssh-alpine-3.8 ) | | `:v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.15.12-alpine-3.8` | [View](variants/v1.15.12-alpine-3.8 ) | -| `:v1.15.12-envsubst-alpine-3.8` | [View](variants/v1.15.12-envsubst-alpine-3.8 ) | -| `:v1.15.12-git-alpine-3.8` | [View](variants/v1.15.12-git-alpine-3.8 ) | -| `:v1.15.12-jq-alpine-3.8` | [View](variants/v1.15.12-jq-alpine-3.8 ) | -| `:v1.15.12-kustomize-alpine-3.8` | [View](variants/v1.15.12-kustomize-alpine-3.8 ) | -| `:v1.15.12-ssh-alpine-3.8` | [View](variants/v1.15.12-ssh-alpine-3.8 ) | | `:v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | | `:v1.14.10-alpine-3.8` | [View](variants/v1.14.10-alpine-3.8 ) | -| `:v1.14.10-envsubst-alpine-3.8` | [View](variants/v1.14.10-envsubst-alpine-3.8 ) | -| `:v1.14.10-git-alpine-3.8` | [View](variants/v1.14.10-git-alpine-3.8 ) | -| `:v1.14.10-jq-alpine-3.8` | [View](variants/v1.14.10-jq-alpine-3.8 ) | -| `:v1.14.10-kustomize-alpine-3.8` | [View](variants/v1.14.10-kustomize-alpine-3.8 ) | -| `:v1.14.10-ssh-alpine-3.8` | [View](variants/v1.14.10-ssh-alpine-3.8 ) | | `:v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8` | [View](variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8 ) | diff --git a/generate/definitions/FILES.ps1 b/generate/definitions/FILES.ps1 index cd946c2..fc70558 100755 --- a/generate/definitions/FILES.ps1 +++ b/generate/definitions/FILES.ps1 @@ -1,7 +1,7 @@ # Files' definition $FILES = @( '.github/workflows/ci-master-pr.yml' - '.github/workflows/ci-release.yml' + # '.github/workflows/ci-release.yml' '.github/release-drafter.yml' # '.gitlab-ci.yml' 'README.md' diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index 5981e7a..68d007c 100755 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -1,4 +1,5 @@ $local:VARIANTS_PACKAGE_VERSIONS = @( + 'v1.22.0' 'v1.21.0' 'v1.20.4' 'v1.19.7' @@ -17,11 +18,6 @@ $local:VARIANTS_MATRIX = @( distro_version = '3.8' subvariants = @( @{ components = @(); tag_as_latest = if ($v -eq ($local:VARIANTS_PACKAGE_VERSIONS | ? { $_ -match '^v\d+\.\d+\.\d+$' } | Select-Object -First 1 )) { $true } else { $false } } - @{ components = @( 'envsubst' ) } - @{ components = @( 'git' ) } - @{ components = @( 'jq' ) } - @{ components = @( 'kustomize' ) } - @{ components = @( 'ssh' ) } @{ components = @( 'envsubst', 'git', 'jq', 'kustomize', 'ssh' ) } ) } diff --git a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 index 36c9c60..d9e365d 100644 --- a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 +++ b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 @@ -5,10 +5,10 @@ on: push: branches: - master + - release # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. pull_request: branches: - master - jobs: '@ @@ -16,8 +16,9 @@ $local:WORKFLOW_JOB_NAMES = $VARIANTS | % { "build-$( $_['tag'].Replace('.', '-' $( $VARIANTS | % { @" + build-$( $_['tag'].Replace('.', '-') ): - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: $( $_['tag'] ) # VARIANT_TAG_WITH_REF: $( $_['tag'] )-`${GITHUB_REF} @@ -26,7 +27,9 @@ $( $VARIANTS | % { @' steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -39,42 +42,149 @@ $( $VARIANTS | % { pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + +'@ + +if ( $_['tag_as_latest'] ) { +@' + ${{ github.repository }}:latest + +'@ +} +@' + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() '@ }) +@" + + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + converge-master-and-release-branches: + needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' )] + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Merge release into master (fast-forward) + run: | + git checkout master + git merge release + git push origin master +"@ + @' + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. resolve-release-tag: runs-on: ubuntu-latest outputs: @@ -113,6 +223,7 @@ $( $VARIANTS | % { @" + update-draft-release: needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' ), resolve-release-tag] "@ @@ -135,5 +246,30 @@ $( $VARIANTS | % { tag: ${{ needs.resolve-release-tag.outputs.TAG }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +'@ + +@" + + + publish-draft-release: + needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' ), converge-master-and-release-branches] +"@ +@' + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: true + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} '@ diff --git a/generate/templates/.github/workflows/ci-release.yml.ps1 b/generate/templates/.github/workflows/ci-release.yml.ps1 deleted file mode 100644 index f3e9881..0000000 --- a/generate/templates/.github/workflows/ci-release.yml.ps1 +++ /dev/null @@ -1,168 +0,0 @@ -@' -name: ci-release - -on: - push: - branches: - - release - -jobs: -'@ - -$local:WORKFLOW_JOB_NAMES = $VARIANTS | % { "build-$( $_['tag'].Replace('.', '-') )" } -$( $VARIANTS | % { -@" - - build-$( $_['tag'].Replace('.', '-') ): - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: $( $_['tag'] ) - # VARIANT_TAG_WITH_REF: $( $_['tag'] )-`${GITHUB_REF} - VARIANT_BUILD_DIR: $( $_['build_dir_rel'] ) -"@ -@' - - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - -'@ -if ( $_['tag_as_latest'] ) { -@' - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" \ - -'@ -} -@' - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - -'@ -if ( $_['tag_as_latest'] ) { -@' - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" - -'@ -} -@' - - name: Clean-up - run: docker logout - if: always() -'@ -}) - -@" - - converge-master-and-release-branches: - needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' )] - if: github.ref == 'refs/heads/release' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Merge release into master (fast-forward) - run: | - git checkout master - git merge release - git push origin master -"@ - -@' - - resolve-release-tag: - runs-on: ubuntu-latest - outputs: - TAG: ${{ steps.resolve-release-tag.outputs.TAG }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Resolve release tag - id: resolve-release-tag - run: | - set +e - # E.g. 20210402 - TODAYS_DATE=$( date -u '+%Y%m%d' ) - # Is this the first tag for this date? - TODAYS_DATE_TAGS=$( git tag --list | grep "^$TODAYS_DATE" ) - TAG= - if [ -z "$TODAYS_DATE_TAGS" ]; then - # E.g. 20210402.0.0 - TAG="$TODAYS_DATE.0.0" # Send this to stdout - else - # E.g. if there are 20210402.0.0, 20210402.0.1, 20210402.0.2, this returns 2 - VERSION_MINOR_LATEST=$( echo "$TODAYS_DATE_TAGS" | cut -d '.' -f 3 | sort -nr | head -n1 ) - # Minor version - VERSION_MINOR=$( expr "$VERSION_MINOR_LATEST" + 1 ) - # E.g. 20210402.0.3 - TAG="$TODAYS_DATE.0.$VERSION_MINOR" # Send this to stdout - fi - echo "TODAYS_DATE: $TODAYS_DATE" - echo "TODAYS_DATE_TAGS: $TODAYS_DATE_TAGS" - echo "TAG: $TAG" - echo "::set-output name=TAG::$TAG" - - name: Print outputs - run: echo ${{ steps.resolve-release-tag.outputs.TAG }} -'@ - -@" - - publish-draft-release: - needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' ), converge-master-and-release-branches] -"@ -@' - - if: github.ref == 'refs/heads/release' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - with: - config-name: release-drafter.yml - publish: true - name: ${{ needs.resolve-release-tag.outputs.TAG }} - tag: ${{ needs.resolve-release-tag.outputs.TAG }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -'@ diff --git a/generate/templates/Dockerfile.header.ps1 b/generate/templates/Dockerfile.header.ps1 index 41fd8c6..e2fcb59 100755 --- a/generate/templates/Dockerfile.header.ps1 +++ b/generate/templates/Dockerfile.header.ps1 @@ -1,8 +1,12 @@ @" FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] ) +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on `$BUILDPLATFORM, building for `$TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/$( $VARIANT['_metadata']['package_version'] )/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/$( $VARIANT['_metadata']['package_version'] )/bin/`$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl "@ diff --git a/variants/v1.14.10-alpine-3.8/Dockerfile b/variants/v1.14.10-alpine-3.8/Dockerfile index dd927bc..79337c7 100644 --- a/variants/v1.14.10-alpine-3.8/Dockerfile +++ b/variants/v1.14.10-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index 9249b7b..50ac95a 100644 --- a/variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.14.10-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.15.12-alpine-3.8/Dockerfile b/variants/v1.15.12-alpine-3.8/Dockerfile index 9e78092..bb79825 100644 --- a/variants/v1.15.12-alpine-3.8/Dockerfile +++ b/variants/v1.15.12-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index a5fbcf9..9085de1 100644 --- a/variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.15.12-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.16.15-alpine-3.8/Dockerfile b/variants/v1.16.15-alpine-3.8/Dockerfile index d1c2ab9..45b10c3 100644 --- a/variants/v1.16.15-alpine-3.8/Dockerfile +++ b/variants/v1.16.15-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index 3ddd847..6389684 100644 --- a/variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.16.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.17.17-alpine-3.8/Dockerfile b/variants/v1.17.17-alpine-3.8/Dockerfile index fae5137..313aaec 100644 --- a/variants/v1.17.17-alpine-3.8/Dockerfile +++ b/variants/v1.17.17-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index 0498e8d..a0a3d05 100644 --- a/variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.17.17-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.18.15-alpine-3.8/Dockerfile b/variants/v1.18.15-alpine-3.8/Dockerfile index 600d80c..f68ed7f 100644 --- a/variants/v1.18.15-alpine-3.8/Dockerfile +++ b/variants/v1.18.15-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index 7196a54..b104be1 100644 --- a/variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.18.15-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.19.7-alpine-3.8/Dockerfile b/variants/v1.19.7-alpine-3.8/Dockerfile index 28c9435..e0a085e 100644 --- a/variants/v1.19.7-alpine-3.8/Dockerfile +++ b/variants/v1.19.7-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index 08f686d..2cceee7 100644 --- a/variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.19.7-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.20.4-alpine-3.8/Dockerfile b/variants/v1.20.4-alpine-3.8/Dockerfile index f1a3cc9..e976cc5 100644 --- a/variants/v1.20.4-alpine-3.8/Dockerfile +++ b/variants/v1.20.4-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index a8d6a4c..bb8a8d2 100644 --- a/variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.20.4-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.21.0-alpine-3.8/Dockerfile b/variants/v1.21.0-alpine-3.8/Dockerfile index c519e4d..e4eb1ab 100644 --- a/variants/v1.21.0-alpine-3.8/Dockerfile +++ b/variants/v1.21.0-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile index 116f54d..69cb33b 100644 --- a/variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile +++ b/variants/v1.21.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -1,7 +1,11 @@ FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" +# kubectl RUN apk add --no-cache curl \ - && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ && chmod +x /usr/local/bin/kubectl \ && apk del curl diff --git a/variants/v1.22.0-alpine-3.8/Dockerfile b/variants/v1.22.0-alpine-3.8/Dockerfile new file mode 100644 index 0000000..bae1510 --- /dev/null +++ b/variants/v1.22.0-alpine-3.8/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +# kubectl +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file diff --git a/variants/v1.22.0-envsubst-alpine-3.8/Dockerfile b/variants/v1.22.0-envsubst-alpine-3.8/Dockerfile new file mode 100644 index 0000000..5c21024 --- /dev/null +++ b/variants/v1.22.0-envsubst-alpine-3.8/Dockerfile @@ -0,0 +1,29 @@ +FROM alpine:3.8 + +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + +# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile +# Bring in gettext so we can get `envsubst`, then throw +# the rest away. To do this, we need to install `gettext` +# then move `envsubst` out of the way so `gettext` can +# be deleted completely, then move `envsubst` back. +RUN apk add --no-cache --virtual .gettext gettext \ + && mv /usr/bin/envsubst /tmp/ \ + \ + && runDeps="$( \ + scanelf --needed --nobanner /tmp/envsubst \ + | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ + | sort -u \ + | xargs -r apk info --installed \ + | sort -u \ + )" \ + && apk add --no-cache $runDeps \ + && apk del .gettext \ + && mv /tmp/envsubst /usr/local/bin/ + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file diff --git a/variants/v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile b/variants/v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile new file mode 100644 index 0000000..214ab14 --- /dev/null +++ b/variants/v1.22.0-envsubst-git-jq-kustomize-ssh-alpine-3.8/Dockerfile @@ -0,0 +1,44 @@ +FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +# kubectl +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/$TARGETPLATFORM/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + +# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile +# Bring in gettext so we can get `envsubst`, then throw +# the rest away. To do this, we need to install `gettext` +# then move `envsubst` out of the way so `gettext` can +# be deleted completely, then move `envsubst` back. +RUN apk add --no-cache --virtual .gettext gettext \ + && mv /usr/bin/envsubst /tmp/ \ + \ + && runDeps="$( \ + scanelf --needed --nobanner /tmp/envsubst \ + | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ + | sort -u \ + | xargs -r apk info --installed \ + | sort -u \ + )" \ + && apk add --no-cache $runDeps \ + && apk del .gettext \ + && mv /tmp/envsubst /usr/local/bin/ + +RUN apk add --no-cache git + +RUN apk add --no-cache jq + +RUN apk add --no-cache curl \ + && curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/v2.0.3/kustomize_2.0.3_linux_amd64 -o /usr/local/bin/kustomize \ + && chmod +x /usr/local/bin/kustomize \ + && apk del curl + +RUN apk add --no-cache openssh-client + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file diff --git a/variants/v1.22.0-git-alpine-3.8/Dockerfile b/variants/v1.22.0-git-alpine-3.8/Dockerfile new file mode 100644 index 0000000..7010671 --- /dev/null +++ b/variants/v1.22.0-git-alpine-3.8/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:3.8 + +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + +RUN apk add --no-cache git + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file diff --git a/variants/v1.22.0-jq-alpine-3.8/Dockerfile b/variants/v1.22.0-jq-alpine-3.8/Dockerfile new file mode 100644 index 0000000..8ec5f9f --- /dev/null +++ b/variants/v1.22.0-jq-alpine-3.8/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:3.8 + +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + +RUN apk add --no-cache jq + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file diff --git a/variants/v1.22.0-kustomize-alpine-3.8/Dockerfile b/variants/v1.22.0-kustomize-alpine-3.8/Dockerfile new file mode 100644 index 0000000..37b66e9 --- /dev/null +++ b/variants/v1.22.0-kustomize-alpine-3.8/Dockerfile @@ -0,0 +1,15 @@ +FROM alpine:3.8 + +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + +RUN apk add --no-cache curl \ + && curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/v2.0.3/kustomize_2.0.3_linux_amd64 -o /usr/local/bin/kustomize \ + && chmod +x /usr/local/bin/kustomize \ + && apk del curl + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file diff --git a/variants/v1.22.0-ssh-alpine-3.8/Dockerfile b/variants/v1.22.0-ssh-alpine-3.8/Dockerfile new file mode 100644 index 0000000..bd86ab5 --- /dev/null +++ b/variants/v1.22.0-ssh-alpine-3.8/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:3.8 + +RUN apk add --no-cache curl \ + && curl -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + && apk del curl + +RUN apk add --no-cache openssh-client + + + +ENTRYPOINT [ "/usr/local/bin/kubectl" ] \ No newline at end of file