Sloth CI¶
Sloth CI is a Python-based continuous integration and delivery tool that runs shell commands when you push to GitHub, Bitbucket, or GitLab. It may be building the docs, running tests, or deploying an app in a Docker container—you tell Sloth CI what to do.
Sloth CI offers detailed logs, build status badges, email notifications, and webhooks via extensions. Unlike Jenkins, Sloth CI does not have a web interface. Instead, you control it via command line or web API. Sloth CI is also much lighter than Jenkins in terms of memory usage.
Quickstart¶
Install Sloth CI with pip:
$ pip install sloth-ci $ pip install colorama # Optional, for colored logs outputSloth CI requires Python 3.4+ and works on Linux, Windows, and Mac OS X.
Create a file
sloth.yml(called server config) with the following content:host: localhost port: 8080 auth: login: myname password: mypass
Run
sci start:$ sci start & Starting Sloth CI on http://localhost:8080Go to http://localhost:8080?action=version in your browser and enter “myname” and “mypass” as login and password. You should see the Sloth CI version:
Now let’s create a simple app that will just append the current date and time to a particular file when triggered. Create a file
timestamper.yml(called app config):# Sloth CI app that appends the current timestamp # to a file when triggered. id: timestamper actions: - date >> timestamps.txt
Run
sci create timestamper.yml:$ sci create timestamper.yml App "timestamper" created App "timestamper" bound with config file "/path/to/timestamper.yml"
Trigger the app with
sci run timestamper:$ sci run timestamper Actions triggered on timestamper $ cat timestamps.txt Fri Feb 27 1:31:33 2016