Hello,
I’m trying to get a PostgreSQL 12 Database for my build. I’ve been trying for four hours. I’ve looked at the other threads here and on StackOverFlow. But I’ve made no progress and it keeps failing.
I’m using focal
so it has PostgreSQL 12.2. So I don’t need to mess with addons: postgres: '12'
and apt: ...
The psql --version
command works, but the psql -c 'create database ...
command does not.
If I remove the psql -c 'create database ...
command, my application fails to start due to the missing Database, with Caused by: org.postgresql.util.PSQLException at ConnectionFactoryImpl.java:303 Caused by: java.net.ConnectException at Net.java:-2
.
Yes, I’ve read the Database Setup Documentation.
The link to the build is: lukegjpotter/pokemon-team-building-tools/jobs/480144598.
Please Help.
The relevant lines in my travis.yml file is as follows:
language: java
os: linux
dist: focal
jdk: oraclejdk13
services:
- postgresql
before_script:
- cp config/database.yml.travis config/database.yml
- psql --version
- psql -c 'create database travis_ci_test;' -U postgres
env: DATABASE_URL=postgres://postgres:@localhost:5432/travis_ci_test
The relevant lines in my build output is as follows:
$ psql --version
psql (PostgreSQL) 12.5 (Ubuntu 12.5-0ubuntu0.20.04.1)
$ psql -c 'create database travis_ci_test;' -U postgres
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
The command "psql -c 'create database travis_ci_test;' -U postgres" failed and exited with 2 during .
Regards,
Luke