Skip to content

Commit e237ab1

Browse files
Fix postgres tests
Tests were failing on CI with postgres due to an error with the username.
1 parent 120b0e7 commit e237ab1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

bin/dummy-app

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ fi
3030

3131
cd ./dummy-app
3232

33+
if [ -n "$DB_HOST" ]; then
34+
echo "~~~> Configuring database.yml for DB_HOST=$DB_HOST"
35+
ruby -i -pe '
36+
if $_ =~ /^ (pool|max_connections):/
37+
$_ += " host: <%= ENV.fetch(\"DB_HOST\", \"localhost\") %>\n"
38+
$_ += " username: <%= ENV[\"DB_USERNAME\"] %>\n"
39+
end
40+
' config/database.yml
41+
fi
42+
3343
echo "Generating manifest file"
3444
mkdir -p app/assets/config
3545
cat <<MANIFESTJS > app/assets/config/manifest.js

0 commit comments

Comments
 (0)