Continuous integration Travis CI中的PostgreSQL 12连接错误
这是我的Travis YML文件:Continuous integration Travis CI中的PostgreSQL 12连接错误,continuous-integration,travis-ci,Continuous Integration,Travis Ci,这是我的Travis YML文件: language: php dist: focal services: - postgresql addons: postgresql: '12' apt: packages: - postgresql-12 - postgresql-client-12 cache: directories: - $HOME/.composer/cache/files matrix: fast_finish: tr
language: php
dist: focal
services:
- postgresql
addons:
postgresql: '12'
apt:
packages:
- postgresql-12
- postgresql-client-12
cache:
directories:
- $HOME/.composer/cache/files
matrix:
fast_finish: true
include:
- php: 7.4
env:
- SYMFONY_VERSION="5.*" DB=postgresql PGPORT=5432
before_install:
- composer self-update
install:
- composer install
- psql -c 'create database testbase;' -U postgres
- php ./bin/console doctrine:migrations:migrate --no-interaction
script:
- phpunit
在构建过程中,在这一行:
$ psql -c 'create database testbase;' -U postgres
我得到这个错误:
psql: error: could not connect to server: 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 testbase;' -U postgres" failed and exited with 2 during .
我还尝试了PostgreSQL 11和10的版本,但出现了相同的错误。当我将构建分发从focal切换到xenial时,构建和测试将通过。但是我们的生产服务器是焦点,所以这不可能是我们的解决方案。@RobertHarvey请阅读问题的第一行,它不是本地的,我也没有访问服务器的权限。Travis CI是托管的CI服务,有关更多信息,请参见此处。travis-ci.com