No description
| lib | ||
| test | ||
| .formatter.exs | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .mash.exs | ||
| LICENSE | ||
| mix.exs | ||
| mix.lock | ||
| README.md | ||
Mash is a dead simple tool for defining and running CI pipelines in Elixir.
Installation
Add mash to your dependencies like so:
def deps do
[
{:mash, "~> 0.1.0"}
]
end
Configuring pipelines
To configure your job pipeline, create a .mash.exs file at the root of your project containing a module which implements a jobs/0 function:
defmodule MashConfig do
import Mash.Helpers
def jobs do
[
%{
name: :test,
run: mix("test")
},
%{
name: :credo,
run: mix("credo", ["--all"])
},
]
end
end
Each entry in the jobs list must, at a minimum, have two keys:
:name-- the name of the job which must be a unique atom:run-- a function which defines the work for the job to do. We recommend using the helper functions from Mash.Helpers to define your run function, as they ensure that your function handles setup and teardown correctly for many common scenarios, e.g.:Mash.Helpers.mix(task_name, args)-- execute a mix task with the giventask_nameandargs.Mash.Helpers.shell(command, args)-- run an executable/script namedcommandwithargs.Mash.Helpers.fun(fn -> ... end)-- execute the Elixir function given. This function must return:okor{:ok, value}to indicate success, or return{:error, error}orraiseto indicate job failure.
Optionally, a job may also contain a key needs whose value is an array of other jobs that must pass before this job will be run.
Running
mix mash
Full Documentation
Full documentation is available on HexDocs.