Simple Elixir wrapper for the Travis API
Elixir
Switch branches/tags
Nothing to show
Clone or download
kddeisz Merge pull request #1 from localytics/fixing-travis
Attempting to fix the travis env vars
Latest commit e69e86b Jan 5, 2017
Permalink
Failed to load latest commit information.
lib
test
.gitignore Add hex badge to README Jan 5, 2017
.travis.yml
LICENSE
README.md
mix.exs

README.md

travis.ex

Build Status Hex.pm

Simple Elixir wrapper for the Travis API.

Quickstart

First, add travis to your mix.exs dependencies:

def deps do
  [{:travis, "~> 0.0.1"}]
end

Ensure that travis is added as an application in your mix.exs:

def application do
  [applications: [:travis]]
end

Fetching dependencies and running on elixir console:

mix deps.get
iex -S mix

Examples

Every call to Travis needs a client. It can optionally have a travis token associated with it, which is necessary for private repositories. If you don't provide one a client is created. Below are some examples:

Describe a public repo

iex> Travis.Repos.show("elixir-lang", "elixir")
%{"repo" => %{...}}

Describe a private repo

iex> client = Travis.Client.new(token)
%Travis.Client{endpoint: "https://api.travis-ci.com/",
 token: "..."}

iex> Travis.Repos.show("localytics", "travis.ex", client)
%{"repo" => %{...}}

List builds for a repo

iex> Travis.Repos.Builds.list("elixir-lang", "elixir")
%{"builds" => [...]}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/localytics/travis.ex.