I'm having a hard time getting my bitbucket-pipelines.yml to work. It keeps getting stuck on rake db:migrate with the error: PG::ConnectionBad: could not translate host name "db" to address: Name or service not known
I see the service running though, with no errors. I am at a loss why it's not working. Here is my configuration so far:
image: ruby:2.5clone: depth: fullpipelines: default: - step: script: - curl -sL https://deb.nodesource.com/setup_8.x | bash - - apt-get update - apt-get install nodejs -y - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.5.1 - export PATH=$HOME/.yarn/bin:$PATH - yarn - bundle install - rake db:migrate - rake db:test:prepare - rake test - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD services: - dbdefinitions: services: db: image: postgres environment: POSTGRES_DB: app_test
Ended up fixing this by making a pipeline specific database.yml file and overwriting the original in the pipeline. In the pipeline specific yml I have it look for postgres on localhost with port 5432.
I thought that the pipeline configuration would work like docker-compose but that is not the case apparently.
It looks like you're new here. Sign in or register to get started.