diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 61f1f27..a9f5854 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -964,6 +964,192 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache + build-2-10-7: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # 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@v2 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-2.10.7-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx-2.10.7- + ${{ runner.os }}-buildx- + + - name: Login to Docker Hub registry + # Run on master and tags + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + # This step generates the docker tags + - name: Prepare + id: prep-v2-10-7-alpine-3-13 + run: | + set -e + + # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + + # Get short commit hash E.g. 'abc0123' + SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # Generate docker image tags + # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' + # E.g. 'master-' and 'master-abc0123-' + VARIANT="v2.10.7-alpine-3.13" + REF_VARIANT="${REF}-${VARIANT}" + REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" + + # Pass variables to next step + echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT + echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT + echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT + echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT + + - name: v2.10.7-alpine-3.13 - Build (PRs) + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v3 + with: + context: variants/v2.10.7-alpine-3.13 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: v2.10.7-alpine-3.13 - Build and push (master) + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v3 + with: + context: variants/v2.10.7-alpine-3.13 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: v2.10.7-alpine-3.13 - Build and push (release) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v3 + with: + context: variants/v2.10.7-alpine-3.13 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # This step generates the docker tags + - name: Prepare + id: prep-v2-10-7-sops-ssh-alpine-3-13 + run: | + set -e + + # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + + # Get short commit hash E.g. 'abc0123' + SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # Generate docker image tags + # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' + # E.g. 'master-' and 'master-abc0123-' + VARIANT="v2.10.7-sops-ssh-alpine-3.13" + REF_VARIANT="${REF}-${VARIANT}" + REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" + + # Pass variables to next step + echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT + echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT + echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT + echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT + + - name: v2.10.7-sops-ssh-alpine-3.13 - Build (PRs) + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v3 + with: + context: variants/v2.10.7-sops-ssh-alpine-3.13 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: v2.10.7-sops-ssh-alpine-3.13 - Build and push (master) + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v3 + with: + context: variants/v2.10.7-sops-ssh-alpine-3.13 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: v2.10.7-sops-ssh-alpine-3.13 - Build and push (release) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v3 + with: + context: variants/v2.10.7-sops-ssh-alpine-3.13 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache + build-2-9-18: runs-on: ubuntu-latest steps: @@ -1894,7 +2080,7 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache - build-2-3-0-0-r1: + build-2-3-0-0: runs-on: ubuntu-latest steps: - name: Checkout @@ -1925,9 +2111,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-2.3.0.0-r1-${{ github.sha }} + key: ${{ runner.os }}-buildx-2.3.0.0-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-2.3.0.0-r1- + ${{ runner.os }}-buildx-2.3.0.0- ${{ runner.os }}-buildx- - name: Login to Docker Hub registry @@ -2080,192 +2266,6 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache - build-2-10-7: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # 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@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-2.10.7-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx-2.10.7- - ${{ runner.os }}-buildx- - - - name: Login to Docker Hub registry - # Run on master and tags - if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - # This step generates the docker tags - - name: Prepare - id: prep-v2-10-7-alpine-3-13 - run: | - set -e - - # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - - # Get short commit hash E.g. 'abc0123' - SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate docker image tags - # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' - # E.g. 'master-' and 'master-abc0123-' - VARIANT="v2.10.7-alpine-3.13" - REF_VARIANT="${REF}-${VARIANT}" - REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" - - # Pass variables to next step - echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT - echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT - echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT - echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT - - - name: v2.10.7-alpine-3.13 - Build (PRs) - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 - with: - context: variants/v2.10.7-alpine-3.13 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_SHA_VARIANT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - - name: v2.10.7-alpine-3.13 - Build and push (master) - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 - with: - context: variants/v2.10.7-alpine-3.13 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_SHA_VARIANT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - - name: v2.10.7-alpine-3.13 - Build and push (release) - if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 - with: - context: variants/v2.10.7-alpine-3.13 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-alpine-3-13.outputs.REF_SHA_VARIANT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - # This step generates the docker tags - - name: Prepare - id: prep-v2-10-7-sops-ssh-alpine-3-13 - run: | - set -e - - # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - - # Get short commit hash E.g. 'abc0123' - SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate docker image tags - # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' - # E.g. 'master-' and 'master-abc0123-' - VARIANT="v2.10.7-sops-ssh-alpine-3.13" - REF_VARIANT="${REF}-${VARIANT}" - REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" - - # Pass variables to next step - echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT - echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT - echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT - echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT - - - name: v2.10.7-sops-ssh-alpine-3.13 - Build (PRs) - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 - with: - context: variants/v2.10.7-sops-ssh-alpine-3.13 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_SHA_VARIANT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - - name: v2.10.7-sops-ssh-alpine-3.13 - Build and push (master) - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 - with: - context: variants/v2.10.7-sops-ssh-alpine-3.13 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_SHA_VARIANT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - - name: v2.10.7-sops-ssh-alpine-3.13 - Build and push (release) - if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 - with: - context: variants/v2.10.7-sops-ssh-alpine-3.13 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-v2-10-7-sops-ssh-alpine-3-13.outputs.REF_SHA_VARIANT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - update-draft-release: needs: - build-8-4-0 @@ -2273,13 +2273,13 @@ jobs: - build-6-6-0 - build-5-8-0 - build-4-8-0 + - build-2-10-7 - build-2-9-18 - build-2-8-19 - build-2-7-17 - build-2-6-20 - build-2-4-6-0 - - build-2-3-0-0-r1 - - build-2-10-7 + - build-2-3-0-0 if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: @@ -2298,13 +2298,13 @@ jobs: - build-6-6-0 - build-5-8-0 - build-4-8-0 + - build-2-10-7 - build-2-9-18 - build-2-8-19 - build-2-7-17 - build-2-6-20 - build-2-4-6-0 - - build-2-3-0-0-r1 - - build-2-10-7 + - build-2-3-0-0 if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: @@ -2325,13 +2325,13 @@ jobs: - build-6-6-0 - build-5-8-0 - build-4-8-0 + - build-2-10-7 - build-2-9-18 - build-2-8-19 - build-2-7-17 - build-2-6-20 - build-2-4-6-0 - - build-2-3-0-0-r1 - - build-2-10-7 + - build-2-3-0-0 if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index 8fda925..838bc98 100755 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -115,7 +115,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'ansible' - package_version = '2.3.0.0-r1' + package_version = '2.3.0.0' distro = 'alpine' distro_version = '3.6' subvariants = @( @@ -131,7 +131,7 @@ $VARIANTS = @( # Metadata object _metadata = @{ package = $variant['package'] - package_version = $variant['package_version'] + package_version = $variant['package_version'] -replace '-r\d+$', '' # Remove the '-r[0-9]' suffix distro = $variant['distro'] distro_version = $variant['distro_version'] platforms = & { diff --git a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 index 161072e..c73c08f 100644 --- a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 +++ b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 @@ -36,7 +36,7 @@ jobs: '@ # Group variants by the package version -$groups = $VARIANTS | Group-Object -Property { $_['_metadata']['package_version'] } | Sort-Object -Property Name -Descending +$groups = $VARIANTS | Group-Object -Property { $_['_metadata']['package_version'] } | Sort-Object -Property { [version]$_.Name } -Descending $WORKFLOW_JOB_NAMES = $groups | % { "build-$( $_.Name.Replace('.', '-') )" } foreach ($g in $groups) { @" diff --git a/generate/templates/Dockerfile.ps1 b/generate/templates/Dockerfile.ps1 index e4953fb..383567b 100644 --- a/generate/templates/Dockerfile.ps1 +++ b/generate/templates/Dockerfile.ps1 @@ -6,7 +6,7 @@ RUN echo "I am running on `$BUILDPLATFORM, building for `$TARGETPLATFORM" # Install ansible RUN set -eux; \ - apk add --no-cache $( $VARIANT['_metadata']['package'] )$( if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and $VARIANT['_metadata']['distro_version'] -eq '3.6' ) { '=' } else { '~=' } )$( $VARIANT['_metadata']['package_version'] ); \ + apk add --no-cache $( $VARIANT['_metadata']['package'] )$( if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and $VARIANT['_metadata']['distro_version'] -eq '3.6' ) { '>=' } else { '~=' } )$( $VARIANT['_metadata']['package_version'] ); \ ansible --version RUN apk add --no-cache ca-certificates diff --git a/variants/v2.3.0.0-alpine-3.6/Dockerfile b/variants/v2.3.0.0-alpine-3.6/Dockerfile index 87e7b7e..08ed3d1 100644 --- a/variants/v2.3.0.0-alpine-3.6/Dockerfile +++ b/variants/v2.3.0.0-alpine-3.6/Dockerfile @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" # Install ansible RUN set -eux; \ - apk add --no-cache ansible=2.3.0.0-r1; \ + apk add --no-cache ansible>=2.3.0.0; \ ansible --version RUN apk add --no-cache ca-certificates diff --git a/variants/v2.3.0.0-sops-ssh-alpine-3.6/Dockerfile b/variants/v2.3.0.0-sops-ssh-alpine-3.6/Dockerfile index 75aafd2..641e5e9 100644 --- a/variants/v2.3.0.0-sops-ssh-alpine-3.6/Dockerfile +++ b/variants/v2.3.0.0-sops-ssh-alpine-3.6/Dockerfile @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" # Install ansible RUN set -eux; \ - apk add --no-cache ansible=2.3.0.0-r1; \ + apk add --no-cache ansible>=2.3.0.0; \ ansible --version RUN apk add --no-cache ca-certificates