2

I have a ROS project for which I'm looking to use Jenkins to set up a CI system.

The project has a large number of dependencies which take a long time to build (they can't be installed on the build executor machines), so we typically build them once, then let Catkin (ROS's build system, based on CMake) use the cached artifacts on subsequent builds.

The Jenkins setup we currently have does this:

  • Clone repository at commit
  • Create an empty Catkin workspace
  • Clone and setup all our dependencies
  • Build everything together
  • Run tests

Due to building all our dependencies, this takes several hours.

What I'd like to do is this:

  • Clone repository at commit
  • Move it into an already built Catkin workspace containing all dependencies
  • Build just our project
  • Run tests

I was thinking of setting up a Docker container with all the dependencies ready to go, and then just running the build in that. Is that a typically recommended approach?

1 Answer 1

1

Using Docker with Jenkins in a situation like this is a great way to

  1. Keep Jenkins worker slave nodes clean (so you don't have to build or install anything on them)
  2. Have all dependencies and environment in an easily manageable artifact (in this case, a docker image is the snapshot of the exact OS, filesystem, env and dependencies)
  3. Vendor / keep copies of dependencies at a certain point in time (Example: You don't want to update at the same rate as the dependency)

If you have some kind of artifact management system (Example: Nexus) you can store your docker images in the artifact management system, and then pull them into Jenkins, and create a running container that has your repository in it. From there you can build project run tests inside the docker image. Just be sure you remember to move/copy all test results and built artifacts out of the docker container if you need them or use them later.

If you need more details or specifics please edit your question and I will edit my answer accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.