Password Auth example doesn't work.
I copy pasted the example below changing only the postgres version to 14 and adding stage: test.
test-job:
stage: test
services:
- postgres:14
variables:
# Configure postgres service (https://hub.docker.com/_/postgres/)
POSTGRES_DB: custom_db
POSTGRES_USER: custom_user
POSTGRES_PASSWORD: custom_pass
image: postgres
script:
# official way to provide password to psql: http://www.postgresql.org/docs/9.3/static/libpq-envars.html
- export PGPASSWORD=$POSTGRES_PASSWORD
- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT 'OK' AS status;"
The job fails with the error:
psql: error: connection to server at "postgres" (172.17.0.3), port 5432 failed: FATAL: password authentication failed for user "custom_user"