From dbf4febacebd776da81b9d5baececfb4bafa7e49 Mon Sep 17 00:00:00 2001 From: Konstantin Renner Date: Mon, 20 Apr 2026 21:05:47 +0200 Subject: [PATCH] fix(migrate): Use python3-psycopg2 + system-site-packages for barman The postgres:16 image lacks gcc / libpq-dev, so pip build of barman's psycopg2 dep fails. Install the compiled binary via apt and point the venv at system site-packages so barman[cloud] reuses it. Co-Authored-By: Claude Opus 4.7 (1M context) --- .woodpecker/migrate-authentik-db.yml | 7 +++++-- .woodpecker/migrate-paperless.yml | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.woodpecker/migrate-authentik-db.yml b/.woodpecker/migrate-authentik-db.yml index 2b478adf..0de63565 100644 --- a/.woodpecker/migrate-authentik-db.yml +++ b/.woodpecker/migrate-authentik-db.yml @@ -71,8 +71,11 @@ steps: - set -euo pipefail - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - - apt-get install -y --no-install-recommends python3 python3-pip python3-venv awscli ca-certificates >/dev/null - - python3 -m venv /opt/barman + # python3-psycopg2 provides the compiled binary so barman's pip + # install doesn't try to build psycopg2 from source (postgres:16 + # ships without gcc / libpq-dev). + - apt-get install -y --no-install-recommends python3 python3-pip python3-venv python3-psycopg2 awscli ca-certificates >/dev/null + - python3 -m venv --system-site-packages /opt/barman - /opt/barman/bin/pip install --no-cache-dir --quiet 'barman[cloud,aws-snapshots]' - export PATH="/opt/barman/bin:$PATH" # Wait for the ephemeral Postgres service to come up diff --git a/.woodpecker/migrate-paperless.yml b/.woodpecker/migrate-paperless.yml index acd7383b..a14fbb27 100644 --- a/.woodpecker/migrate-paperless.yml +++ b/.woodpecker/migrate-paperless.yml @@ -77,8 +77,10 @@ steps: - set -euo pipefail - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - - apt-get install -y --no-install-recommends python3 python3-pip python3-venv awscli ca-certificates >/dev/null - - python3 -m venv /opt/barman + # python3-psycopg2 provides the compiled binary so barman's pip + # install doesn't try to build psycopg2 from source. + - apt-get install -y --no-install-recommends python3 python3-pip python3-venv python3-psycopg2 awscli ca-certificates >/dev/null + - python3 -m venv --system-site-packages /opt/barman - /opt/barman/bin/pip install --no-cache-dir --quiet 'barman[cloud,aws-snapshots]' - export PATH="/opt/barman/bin:$PATH" - |