View Source FastCi.Utils (FastCi v0.1.1)

Summary

Functions

Acquire the current author for the git commit.

Get the current branch name. If the specific environment variables are not defined, it is taken from the current git branch name

Acquire the build_id variable needed to join the NodeSocket. It will try to match specific environment variables first and if none are found it matches with the short sha for the current git commit.

Acquire the current short commit ref from git.

Get the current commit message from git.

Functions

@spec author() :: {:ok, FastCi.Structs.Author.t()} | {:error, :no_author}

Acquire the current author for the git commit.

Examples

iex> FastCi.Utils.author()
%FastCi.Structs.Author{email: "luka@kolosek.com", name: "luka-kolosek"}
@spec branch_name() :: {:ok, bitstring()} | {:error, :no_branch_name}

Get the current branch name. If the specific environment variables are not defined, it is taken from the current git branch name

Examples

iex> FastCi.Utils.branch_name()
{:ok, "master"}
@spec build_id() :: {:ok, binary()} | {:error, :undefined_build_id}

Acquire the build_id variable needed to join the NodeSocket. It will try to match specific environment variables first and if none are found it matches with the short sha for the current git commit.

Examples

iex> FastCi.Utils.build_id()
{:ok, "71625dd"}
@spec commit() :: {:ok, binary()} | {:error, :no_commit}

Acquire the current short commit ref from git.

Examples

iex> FastCi.Utils.commit()
{:ok, "71625dd"}
@spec commit_message() :: {:ok, binary()} | {:error, :no_commit_message}

Get the current commit message from git.