Skip to content

Commit 2def123

Browse files
committed
Fix postgres docker image version
- We weren't using the intended tag (and so always testing against bullseye). - We weren't using `'pull': 'always'` and so we'd use whatever image happened to be cached on the runner without ever checking for newer versions. - Update to pg 15 for the sid test, downgrade to pg 12 for the focal test.
1 parent f3581ad commit 2def123

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.drone.jsonnet

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,19 @@ local debian_pipeline(name,
7272
};
7373

7474
local pg_deps = ['python3-psycopg2', 'postgresql-client'];
75-
local pg_service =
76-
{ name: 'pg', image: 'postgres:bullseye', environment: { POSTGRES_USER: 'ci', POSTGRES_PASSWORD: 'ci' } };
75+
local pg_service(pg_tag='bullseye') = {
76+
name: 'pg',
77+
image: 'postgres:' + pg_tag,
78+
pull: 'always',
79+
environment: { POSTGRES_USER: 'ci', POSTGRES_PASSWORD: 'ci' },
80+
};
7781
local pg_wait = 'for i in $(seq 0 30); do if pg_isready -d ci -h pg -U ci -t 1; then break; elif [ "$i" = 30 ]; then echo "Timeout waiting for postgresql" >&2; exit 1; fi; sleep 1; done';
7882

7983
local debian_pg_pipeline(name, image, pg_tag='bullseye', distro=auto_distro) = debian_pipeline(
8084
name,
8185
image,
8286
deps=default_deps + pg_deps,
83-
services=[pg_service],
87+
services=[pg_service(pg_tag)],
8488
before_pytest=[pg_wait],
8589
pytest_opts='--pgsql "postgresql://ci:ci@pg/ci"',
8690
distro=distro
@@ -143,7 +147,7 @@ local upgrade_test(name, from='v0.1.10', intermediates=[], pg=false, pg_convert=
143147
debian_pipeline('Ubuntu latest (amd64)', docker_base + 'ubuntu-rolling'),
144148
debian_pipeline('Ubuntu LTS (amd64)', docker_base + 'ubuntu-lts'),
145149

146-
debian_pg_pipeline('PostgreSQL 14/sid', docker_base + 'debian-sid', pg_tag='14-bullseye', distro='sid'),
150+
debian_pg_pipeline('PostgreSQL 15/sid', docker_base + 'debian-sid', pg_tag='15-bullseye', distro='sid'),
147151
debian_pg_pipeline('PostgreSQL 12/focal', docker_base + 'ubuntu-focal', pg_tag='12-bullseye'),
148152

149153
// ARM builds (ARM64 and armhf)
@@ -167,7 +171,7 @@ local upgrade_test(name, from='v0.1.10', intermediates=[], pg=false, pg_convert=
167171
kind: 'pipeline',
168172
type: 'docker',
169173
platform: { arch: 'amd64' },
170-
services: [pg_service],
174+
services: [pg_service()],
171175
steps: [
172176
upgrade_test('postgres: 0.1.10→now', pg=true),
173177
upgrade_test('postgres: 0.3.0→now', from='v0.3.0-pg', pg=true),

0 commit comments

Comments
 (0)