4
votes

I have a project on gitlab, and I would use gitlab CI for unit testing. Actually, I have a other repository name "docker" with docker-compose.yml and Dockerfile for two project (because i reproduce the production configuration, the two project are interdependant)

Actually in my dev configuration

in Projects directory:

  • docker
  • project_1
  • project_2

in docker directory:

  • docker-compose.yml
  • Dockerfile-project1
  • Dockerfile-project2
  • [some config file ask in dockerFile]

docker-compose.yml have relative path as ../project_1 and ../project_2

For set up my configuration, I make :

  • cd docker
  • docker-compose up -d project1 (name in docker-compose.yml)
  • docker exec -ti project1 bash

Question ? I want know how I can pull the git repository "docker" and launch docker-compose up for the project1 since gitlab CI start ?

Thanks

1

1 Answers

1
votes

We've built a gitlab runner with docker-compose support. See its README for setup and configuration.

Basically you just use the same commands like in development, see here for an example with Makefiles or this one with native docker-compose commands.