How are Gitlab CI service ports exposed?

半世苍凉 提交于 2019-12-05 16:16:14

问题


I have a .gitlab-ci.yml file:

integration_test:
  services:
    - name: registry.gitlab.com/group/project/testmailserver:1.1
      alias: "mail.email"
  stage: test
  script:
    - ./gradlew -g /cache/.gradle --stacktrace --info integrationTest

The service is a full stack email server based on this: tvial/docker-mailserver:latest. Locally with my docker-compose config I'm able to run it and connect to it.

version: '2'

services:
  mail:
    image: registry.gitlab.com/group/project/testmailserver:1.1
    hostname: mail
    domainname: localhost
    ports:
      - "25:25"
      - "143:143"
      - "587:587"
      - "993:993"
    environment:
      - ONE_DIR=1
      - DMS_DEBUG=0
      - MAIL_USER=invoicereader
      - MAIL_PASS=invoicereader
    cap_add:
      - NET_ADMIN

If I run it with docker-compose up and connect to it via IMAP on port 993 it works fine. Also the integration test runs smoothly

However, if the integration test is executed by gitlab CI, it fails. The only exception I could get is Connection refused.

Can it be that the ports of the service are not exposed properly? How does the CI server determine the ports it has to open to said service?

What might be the problem when running with CI? How can I test it differently?

Sorry for the lot of questions, I'm just hopelessly lost..

来源:https://stackoverflow.com/questions/45496356/how-are-gitlab-ci-service-ports-exposed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!