build(tools): provision PostgreSQL 18 in the cloud setup for full checks
This commit is contained in:
1 parent
49f4bafaa9
commit
906e6629f8
1 file changed
+19
@@ -47,6 +47,25 @@ go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc@$PROTOC_GEN_GO_GRPC_VE
|
||||
curl -fsSL https://raw.githubusercontent.com/gastownhall/beads/main/scripts/install.sh | bash
|
||||
(cd "$HOME" && bd setup claude --global)
|
||||
|
||||
# PostgreSQL 18 for running full checks against the real stack
|
||||
# (deployments/dev.toml). Never for tests: they use fakes.
|
||||
if [ ! -x /usr/lib/postgresql/18/bin/postgres ]; then
|
||||
$SUDO apt-get install -y --no-install-recommends postgresql-common
|
||||
$SUDO /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
|
||||
$SUDO apt-get install -y --no-install-recommends postgresql-18
|
||||
fi
|
||||
for v in $(pg_lsclusters -h | awk '$1 != 18 {print $1}'); do
|
||||
$SUDO pg_ctlcluster "$v" main stop || true
|
||||
$SUDO pg_dropcluster "$v" main
|
||||
done
|
||||
pg_lsclusters -h | grep -q '^18 main' || $SUDO pg_createcluster 18 main --port 5432
|
||||
$SUDO pg_ctlcluster 18 main start || true
|
||||
as_pg() { $SUDO runuser -u postgres -- "$@"; }
|
||||
as_pg psql -qtc "SELECT 1 FROM pg_roles WHERE rolname = 'archie'" | grep -q 1 ||
|
||||
as_pg psql -qc "CREATE USER archie WITH PASSWORD 'archie' SUPERUSER"
|
||||
as_pg psql -qtc "SELECT 1 FROM pg_database WHERE datname = 'archie'" | grep -q 1 ||
|
||||
as_pg createdb -O archie archie
|
||||
|
||||
# Commit and PR attribution stays off, matching local settings.
|
||||
mkdir -p "$HOME/.claude"
|
||||
settings="$HOME/.claude/settings.json"
|
||||
|
||||
Reference in new issue
Block a user