View Source Mash.Helpers (mash v0.3.1)

Helpers that provide a simple way to write Mash configs.

Summary

Functions

Create a run function for a job that executes a mix task with name task_name and the arguments args.

Restore a cache file.

Save a cache file as a gzipped tar archive. We use tar because it preserves timestamps which are used by Elixir for determining "staleness" of compilation.

Create a run function which executes the script/binary named command with the arguments args.

Functions

Link to this function

mix(task_name, args \\ [], opts \\ [])

View Source
@spec mix(String.t(), [String.t()], Keyword.t()) :: function()

Create a run function for a job that executes a mix task with name task_name and the arguments args.

Available opts:

  • :env -- a list of {key, value} pairs that will be used as environment variables.
Link to this function

restore_cache(name \\ ".mash-cache")

View Source
@spec restore_cache(String.t()) :: function()

Restore a cache file.

  • name is the base name of the archive to save (default: ".mash-cache")
Link to this function

save_cache(name \\ ".mash-cache", files \\ ["deps", "_build"])

View Source
@spec save_cache(String.t(), [String.t()]) :: function()

Save a cache file as a gzipped tar archive. We use tar because it preserves timestamps which are used by Elixir for determining "staleness" of compilation.

  • name is the base name of the archive to save (default: ".mash-cache")
  • files is the list of files/directories to save in the archive (default:["deps", "_build"])
Link to this function

shell(command, args \\ [], opts \\ [])

View Source
@spec shell(String.t(), [String.t()], Keyword.t()) :: function()

Create a run function which executes the script/binary named command with the arguments args.

Available opts:

  • :env -- a list of {key, value} pairs that will be used as environment variables.