How to use Rabbit inside a gitlab-ci.yml file?

后端 未结 1 1230
执念已碎
执念已碎 2020-12-31 07:22

I want to test with gitlab-ci.yml a rpc nameko server.

I can\'t succeed to make work the Rabitt inside .gitlab-ci.yml::

ima         


        
1条回答
  •  一整个雨季
    2020-12-31 08:14

    I used it the following way and it worked for me

    image: "ruby:2.3.3" //not required by rabbitmq
    
    services:
      - rabbitmq:latest
    
    variables:
      RABBITMQ_DEFAULT_USER: guest
      RABBITMQ_DEFAULT_PASS: guest
      AMQP_URL: 'amqp://guest:guest@rabbitmq:5672'
    

    Now you can use the AMQP_URL env variable to connect to the rabbimq server. The general rule of thumb is any services declared will have the name (e.g. rabbitmq from rabbitmq:latest) as host or url or server. However in case you are running it in your own server or kubernetes cluster it will be localhost or 127.0.0.1. In my humble opinion that might be issue in your code. Hope it helps. :)

    0 讨论(0)
提交回复
热议问题