dongzhui4927 2019-04-12 10:25
浏览 245

gitlab ci redis作为依赖服务

I want to use Redis service as a dependency of my PHP/Nginx (Symfony application) application on GitlabCI and it should use the custom port. I already have Postgres added like this (I'll show just pieces of configurations):

variables:
    # POSTGRES - Use the values from the .env.test file.
    POSTGRES_DB: offers_test
    POSTGRES_USER: postgres
    POSTGRES_PASSWORD: asdfasdf

services:
    -   name: postgres:10
        # "postgresql" is what we use in the .env.test file
        alias: postgresql

here all is okay b-z Postgres image has a list of supported env variables and I can use them to configure Postgres connection.

But for Redis, I can't find any good image where I can configure a custom connection data. I only found official Gitlab documentation on how to use Redis service https://docs.gitlab.com/ee/ci/services/redis.html. So I add Redis to services

services:
    - redis:latest

And images built successfully, but on my tests, I'm getting the error like Error connecting to redis. Connection refused it's because CI connecting to Redis with default port, but I'm using a custom port. Any idea of how I can override connection details of Redis service?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题