qwerty9967
qwerty9967

Reputation: 772

Get the name of the build container from service when using gitlab-ci

I am using network per build in gitlab runner. My build container can resolve the alias of the service, but I can't figure out how to get the ip address of the build container from the service container.

test_grservice:
  stage: test
  image: opencpi18:5000/testservice
  script:
    - python3 test.py
  services:
    - name: opencpi18:5000/grservice
      alias: grservice
  tags:
    - hw

Specifically I can do the following from the build container:

ping grservice

What would I type in the service container to ping the build container?

This link claims that I should be able to resolve the build job container name from the service, but I don't know what the build job container name is:

https://docs.gitlab.com/runner/executors/docker.html

Upvotes: 1

Views: 1121

Answers (1)

slauth
slauth

Reputation: 3178

Taken from the link you provided:

The build container is resolvable via the build alias as well as it’s GitLab assigned hostname.

Did you try that (i.e. ping build)?

Upvotes: 1

Related Questions