Share network between jobs


#1

I created a the following workflow with 3 jobs:

workflows:
  version: 2
  build-and-test:
    jobs:
      - rails_server_1
      - rails_server_2
      - tests

For the jobs rails_server_X I’m running instances of the servers. Basically running rails server. That will run one instance at localhost:3000 and the other at localhost:3001

I’d like to use the third job tests to run some tests hitting the two running instances.
But when I try to find those instances running I’m not able to find them.

I guess jobs don’t share network. I read about workspaces to persist data. Is there any workaround sharing network as well?


#2

No, jobs from a single customer cannot contact each other, even if they are parallelised. I wonder though, if they are that dependent on each other, they should not be separate jobs.

You could Dockerise the servers and run those as secondary build containers. Or, you could launch these processes in the background of the primary build container.