How do I use redis-cli?


#1

How do I gain access to redis-cli? I am trying to disable redis persistence using the following command (which worked in 1.0): echo "CONFIG SET save ''" | redis-cli -x

I am using the container as follows:

My circle.yml starts off as follows:

version: 2.0
executorType: docker
containerInfo:
  - image: desiringgod/circle-ci:0.6
    env:
      - PGHOST=localhost
      - PGUSER=ubuntu
  - image: postgres:9.5.2
    env:
      - POSTGRES_USER=ubuntu
      - POSTGRES_DB=circle_test
  - image: redis:2.8.6

#2

Just install redis-tools with apt. Your command still works verbatim. By default, redis-cli connects via TCP. Here’s an example:

https://circleci.com/gh/ryanwohara/test-2.0/234

version: 2
jobs:
  build:
    docker:
      - image: ubuntu:14.04
      - image: redis:2.8.19
    working_directory: /project
    steps:
      - run: |
          apt-get update && apt-get install -y redis-tools
          echo "CONFIG SET save ''" | redis-cli -x

#3

I have the same issue, but with Postgres instead. when I use the ubuntu:14.04 docker image, I can no longer run npm install. why is that?


#4

Well node isn’t installed so you’d have to do that. I highly recommend building your own image.

https://circleci.com/docs/2.0/custom-images/


#5

So when question @rohara is, how does circleci know to run the apt-get update.... redis-cli -x command in the redis image and not the ubuntu image?


#6

It doesn’t. It’s not even running that from what I can tell.

Just go look up the Redis image source:

Everything is open source.


#7