简体   繁体   中英

How use my docker-compose configuration with gitlab CI

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM