Skip to content

Commit

Permalink
add postgres 16
Browse files Browse the repository at this point in the history
  • Loading branch information
rafsaf committed Oct 9, 2023
1 parent 6f9af73 commit 3e264dc
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 14 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
POSTGRESQL_DB_PG_16=host=localhost port=10016 password=password-_-12!@#$%^&*()/;><.,]}{[ user=user-_-12!@#$%^&*()/;><.,]}{[ db=database-_-12!@#$%^&*()/;><.,]}{[ cron_rule=* * * * *
POSTGRESQL_DB_PG_15=host=localhost port=10015 password=password-_-12!@#$%^&*()/;><.,]}{[ user=user-_-12!@#$%^&*()/;><.,]}{[ db=database-_-12!@#$%^&*()/;><.,]}{[ cron_rule=* * * * *
POSTGRESQL_DB_PG_14=host=localhost port=10014 password=password-_-12!@#$%^&*()/;><.,]}{[ user=user-_-12!@#$%^&*()/;><.,]}{[ db=database-_-12!@#$%^&*()/;><.,]}{[ cron_rule=* * * * *
POSTGRESQL_DB_PG_13=host=localhost port=10013 password=password-_-12!@#$%^&*()/;><.,]}{[ user=user-_-12!@#$%^&*()/;><.,]}{[ db=database-_-12!@#$%^&*()/;><.,]}{[ cron_rule=* * * * *
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: touch .env

- name: Download and start db containers
run: docker compose up -d postgres_15 postgres_14 postgres_13 postgres_12 postgres_11 mysql_57 mysql_80 mariadb_1011 mariadb_1006 mariadb_1005 mariadb_1004
run: docker compose up -d postgres_16 postgres_15 postgres_14 postgres_13 postgres_12 postgres_11 mysql_57 mysql_80 mariadb_1011 mariadb_1006 mariadb_1005 mariadb_1004

- name: Build image and run tests in container
run: docker compose run --rm --build backuper_tests_${{ matrix.arch }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Both upload providers and backup targets were created with possibility to easly

5. Setup databases

`docker compose up -d postgres_15 postgres_14 postgres_13 postgres_12 postgres_11 mysql_57 mysql_80 mariadb_1011 mariadb_1006 mariadb_1005 mariadb_1004`
`docker compose up -d postgres_16 postgres_15 postgres_14 postgres_13 postgres_12 postgres_11 mysql_57 mysql_80 mariadb_1011 mariadb_1006 mariadb_1005 mariadb_1004`

6. You can run backuper (`--single` here to make all backups immediatly and then exit):

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Backups are in `zip` format using [7-zip](https://www.7-zip.org/), with strong A

## Supported backup targets

- PostgreSQL (tested on 15, 14, 13, 12, 11)
- PostgreSQL (tested on 16, 15, 14, 13, 12, 11)
- MySQL (tested on 8.0, 5.7)
- MariaDB (tested on 10.11, 10.6, 10.5, 10.4)
- Single file
Expand Down
27 changes: 21 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# also used in GH workflows
# set up dbs
# docker compose up -d postgres_15 postgres_14 postgres_13 postgres_12 postgres_11 mysql_57 mysql_80 mariadb_1011 mariadb_1006 mariadb_1005 mariadb_1004
# docker compose up -d postgres_16 postgres_15 postgres_14 postgres_13 postgres_12 postgres_11 mysql_57 mysql_80 mariadb_1011 mariadb_1006 mariadb_1005 mariadb_1004
# run tests amd64
# docker compose run --rm --build backuper_tests_amd64
# run tests arm64 see https://docs.docker.com/build/building/multi-platform/
Expand All @@ -10,9 +10,19 @@
# docker compose run --rm --build backuper_acceptance_test_arm64

services:
postgres_16:
restart: "no"
image: postgres:16.0
environment:
- POSTGRES_PASSWORD=password-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_USER=user-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_DB=database-_-12!@#$%^&*()/;><.,]}{[
ports:
- 10016:5432

postgres_15:
restart: "no"
image: postgres:15.1
image: postgres:15.4
environment:
- POSTGRES_PASSWORD=password-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_USER=user-_-12!@#$%^&*()/;><.,]}{[
Expand All @@ -22,7 +32,7 @@ services:

postgres_14:
restart: "no"
image: postgres:14.6
image: postgres:14.9
environment:
- POSTGRES_PASSWORD=password-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_USER=user-_-12!@#$%^&*()/;><.,]}{[
Expand All @@ -32,7 +42,7 @@ services:

postgres_13:
restart: "no"
image: postgres:13.8
image: postgres:13.12
environment:
- POSTGRES_PASSWORD=password-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_USER=user-_-12!@#$%^&*()/;><.,]}{[
Expand All @@ -42,7 +52,7 @@ services:

postgres_12:
restart: "no"
image: postgres:12.12
image: postgres:12.16
environment:
- POSTGRES_PASSWORD=password-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_USER=user-_-12!@#$%^&*()/;><.,]}{[
Expand All @@ -52,7 +62,7 @@ services:

postgres_11:
restart: "no"
image: postgres:11.16
image: postgres:11.21
environment:
- POSTGRES_PASSWORD=password-_-12!@#$%^&*()/;><.,]}{[
- POSTGRES_USER=user-_-12!@#$%^&*()/;><.,]}{[
Expand Down Expand Up @@ -130,6 +140,7 @@ services:
restart: "no"
platform: linux/amd64
depends_on:
- postgres_16
- postgres_15
- postgres_14
- postgres_13
Expand All @@ -153,6 +164,7 @@ services:
restart: "no"
platform: linux/arm64
depends_on:
- postgres_16
- postgres_15
- postgres_14
- postgres_13
Expand All @@ -176,6 +188,7 @@ services:
restart: "no"
network_mode: "host"
depends_on:
- postgres_16
- postgres_15
- postgres_14
- postgres_13
Expand All @@ -200,6 +213,7 @@ services:
network_mode: "host"
platform: linux/amd64
depends_on:
- postgres_16
- postgres_15
- postgres_14
- postgres_13
Expand All @@ -224,6 +238,7 @@ services:
network_mode: "host"
platform: linux/arm64
depends_on:
- postgres_16
- postgres_15
- postgres_14
- postgres_13
Expand Down
2 changes: 1 addition & 1 deletion docs/backup_targets/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ POSTGRESQL_SOME_STRING="host=... password=... cron_rule=..."
```

!!! note
_Any environment variable that starts with "**POSTGRESQL_**" will be handled as PostgreSQL._ There can be multiple files paths definition for one backuper instance, for example `POSTGRESQL_FOO_MY_DB1` and `POSTGRESQL_BAR_MY_DB2`. Supported versions are: 15, 14, 13, 12, 11. Params must be included in value, splited by single space for example `"value1=1 value2=foo"`.
_Any environment variable that starts with "**POSTGRESQL_**" will be handled as PostgreSQL._ There can be multiple files paths definition for one backuper instance, for example `POSTGRESQL_FOO_MY_DB1` and `POSTGRESQL_BAR_MY_DB2`. Supported versions are: 16, 15, 14, 13, 12, 11. Params must be included in value, splited by single space for example `"value1=1 value2=foo"`.

## Params

Expand Down
18 changes: 14 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
cron_rule="* * * * *",
abs_path=Path(__file__).absolute().parent / "const/testfolder",
)
POSTGRES_16 = PostgreSQLTargetModel(
env_name="postgresql_db_15",
cron_rule="* * * * *",
host="postgres_16" if DOCKER_TESTS else "localhost",
port=5432 if DOCKER_TESTS else 10016,
password=SecretStr("password-_-12!@#$%^&*()/;><.,]}{["),
db="database-_-12!@#$%^&*()/;><.,]}{[",
user="user-_-12!@#$%^&*()/;><.,]}{[",
)
POSTGRES_15 = PostgreSQLTargetModel(
env_name="postgresql_db_15",
cron_rule="* * * * *",
Expand Down Expand Up @@ -129,11 +138,11 @@
)

DB_VERSION_BY_ENV_VAR: dict[str, str] = {
"postgresql_db_15": "15.1",
"postgresql_db_14": "14.6",
"postgresql_db_15": "15.4",
"postgresql_db_14": "14.9",
"postgresql_db_13": "13.8",
"postgresql_db_12": "12.12",
"postgresql_db_11": "11.16",
"postgresql_db_12": "12.16",
"postgresql_db_11": "11.21",
"mysql_db_80": "8.0.33",
"mysql_db_57": "5.7.42",
"mariadb_1011": "10.11.2",
Expand All @@ -147,6 +156,7 @@
POSTGRES_13,
POSTGRES_14,
POSTGRES_15,
POSTGRES_16,
]
ALL_MYSQL_DBS_TARGETS: list[MySQLTargetModel] = [
MYSQL_57,
Expand Down

0 comments on commit 3e264dc

Please sign in to comment.