-
Notifications
You must be signed in to change notification settings - Fork 56
Replicating the TravisCI Environment on your Local Machine
At times it is helpful to replicate the TravisCI test environment on your local system. For instance, Proteus tests may pass locally but then fail when your branch is pushed to github. Alternatively, you may be facing test dependency issues that only seem to arise in the TravisCI environment. In either case, it is nice to be able to debug these issues on your local machine.
First you need to install Docker
which is a development tool that allows you to replicate other system environments locally. Explaining Docker
is beyond the scope of this article, but there are some excellent instructional videos describing Docker and how to install it. For example check out https://www.youtube.com/watch?v=UV3cw4QLJLs.
Now that Docker is installed, next you need to pull a Docker image that will replicate the TravisCI environment. There are many different Docker images for TravisCI and most of them will not serve your purpose. In my experience, your best bet is to pull the travisci-garnet
image which can be found at https://hub.docker.com/r/travisci/ci-garnet/ (you can also find this by searching on Dockerhub). It is important to note that this Docker repository does not have a latest
tag, so you will need to go to the tags
section and find most recently created image. At the time of this writing, the most recent image had the tag packer-1490989530
, so look for something like this.
Once you have the tag name, you can pull the Docker image with the command docker pull travisci-garnet:packer-1490989530
(or whatever you tag name is.)
Now that you have your Docker image, you will need to run the command docker run -it travisci/ci-garnet:packer-1490989530 /bin/bash
to build a container.
At this point, your Docker container should be running and open in a familiar bash shell.
Finally you need to pull and install Proteus. First find an appropriate directory (I like /home/travis/
) and then run git clone https://github.com/erdc-cm/proteus.git
.
To install Proteus in the container, you will want to follow the commands outlined in the hidden .travis.yml
file that lives in the main Proteus directory. I would recommend opening .travis.yml
somewhere that you can easily access it, then install gfortran
, libffi-dev
, libssl-dev
and python-lzma
and finally run the commands under the before_install
and install
headers verbatim.
Congratulations you now have a running Docker container that will mirror the TravisCI system running on github! You should be able to debug as you would normally and fix that pesky problem.
If you have any trouble with this please don't hesitate to post a comment (ping me at @alistairbntl) and I'll be happy to assist.