Pass env to secondary container

Hey,
I’m trying to test a python flask app with a neo4j database. For CI I’d love to just specify the neo4j image as a secondary container and then let everything run as usual. This does work pretty well:

version: 2
jobs:
  test:
    docker:
      - image: circleci/python:3.7
      - image: neo4j:3.5
    steps:
      - checkout
      - run: sudo pip install pipenv && pipenv install --dev
      - run: pipenv run coverage run --source=application -m mamba.cli specs
      - run: pipenv run coveralls

Problematic is that the neo4j image has Authentication enabled by default. To disable that I need to set the env variable NEO4J_AUTH=none. But I haven’t found a way to do that yet inside the config.yml.
I know that i could switch to machine mode and use everything manually but I’d prefer to avoid that since I’m already so close with docker mode.

I solved it with the environment key:

jobs:
  test:
    docker:
      - image: circleci/python:3.7
      - image: neo4j:3.5
        environment:
          NEO4J_AUTH: none

I read on multiple threads that it wouldn’t work with secondary containers but it does so just fine. So yay! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.