Loci

Testing remote CI scripts locally



Loci: Testing remote CI scripts locally

MIT License Build Status Code Climate Release Japanese

Loci runs CI tests locally to make sure your commits will pass such tests before pushing to a remote repository.

Loci currently supports Travis’s CI scripts for Python and Go projects. Loci also requires Docker to run tests in a sandbox.

Usage

If your current directory has .travis.yml, run just loci.

Here is the help text of the loci command:

loci [global options] [script file]

  If script file isn't given, .travis.yml will be used.

GLOBAL OPTIONS:
   --name NAME, -n NAME  creating a container named NAME to run tests,
                         and that container will not be deleted.
   --tag TAG, -t TAG     creating an image named TAG.
   --base TAG, -b TAG    use image TAG as the base image.
                         (default: "ubuntu:latest")
   --verbose             verbose mode, which prints Dockerfile and
                         entrypoint.sh.
   --apt-proxy URL       URL for a proxy server of apt repository.
                         [$APT_PROXY]
   --pypi-proxy URL      URL for a proxy server of pypi repository.
                         [$PYPI_PROXY]
   --http-proxy URL      URL for a http proxy server. [$HTTP_PROXY]
   --https-proxy URL     URL for a https proxy server. [$HTTPS_PROXY]
   --no-proxy LIST       Comma separated URL LIST for which proxies won't
                         be used. [$NO_PROXY]
   --no-build-cache      Do not use cache when building the image.
   --no-color            Omit to print color codes.
   --help, -h            show help
   --version, -v         print the version

Note that $XYZ means that environment variable $XYZ will be used if the associated option value isn’t given.

Loci builds docker images every time to run tests in a sandbox. The default image name will be the repository name of the project with prefix loci/, you can specify another name with --tag or -t flag.

Loci creates a container to run a set of tests, and then deletes it after the test set ends. If you want to keep the container, give a container name with --name or -n flag.

Requirements

Loci works with docker.

docker logo

If your environment doesn’t have docker, install it first.

Installation

$ go get github.com/jkawamoto/loci

or if you’re a Homebrew user,

$ brew tap jkawamoto/loci
$ brew install loci

Compiled binaries are also available in Github.

License

This software is released under the MIT License, see LICENSE.