Jenkiexs.Builds (jenkiexs v1.0.1) View Source

Link to this section Summary

Functions

Returns the details of a given build.

Returns the last job builded.

Returns the job URL based on a given Build.

Link to this section Types

Specs

job_name() :: binary()

Link to this section Functions

Specs

details(Jenkiexs.Builds.Build.t()) ::
  {:ok, Jenkiexs.Builds.Build.t()} | {:error, binary()}

Returns the details of a given build.

Uses Jenkins "/job/<job_name>/<build_number>/api/json endpoint.

Examples

iex> Jenkiexs.Builds.details(%Jenkiexs.Builds.Job{job_name: "example"}, %Jenkiexs.Builds.Build{number: 42})
{:ok, %Jenkiexs.Builds.Build{}}

iex> Jenkiexs.Builds.details(%Jenkiexs.Builds.Build{job_name: "example"}, 42)
{:ok, %Jenkiexs.Builds.Build{}}

iex> Jenkiexs.Builds.details("example", 42)
{:ok, %Jenkiexs.Builds.Build{}}
Link to this function

details(job, build_number)

View Source

Specs

details(Jenkiexs.Jobs.Job.t(), Jenkiexs.Builds.Build.t() | binary() | integer()) ::
  {:ok, Jenkiexs.Builds.Build.t()} | {:error, binary()}
details(job_name(), build_number :: binary() | integer()) ::
  {:ok, Jenkiexs.Builds.Build.t()} | {:error, binary()}

Specs

last(Jenkiexs.Jobs.Job.t() | job_name()) ::
  {:ok, Jenkiexs.Builds.Build.t()} | {:error, reason :: binary()}

Returns the last job builded.

Examples

iex> Jenkiexs.Builds.last(%Jenkiexs.Jobs.Job{name: "example"})
{:ok, %Jenkiexs.Builds.Build{job_name: "example", number: 42, building?: true}}

iex> Jenkiexs.Builds.last("example")
{:ok, %Jenkiexs.Builds.Build{job_name: "example", number: 42, building?: true}}

iex> Jenkiexs.Builds.last("another_example")
{:error, "reason"}

Specs

See Jenkiexs.Builds.Monitor.monitor/1.

Link to this function

new(job_name, jenkins_build)

View Source

Specs

Returns the job URL based on a given Build.

Examples

iex> Jenkiexs.Builds.url(%Jenkiexs.Builds.Build{job_name: "example", number: 42})
"http://localhost:8888/job/example/42"