Skip to content

Commit 4cd0b77

Browse files
committed
feat(cli): widen range of supported Postgres versions
1 parent 928b6d5 commit 4cd0b77

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

docs/references/cli.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Execute the specified code-mod.
7979
Manage common docker components.
8080

8181
Manages a single PostgreSQL and Minio container for use in all your local
82-
projects. It can switch between multiple PostgreSQL versions (12, 13 and 14 are
82+
projects. It can switch between multiple PostgreSQL versions (12-16 are
8383
supported via --postgres-version), however only a single version can be 'up' at
8484
a time.
8585

@@ -92,6 +92,12 @@ Minio credentials:
9292
- ACCESS_KEY: minio
9393
- SECRET_KEY: minio123
9494

95+
You can prevent Docker usage, but still use commands like 'compas docker clean'
96+
with either the '--use-host' flag or by setting 'COMPAS_SKIP_DOCKER=true' in
97+
your environment.
98+
99+
---
100+
95101
Don't use this command and secrets for your production deployment.
96102

97103
| Option | Description |

packages/cli/src/compas/commands/docker.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const cliDefinition = {
2222
name: "docker",
2323
shortDescription: "Manage common docker components.",
2424
longDescription: `Manages a single PostgreSQL and Minio container for use in all your local projects.
25-
It can switch between multiple PostgreSQL versions (12, 13 and 14 are supported via --postgres-version), however only a single version can be 'up' at a time.
25+
It can switch between multiple PostgreSQL versions (12-16 are supported via --postgres-version), however only a single version can be 'up' at a time.
2626
2727
PostgreSQL credentials:
2828
> postgresql://postgres:postgres@127.0.0.1:5432/postgres
@@ -31,7 +31,9 @@ Minio credentials:
3131
- ACCESS_KEY: minio
3232
- SECRET_KEY: minio123
3333
34+
You can prevent Docker usage, but still use commands like 'compas docker clean' with either the '--use-host' flag or by setting 'COMPAS_SKIP_DOCKER=true' in your environment.
3435
36+
---
3537
Don't use this command and secrets for your production deployment.
3638
`,
3739
modifiers: {
@@ -82,7 +84,8 @@ The flag is repeatable, so multiple projects can be cleaned at the same time. If
8284
value: {
8385
specification: "number",
8486
validator: (value) => {
85-
const isValid = [12, 13, 14].includes(value);
87+
const versions = [12, 13, 14, 15, 16];
88+
const isValid = versions.includes(value);
8689

8790
if (isValid) {
8891
return { isValid };
@@ -91,7 +94,7 @@ The flag is repeatable, so multiple projects can be cleaned at the same time. If
9194
return {
9295
isValid,
9396
error: {
94-
message: "Only PostgreSQL version 12, 13 and 14 are supported.",
97+
message: `The following PostgreSQL versions are supported: ${versions.join(", ")}.`,
9598
},
9699
};
97100
},
@@ -467,6 +470,8 @@ function getContainerInformation(postgresVersion, useHost) {
467470
"compas-postgres-12",
468471
"compas-postgres-13",
469472
"compas-postgres-14",
473+
"compas-postgres-15",
474+
"compas-postgres-16",
470475
"compas-minio",
471476
],
472477
containersOnHost: [],

0 commit comments

Comments
 (0)