Hi @Progdrasil,
I am trying to get inter-service networking to work. However, even with setting the FF_NETWORK_PER_BUILD
variable, the service containers are not able to reach another service container.
Any ideas on what I might be doing wrong?
I am still getting this error when backend
tries to ensure database
is up and running:
2020-12-31T11:30:44.710149815Z Ncat: Could not resolve hostname "database": Name or service not known. QUITTING.`
Thank you for your time and help
Here’s the code in case it is easier than the link:
end-to-end-test:
<<: *base
image:
name: cypress/included:6.1.0
entrypoint: [""]
services:
- name: $DEVELOPMENT_CONTAINER_IMAGE
alias: frontend
command: ["scripts/start_app.sh"]
- name: $PRODUCTION_CONTAINER_IMAGE
alias: app
- name: registry.gitlab.com/porter4/backend/master:latest
alias: backend
command: ["scripts/start_app.sh"]
- name: postgres:13.0
alias: database
variables:
DATABASE_HOST: database
DATABASE_PORT: 5432
POSTGRES_DB: porter_pipeline
POSTGRES_USER: porter_app
POSTGRES_PASSWORD: password
GIT_STRATEGY: fetch
CYPRESS_baseUrl: http://frontend:8080/
FF_NETWORK_PER_BUILD: 1 # allow service containers to reach each other
# https://forum.gitlab.com/t/ci-cd-inter-service-networking/19903/5
before_script:
- cd /builds/porter4/frontend/
- ls -la
script:
- echo "production container specific testing is yet to come"
- scripts/install_dependencies.sh
- curl frontend:8080
- curl app:80
#- curl database:5432
#- curl backend:8000
- cypress run
after_script:
- cp -r tests/e2e/ /builds/porter4/frontend/.
artifacts:
paths:
- e2e/
when: always
allow_failure: true
timeout: 10 minutes