Jenkiexs.Jobs (jenkiexs v1.1.1) View Source

Link to this section Summary

Functions

Returns a list with all jobs.

Returns a list with all jobs.

Starts a job with the given parameters.

Starts a job and returns a task that monitor its execution.

Returns detailed information of a job.

Gets an output log of a specific build.

Gets an output log of a specific build.

Returns the job URL based on a given Job.

Link to this section Types

Specs

job_name() :: binary()

Link to this section Functions

Specs

all() :: {:ok, [Jenkiexs.Jobs.Job.t()]} | {:error, reason :: binary()}

Returns a list with all jobs.

Examples

iex> Jenkiexs.Jobs.all()
{:ok, [%Job{}, ...]}

iex> Jenkiexs.Jobs.all()
{:error, "reason"}

Specs

all!() :: [Jenkiexs.Jobs.Job.t()]

Returns a list with all jobs.

Examples

iex> Jenkiexs.Jobs.all!()
[%Job{}, ...]
Link to this function

build(job, params \\ [])

View Source

Specs

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

Starts a job with the given parameters.

Examples

iex> Jenkiexs.Jobs.build("my-job")
{:ok, %Build{}}

iex> Jenkiexs.Jobs.build("my-job", param1: "foo", param2: "bar")
{:ok, %Build{}}

iex> Jenkiexs.Jobs.build("my-job")
{:error, "reason"}
Link to this function

build!(job, params \\ [])

View Source

Specs

Starts a job.

Examples

iex> Jenkiexs.Jobs.build!("my-job")
%Build{}

iex> Jenkiexs.Jobs.build!("my-job", param1: "foo", param2: "bar")
%Build{}
Link to this function

build_monitored(job, params \\ [])

View Source

Specs

build_monitored(Jenkiexs.Jobs.Job.t() | job_name(), keyword()) ::
  {:ok, Task.t()} | {:error, reason :: binary()}

Starts a job and returns a task that monitor its execution.

Examples

iex> Jenkiexs.Jobs.build_monitored("my-job")
{:ok, %Task{} :: {:ok, %Build{}}}

iex> Jenkiexs.Jobs.build_monitored("my-job", param1: "foo", param2: "bar")
{:ok, %Task{} :: {:ok, %Build{}}}

iex> Jenkiexs.Jobs.build_monitored("my-job", param1: "foo", param2: "bar")
{:error, "reason"}

Specs

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

Returns detailed information of a job.

See Jenkiexs.Jobs.Job struct.

Specs

Link to this function

get_console_output(job, build_number \\ :last_build, output \\ :text)

View Source

Gets an output log of a specific build.

If build number is not provided, it will return the last build's output log.

You can get the output in text or HTML. Defaults to text.

Examples

iex> Jenkiexs.Jobs.get_console_output("my-job")
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output("my-job", 1234)
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output("my-job", 1234, :html)
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output("my-job", 1234, :text)
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output("my-job")
{:error, "reason"}
Link to this function

get_console_output!(job, build_number \\ :last_build, output \\ :text)

View Source

Gets an output log of a specific build.

If build number is not provided, it will return the last build's output log.

You can get the output in text or HTML. Defaults to text.

Examples

iex> Jenkiexs.Jobs.get_console_output!("my-job")
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output!("my-job", 1234)
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output!("my-job", 1234, :html)
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_output!("my-job", 1234, :text)
{:ok, "log"}
Link to this function

get_console_text(job, build_number \\ :last_build)

View Source

Gets an output log of a specific build.

If build number is not provided, it will return the last build's output log.

Examples

iex> Jenkiexs.Jobs.get_console_text("my-job")
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_text("my-job", 1234)
{:ok, "log"}

iex> Jenkiexs.Jobs.get_console_text("my-job")
{:error, "reason"}
Link to this function

get_console_text!(job, build_number \\ :last_build)

View Source

Gets an output log of a specific build.

If build number is not provided, it will return the last build's output log.

Examples

iex> Jenkiexs.Jobs.get_console_text!("my-job")
"log"

iex> Jenkiexs.Jobs.get_console_text!("my-job", 1234)
"log"

Specs

Returns the job URL based on a given Job.

Examples

iex> Jenkiexs.Jobs.url(%Jenkiexs.Jobs.Job{name: "example"})
"http://localhost:8888/job/example"

iex> Jenkiexs.Jobs.url("example")
"http://localhost:8888/job/example"