Building/testing multiple subdirs in a repository with sub-projects

docker
circle.yml

#1

Hello!

I have a project that is a coordinated set of docker containers, all organized in a single repository using docker-compose. The repository looks like so:

.
├── api
│ ├── Dockerfile-dev
│ ├── README.md
│ ├── dev
│ ├── profiles.clj
│ ├── project.clj
│ ├── resources
│ ├── src
│ ├── target
│ └── test
├── client
│ ├── Dockerfile-dev
│ ├── README.md
│ ├── build
│ ├── conf
│ ├── main.js
│ ├── node_modules
│ ├── package.json
│ ├── src
│ └── webpack.config.js
├── db
│ ├── Dockerfile-dev
│ └── README.md
├── docker-compose-dev.yml
├── engine
│ ├── Dockerfile-dev
│ ├── README.md
│ ├── dev
│ ├── profiles.clj
│ ├── project.clj
│ ├── resources
│ ├── src
│ ├── target
│ └── test

Notice how there are sub-components in their own respective subdirectories.

I would like to add CI to this system, so I’d like to be able to build/test each of these subdirs. Preferably, I’d like to run each of these in parallel and report all errors.

For instance, I would like to run tests for {client, api, engine}.

Is this possible to do in CircleCI? I looked at using build_dir, but it doesn’t look like can solve this issue.

Thanks for your help!


#2

I have pretty much the same requirement and would also like to know if that could be met.

Thank you


#3

Same here. Anyone have solution?


#4

I ended up doing the following:

– circle.yml

test:
  pre:
    - mkdir -p $CIRCLE_TEST_REPORTS/logs
  override:
    - docker-compose -f docker-compose-test.yml run api_test
    - docker-compose -f docker-compose-test.yml run engine_test
  post:
    - docker stop $(docker ps -a -q)
    - docker logs -f koi_api_test_run_1 > $CIRCLE_TEST_REPORTS/api.log
    - docker logs -f koi_engine_test_run_1 > $CIRCLE_TEST_REPORTS/engine.log

– docker-compose-test

services:
  api_test:
    build:
      context: api
      dockerfile: Dockerfile-test
  engine_test:
    build:
      context: engine
      dockerfile: Dockerfile-test

– Dockerfile-test in each subdir describes how to run tests


Multiple packages in a single repo
#5