diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..e74cc5e9c2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: GitHub CI + +on: + pull_request: + push: + schedule: + - cron: 0 0 * * 0 + +defaults: + run: + shell: 'bash -Eeuo pipefail -x {0}' + +jobs: + + generate-jobs: + name: Generate Jobs + runs-on: ubuntu-latest + outputs: + strategy: ${{ steps.generate-jobs.outputs.strategy }} + steps: + - uses: actions/checkout@v1 + - id: generate-jobs + name: Generate Jobs + run: | + git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew + strategy="$(~/bashbrew/scripts/github-actions/generate.sh)" + strategy="$(.github/workflows/munge.sh -c <<<"$strategy")" + jq . <<<"$strategy" # sanity check / debugging aid + echo "::set-output name=strategy::$strategy" + + test: + needs: generate-jobs + strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v1 + - name: Prepare Environment + run: ${{ matrix.runs.prepare }} + - name: Pull Dependencies + run: ${{ matrix.runs.pull }} + - name: Build ${{ matrix.name }} + run: ${{ matrix.runs.build }} + - name: History ${{ matrix.name }} + run: ${{ matrix.runs.history }} + - name: Test ${{ matrix.name }} + run: ${{ matrix.runs.test }} + - name: '"docker images"' + run: ${{ matrix.runs.images }} diff --git a/.github/workflows/munge.sh b/.github/workflows/munge.sh new file mode 100755 index 0000000000..9686dd0700 --- /dev/null +++ b/.github/workflows/munge.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +# copy all the Debian build jobs into "force deb build" jobs which build like architectures upstream doesn't publish for will +jq \ + --arg prefix '[ "$(dpkg --print-architecture)" = "amd64" ]' \ + --arg dfMunge 'grep -qE "amd64 [|] " "$df"; sed -ri -e "s/amd64 [|] //g" "$df"; ! grep -qE "amd64 [|] " "$df"' \ + ' + .matrix.include += [ + .matrix.include[] + | select(.name | test(" (.+)") | not) # ignore any existing munged builds + | select(.meta.froms[] | test("^debian:|^ubuntu:")) + | .name += " (force deb build)" + | .runs.build = ( + [ + "# force us to build debs instead of downloading them", + $prefix, + ("for df in " + ([ .meta.dockerfiles[] | @sh ] | join(" ")) + "; do " + $dfMunge + "; done"), + .runs.build + ] | join ("\n") + ) + ] + ' "$@" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 351c3f6983..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: bash -services: docker - -env: - - VERSION=12 - - VERSION=12 FORCE_DEB_BUILD=1 - - VERSION=12 VARIANT=alpine - - VERSION=11 - - VERSION=11 FORCE_DEB_BUILD=1 - - VERSION=11 VARIANT=alpine - - VERSION=10 - - VERSION=10 FORCE_DEB_BUILD=1 - - VERSION=10 VARIANT=alpine - - VERSION=9.6 - - VERSION=9.6 FORCE_DEB_BUILD=1 - - VERSION=9.6 VARIANT=alpine - - VERSION=9.5 - - VERSION=9.5 FORCE_DEB_BUILD=1 - - VERSION=9.5 VARIANT=alpine - -install: - - git clone https://github.com/docker-library/official-images.git ~/official-images - -before_script: - - env | sort - - wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash - - cd "$VERSION/$VARIANT" - - image="postgres:${VERSION}${VARIANT:+-${VARIANT}}" - -script: - - | - ( - set -Eeuo pipefail - set -x - if [ -n "${FORCE_DEB_BUILD:+x}" ]; then - [ "$(dpkg --print-architecture)" = 'amd64' ] - grep -qE 'amd64 [|] ' Dockerfile - sed -ri -e 's/amd64 [|] //g' Dockerfile - ! grep -qE 'amd64 [|] ' Dockerfile - fi - docker build -t "$image" . - ~/official-images/test/run.sh "$image" - ) - -after_script: - - docker images - -# vim:set et ts=2 sw=2: diff --git a/README.md b/README.md index 4e09d99d33..bfd66bde28 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ For outstanding `postgres` image PRs, check [PRs with the "library/postgres" lab --- -- [![build status badge](https://img.shields.io/travis/docker-library/postgres/master.svg?label=Travis%20CI)](https://travis-ci.org/docker-library/postgres/branches) -- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/postgres.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/postgres) +- [![build status badge](https://img.shields.io/github/workflow/status/docker-library/postgres/GitHub%20CI/master?label=GitHub%20CI)](https://github.com/docker-library/postgres/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster) +- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/postgres.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/postgres/) | Build | Status | Badges | (per-arch) | |:-:|:-:|:-:|:-:| -| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres) | [![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres) | [![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres) | -| [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres) | [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres) | [![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres) | -| [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres) | +| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres/) | [![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres/) | [![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres/) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres/) | +| [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres/) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres/) | [![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/postgres.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/postgres/) | [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres/) | +| [![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres/) | [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres/) | diff --git a/update.sh b/update.sh index e8702d87e3..f264e0a5a6 100755 --- a/update.sh +++ b/update.sh @@ -9,9 +9,6 @@ if [ ${#versions[@]} -eq 0 ]; then fi versions=( "${versions[@]%/}" ) -# sort version numbers with highest last (so it goes first in .travis.yml) -IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -V) ); unset IFS - defaultDebianSuite='buster-slim' declare -A debianSuite=( # https://github.com/docker-library/postgres/issues/582 @@ -46,7 +43,6 @@ fetch_suite_arches() { fi } -travisEnv= for version in "${versions[@]}"; do tag="${debianSuite[$version]:-$defaultDebianSuite}" suite="${tag%%-slim}" @@ -134,13 +130,5 @@ for version in "${versions[@]}"; do # JIT / LLVM is only supported in PostgreSQL 11+ (https://github.com/docker-library/postgres/issues/475) sed -i '/llvm/d' "$version/$variant/Dockerfile" fi - - travisEnv="\n - VERSION=$version VARIANT=$variant$travisEnv" done - - travisEnv="\n - VERSION=$version FORCE_DEB_BUILD=1$travisEnv" - travisEnv="\n - VERSION=$version$travisEnv" done - -travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" -cat <<<"$travis" > .travis.yml