kopia lustrzana https://github.com/kartoza/docker-postgis
commit
e7e1d9949a
|
@ -1 +0,0 @@
|
||||||
.gitignore
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Ignore everything except selected directory
|
||||||
|
**
|
||||||
|
|
||||||
|
!base_build
|
||||||
|
base_build/README.md
|
||||||
|
|
||||||
|
!scripts
|
||||||
|
!scenario_tests/utils/requirements.txt
|
|
@ -16,11 +16,14 @@ on:
|
||||||
# default: slim
|
# default: slim
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
jobs:
|
jobs:
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
latest-ref: refs/heads/develop
|
latest-ref: refs/heads/develop
|
||||||
|
defaultRepo: kartoza
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
postgresMajorVersion:
|
postgresMajorVersion:
|
||||||
|
@ -49,17 +52,11 @@ jobs:
|
||||||
# - build args (.example.env)
|
# - build args (.example.env)
|
||||||
# - base_build directory
|
# - base_build directory
|
||||||
# - scripts directory
|
# - scripts directory
|
||||||
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-${{ github.sha }}
|
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts', 'scenario_tests/utils/requirements.txt') }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-
|
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts', 'scenario_tests/utils/requirements.txt') }}-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Build all stages
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build base image
|
|
||||||
id: docker_build_base
|
id: docker_build_base
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
@ -67,7 +64,7 @@ jobs:
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
push: false
|
push: false
|
||||||
load: true
|
load: true
|
||||||
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
|
tags: ${{ secrets.DOCKERHUB_REPO || env.defaultRepo }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
|
||||||
build-args: |
|
build-args: |
|
||||||
DISTRO=${{ matrix.distro }}
|
DISTRO=${{ matrix.distro }}
|
||||||
IMAGE_VERSION=${{ matrix.imageVersion }}
|
IMAGE_VERSION=${{ matrix.imageVersion }}
|
||||||
|
@ -79,51 +76,6 @@ jobs:
|
||||||
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
|
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
|
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
|
||||||
target: postgis-base
|
|
||||||
|
|
||||||
- name: Build prod image
|
|
||||||
id: docker_build_prod
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfile
|
|
||||||
push: false
|
|
||||||
load: true
|
|
||||||
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
|
|
||||||
build-args: |
|
|
||||||
DISTRO=${{ matrix.distro }}
|
|
||||||
IMAGE_VERSION=${{ matrix.imageVersion }}
|
|
||||||
IMAGE_VARIANT=${{ matrix.imageVariant }}
|
|
||||||
LANGS=en_US.UTF-8,id_ID.UTF-8
|
|
||||||
GENERATE_ALL_LOCALE=0
|
|
||||||
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
|
|
||||||
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
|
|
||||||
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
|
|
||||||
target: postgis-prod
|
|
||||||
|
|
||||||
- name: Build image for testing
|
|
||||||
id: docker_build_testing_image
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfile
|
|
||||||
push: false
|
|
||||||
load: true
|
|
||||||
tags: kartoza/postgis:manual-build
|
|
||||||
build-args: |
|
|
||||||
DISTRO=${{ matrix.distro }}
|
|
||||||
IMAGE_VERSION=${{ matrix.imageVersion }}
|
|
||||||
IMAGE_VARIANT=${{ matrix.imageVariant }}
|
|
||||||
LANGS=en_US.UTF-8,id_ID.UTF-8
|
|
||||||
GENERATE_ALL_LOCALE=0
|
|
||||||
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
|
|
||||||
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
|
|
||||||
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
|
|
||||||
target: postgis-test
|
|
||||||
|
|
||||||
run-scenario-tests:
|
run-scenario-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -162,9 +114,9 @@ jobs:
|
||||||
# - build args (.example.env)
|
# - build args (.example.env)
|
||||||
# - base_build directory
|
# - base_build directory
|
||||||
# - scripts directory
|
# - scripts directory
|
||||||
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-${{ github.sha }}
|
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts', 'scenario_tests/utils/requirements.txt') }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-
|
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts', 'scenario_tests/utils/requirements.txt') }}-
|
||||||
|
|
||||||
- name: Build image for testing
|
- name: Build image for testing
|
||||||
id: docker_build_testing_image
|
id: docker_build_testing_image
|
||||||
|
@ -195,3 +147,72 @@ jobs:
|
||||||
pushd scenario_tests/${{ matrix.scenario }}
|
pushd scenario_tests/${{ matrix.scenario }}
|
||||||
./test.sh
|
./test.sh
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
push-internal-pr-images:
|
||||||
|
if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ build-image ]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
postgresMajorVersion:
|
||||||
|
- 13
|
||||||
|
postgisMajorVersion:
|
||||||
|
- 3
|
||||||
|
postgisMinorRelease:
|
||||||
|
- 1
|
||||||
|
include:
|
||||||
|
- distro: debian
|
||||||
|
imageVersion: bullseye
|
||||||
|
imageVariant: slim
|
||||||
|
steps:
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: docker_meta
|
||||||
|
uses: crazy-max/ghaction-docker-meta@v1
|
||||||
|
with:
|
||||||
|
images: ${{ secrets.DOCKERHUB_REPO}}/postgis
|
||||||
|
tag-latest: false
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Get build cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
# Build inputs are:
|
||||||
|
# - Dockerfile recipe
|
||||||
|
# - docker-compose.build.yml
|
||||||
|
# - build args (.example.env)
|
||||||
|
# - base_build directory
|
||||||
|
# - scripts directory
|
||||||
|
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-
|
||||||
|
|
||||||
|
- name: Build image for testing
|
||||||
|
id: docker_build_testing_image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.docker_meta.outputs.tags }}-${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
|
||||||
|
build-args: |
|
||||||
|
DISTRO=${{ matrix.distro }}
|
||||||
|
IMAGE_VERSION=${{ matrix.imageVersion }}
|
||||||
|
IMAGE_VARIANT=${{ matrix.imageVariant }}
|
||||||
|
LANGS=en_US.UTF-8,id_ID.UTF-8
|
||||||
|
GENERATE_ALL_LOCALE=0
|
||||||
|
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
|
||||||
|
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
|
||||||
|
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
target: postgis-test
|
||||||
|
|
|
@ -54,9 +54,9 @@ jobs:
|
||||||
# - build args (.example.env)
|
# - build args (.example.env)
|
||||||
# - base_build directory
|
# - base_build directory
|
||||||
# - scripts directory
|
# - scripts directory
|
||||||
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-${{ github.sha }}
|
key: buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts', 'scenario_tests/utils/requirements.txt') }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts') }}-
|
buildx-${{ hashFiles('Dockerfile', 'docker-compose.build.yml', '.example.env', 'base_build', 'scripts', 'scenario_tests/utils/requirements.txt') }}-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
|
@ -71,7 +71,9 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
|
tags: |
|
||||||
|
${{ secrets.DOCKERHUB_REPO }}/postgis:base
|
||||||
|
${{ secrets.DOCKERHUB_REPO }}/postgis:base-${{ matrix.distro }}-${{ matrix.imageVersion }}-${{ matrix.imageVariant }}
|
||||||
build-args: |
|
build-args: |
|
||||||
DISTRO=${{ matrix.distro }}
|
DISTRO=${{ matrix.distro }}
|
||||||
IMAGE_VERSION=${{ matrix.imageVersion }}
|
IMAGE_VERSION=${{ matrix.imageVersion }}
|
||||||
|
@ -91,8 +93,10 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
push: true
|
push: true
|
||||||
load: true
|
tags: |
|
||||||
tags: ${{ secrets.DOCKERHUB_REPO }}/postgis:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
|
${{ secrets.DOCKERHUB_REPO }}/postgis:${{ matrix.postgresMajorVersion }}
|
||||||
|
${{ secrets.DOCKERHUB_REPO }}/postgis:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}
|
||||||
|
${{ secrets.DOCKERHUB_REPO }}/postgis:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
|
||||||
build-args: |
|
build-args: |
|
||||||
DISTRO=${{ matrix.distro }}
|
DISTRO=${{ matrix.distro }}
|
||||||
IMAGE_VERSION=${{ matrix.imageVersion }}
|
IMAGE_VERSION=${{ matrix.imageVersion }}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
*.*~
|
*.*~
|
||||||
*/replication/pg-*
|
*/replication/pg-*
|
||||||
*/replication/docker-compose.override.yml
|
*/replication/docker-compose.override.yml
|
||||||
|
|
|
@ -5,7 +5,7 @@ ARG DISTRO=debian
|
||||||
ARG IMAGE_VERSION=bullseye
|
ARG IMAGE_VERSION=bullseye
|
||||||
ARG IMAGE_VARIANT=slim
|
ARG IMAGE_VARIANT=slim
|
||||||
FROM $DISTRO:$IMAGE_VERSION-$IMAGE_VARIANT AS postgis-base
|
FROM $DISTRO:$IMAGE_VERSION-$IMAGE_VARIANT AS postgis-base
|
||||||
MAINTAINER Tim Sutton<tim@kartoza.com>
|
LABEL maintainer="Tim Sutton<tim@kartoza.com>"
|
||||||
|
|
||||||
# Reset ARG for version
|
# Reset ARG for version
|
||||||
ARG IMAGE_VERSION
|
ARG IMAGE_VERSION
|
||||||
|
@ -67,7 +67,6 @@ RUN apt-get -y --purge autoremove \
|
||||||
##############################################################################
|
##############################################################################
|
||||||
FROM postgis-base AS postgis-prod
|
FROM postgis-base AS postgis-prod
|
||||||
|
|
||||||
MAINTAINER Tim Sutton<tim@kartoza.com>
|
|
||||||
|
|
||||||
# Reset ARG for version
|
# Reset ARG for version
|
||||||
ARG IMAGE_VERSION
|
ARG IMAGE_VERSION
|
||||||
|
|
Ładowanie…
Reference in New Issue