Skip to content

Commit 194aac3

Browse files
committed
Add installation of PostgreSQL client tools in CI workflow
1 parent 5f97acd commit 194aac3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.circleci/new_branch.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ jobs:
112112
DBMATE_SCHEMA_FILE: ./sourcify-database.sql
113113
steps:
114114
- checkout
115+
- run:
116+
# Needed to make pg_dump available for dbmate
117+
name: Install PostgreSQL client tools
118+
command: |
119+
sudo apt-get update
120+
# Add PostgreSQL official APT repository for version 16
121+
sudo apt-get install -y wget ca-certificates
122+
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
123+
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
124+
sudo apt-get update
125+
# Install PostgreSQL 16 client tools
126+
sudo apt-get install -y postgresql-client-16
115127
- run:
116128
name: Install Node.js dependencies
117129
command: |
@@ -125,6 +137,8 @@ jobs:
125137
git submodule update --init
126138
# Apply migrations using npm script
127139
npm run migrate:up
140+
# Force dump in case problems were ignored
141+
npx dbmate dump
128142
129143
# Check if the schema file has changed
130144
if git diff --exit-code sourcify-database.sql; then

0 commit comments

Comments
 (0)