Reputation: 85
I've seen a few resources that connect Jenkins and Docker, but none exactly like what I'm trying to do, which is to have Jenkins:
I'm lost on how to get code from GitHub into my Docker container when using Jenkins. I have the container that I use for local testing, but am trying to automate the process with Jenkins. Can anyone point me in the right direction?
Upvotes: 2
Views: 2233
Reputation: 9997
We do exactly that. We use the regular Jenkins Git plugin to fetch a copy of the source code. Then we run our docker container to run the tests...
# docker-compose.yml
web:
build: .
volumes:
- .:/src
command: /src/run-tests.sh
docker-compose run web
Mount a volume so that Jenkins can access any output from the tests, such as junit xml results.
Upvotes: 2