Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to version 17-3.5 #101

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
COMPOSE_PROJECT_NAME=postgis

## For build arguments
POSTGRES_MAJOR_VERSION=16
POSTGRES_MAJOR_VERSION=17
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_RELEASE=4
POSTGIS_MINOR_RELEASE=5
28 changes: 23 additions & 5 deletions .github/workflows/build-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,31 @@ on:
pull_request:
branches:
- master
paths:
- 'Dockerfile'
- 'scripts/**'
- 'build_data/**'
- '.github/workflows/**'
push:
branches:
- master
jobs:
run-scenario-tests:
if: |
github.actor != 'dependabot[bot]' &&
!(
contains(github.event.pull_request.title, '[skip-release]') ||
contains(github.event.comment.body, '/skiprelease')
)
runs-on: ubuntu-latest
strategy:
matrix:
postgresMajorVersion:
- 16
- 17
postgisMajorVersion:
- 3
postgisMinorRelease:
- 4
- 5
scenario:
- restore
- s3
Expand Down Expand Up @@ -56,17 +67,24 @@ jobs:
bash ./test.sh

push-internal-pr-images:
if: github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url &&
github.actor != 'dependabot[bot]' &&
!(
contains(github.event.pull_request.title, '[skip-release]') ||
contains(github.event.comment.body, '/skiprelease')
)
runs-on: ubuntu-latest
needs: [ run-scenario-tests ]
strategy:
matrix:
postgresMajorVersion:
- 16
- 17
postgisMajorVersion:
- 3
postgisMinorRelease:
- 4
- 5
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/deploy-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@ on:
- completed
jobs:
deploy-image:
if: |
github.actor != 'dependabot[bot]' &&
!(
contains(github.event.pull_request.title, '[skip-release]') ||
contains(github.event.comment.body, '/skiprelease')
) && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
env:
latest-ref: refs/heads/develop
strategy:
matrix:
postgresMajorVersion:
- 16
- 17
postgisMajorVersion:
- 3
postgisMinorRelease:
- 4
- 5
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand All @@ -33,15 +39,17 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Get Current Date
id: current_date
shell: python
run: |
import datetime
now = datetime.datetime.utcnow()
print(f'::set-output name=formatted::{now:%Y.%m.%d}')
run: echo "formatted=$(date -u +%Y.%m.%d)" >> $GITHUB_OUTPUT

- name: Check if image exists on Docker Hub
id: check_hub_image_exists
run: |
docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKERHUB_PASSWORD }}
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.DOCKERHUB_PASSWORD }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
check_image=$(curl --silent -f --head -lL https://hub.docker.com/v2/repositories/kartoza/pg-backup/tags/${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}/ | head -n 1 | cut -d ' ' -f2) >> $GITHUB_OUTPUT

- name: Build prod image
id: docker_build_prod
Expand All @@ -53,6 +61,7 @@ jobs:
push: true
tags: |
${{ secrets.DOCKERHUB_REPO }}/pg-backup:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
${{ steps.check_hub_image_exists.outputs.check_image == 200 && format('{0}/pg-backup:{1}-{2}.{3}', secrets.DOCKERHUB_REPO, matrix.postgresMajorVersion, matrix.postgisMajorVersion, matrix.postgisMinorRelease) || null}}
${{ secrets.DOCKERHUB_REPO }}/pg-backup:${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}--v${{ steps.current_date.outputs.formatted }}
build-args: |
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
Expand Down
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
##############################################################################
# Production Stage #
##############################################################################
ARG POSTGRES_MAJOR_VERSION=16
ARG POSTGRES_MAJOR_VERSION=17
ARG POSTGIS_MAJOR_VERSION=3
ARG POSTGIS_MINOR_RELEASE=4
ARG POSTGIS_MINOR_RELEASE=5

FROM kartoza/postgis:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE} AS postgis-backup-production

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ docker pull kartoza/pg-backup:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${P

Where the environment variables are
```
POSTGRES_MAJOR_VERSION=13
POSTGRES_MAJOR_VERSION=17
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_RELEASE=1
POSTGIS_MINOR_RELEASE=5
```

We highly suggest that you use a tagged image that match the PostgreSQL image you are running i.e
(kartoza/pg-backup:15-3.3 for backing up kartoza/postgis:15-3.3 DB). The
(kartoza/pg-backup:17-3.5 for backing up kartoza/postgis:17-3.5 DB). The
latest tag may change and may not successfully back up your database.


Expand All @@ -61,9 +61,9 @@ cd docker-pg-backup
To create a running container do:

```
POSTGRES_MAJOR_VERSION=15
POSTGRES_MAJOR_VERSION=17
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_RELEASE=3
POSTGIS_MINOR_RELEASE=5
docker run --name "db" -p 25432:5432 -d -t kartoza/postgis:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE}
docker run --name="backups" --link db:db -v `pwd`/backups:/backups -d kartoza/pg-backup:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE}
```
Expand All @@ -85,8 +85,8 @@ databases.
* `REMOVE_BEFORE` remove all old backups older than specified amount of days, e.g. `30` would
only keep backup files younger than 30 days. Default: no files are ever removed.
* `DUMP_ARGS` The default dump arguments based on official
[PostgreSQL Dump options](https://www.postgresql.org/docs/13/app-pgdump.html).
* `RESTORE_ARGS` Additional restore commands based on official [PostgreSQL restore](https://www.postgresql.org/docs/13/app-pgrestore.html)
[PostgreSQL Dump options](https://www.postgresql.org/docs/17/app-pgdump.html).
* `RESTORE_ARGS` Additional restore commands based on official [PostgreSQL restore](https://www.postgresql.org/docs/17/app-pgrestore.html)
* `STORAGE_BACKEND` The default backend is to store the backup files. It can either
be `FILE` or `S3`(Example minio or amazon bucket) backends.
* `DB_TABLES` A boolean variable to specify if the user wants to dump the DB as individual tables.
Expand Down Expand Up @@ -116,7 +116,7 @@ As a concrete example, with `DUMPPREFIX=PG` and if your postgis has DB name `gis
The backup archive would be something like:

```
/backups/2019/February/PG_gis.13-February-2019.dmp
/backups/2019/February/PG_gis.17-February-2019.dmp
```

If you specify `ARCHIVE_FILENAME` instead (default value is empty). The
Expand Down
2 changes: 0 additions & 2 deletions docker-compose-s3.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

version: '2.1'

volumes:
db-data:
minio_data:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Used solely for docker-compose build
version: '3.9'
services:
postgis-backup-prod:
image: kartoza/pg-backup:$POSTGRES_MAJOR_VERSION-$POSTGIS_MAJOR_VERSION.${POSTGIS_MINOR_RELEASE}
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

version: '2.1'

volumes:
db-backups:
db-data:
Expand Down
4 changes: 1 addition & 3 deletions scenario_tests/restore/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@

version: '2.1'

volumes:
pg-backup-data-dir:
pg-data-dir:

services:

pg_backup:
image: kartoza/postgis:16-3.4
image: kartoza/postgis:17-3.5
restart: 'always'
volumes:
- ./setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql
Expand Down
4 changes: 1 addition & 3 deletions scenario_tests/s3/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

version: '2.1'

volumes:
pg-backup-data-dir:
pg-data-dir:
Expand All @@ -9,7 +7,7 @@ volumes:
services:

db:
image: kartoza/postgis:16-3.4
image: kartoza/postgis:17-3.5
restart: 'always'
volumes:
- ./setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql
Expand Down