Files
coolify-examples/docker-compose-bind-mount-preview/scripts/bootstrap_db.sh
Andras Bacsai 4838432850 Add docker-compose bind mount preview test case (#67)
Test case for coolify#7802 — reproduces the bug where bind mount
volumes from repo content get an incorrect -pr-N suffix during
Preview Deployments.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:40:20 +01:00

21 lines
490 B
Bash

#!/bin/bash
set -e
echo "Waiting for PostgreSQL to be ready..."
until psql -h "$DB_HOST" -U "$DB_USER" -d "$DB_NAME" -c '\q' 2>/dev/null; do
sleep 1
done
echo "Creating test table..."
psql -h "$DB_HOST" -U "$DB_USER" -d "$DB_NAME" <<SQL
CREATE TABLE IF NOT EXISTS test_table (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO test_table (name) VALUES ('hello from bootstrap');
SQL
echo "Bootstrap complete!"