Build

Just another Python API for Travis CI (API).

A module which provides the “Build” resource type.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Project link:
https://github.com/funilrys/PyTravisCI
Project documentation:
https://pytravisci.readthedocs.io/en/latest/

License

MIT License

Copyright (c) 2019, 2020, 2021, 2022 Nissar Chababy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
class PyTravisCI.resource_types.build.Build(**kwargs)[source]

Bases: PyTravisCI.resource_types.base.ResourceTypesBase

Provides the description of a build

Official Travis CI API documentation
Variables:
  • id (int) – Value uniquely identifying the build.
  • number (str) – Incremental number for a repository’s builds.
  • state (str) – Current state of the build.
  • duration (int) – Wall clock time in seconds.
  • event_type (str) – Event that triggered the build.
  • previous_state (str) – State of the previous build (useful to see if state changed).
  • pull_request_title (str) – Title of the build’s pull request.
  • pull_request_number (int) – Number of the build’s pull request.
  • started_at (datetime) – When the build started.
  • finished_at (datetime) – When the build finished.
  • private (bool) – Whether or not the build is private.
  • repository (Repository) – GitHub user or organization the build belongs to.
  • branch (Branch) – The branch the build is associated with.
  • tag (str) – The build’s tag.
  • commit (Commit) – The commit the build is associated with.
  • jobs (List[Job]) – List of jobs that are part of the build’s matrix.
  • stages (List[Stage]) – The stages of the build.
  • created_by – The User or Organization that created the build.
  • updated_at (datetime) – The last time the build was updated.
cancel() → PyTravisCI.resource_types.build.Build[source]

Cancels the current build.

Raises:BuildAlreadyStopped – When the current build was already canceled.
get_jobs(*, params: Optional[dict] = None) → PyTravisCI.resource_types.jobs.Jobs[source]

Provides the list of jobs of the current build

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
get_stages(*, params: Optional[dict] = None) → PyTravisCI.resource_types.stages.Stages[source]

Provides the list of stages of the current build

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.
is_active(*, sync: bool = False) → bool[source]

Checks if the build is active.

Parameters:sync – Authorizes the synchronization before checking.
is_canceled(*, sync: bool = False) → bool[source]

Checks if the build canceled.

Parameters:sync – Authorizes the synchronization before checking.
is_created(*, sync: bool = False) → bool[source]

Checks if the build is created.

Parameters:sync – Authorizes the synchronization before checking.
is_errored(*, sync: bool = False) → bool[source]

Checks if the build errored.

Parameters:sync – Authorizes the synchronization before checking.
is_failed(*, sync: bool = False) → bool[source]

Checks if the build failed.

Parameters:sync – Authorizes the synchronization before checking.
is_passed(*, sync: bool = False) → bool[source]

Checks if the build is passed.

Parameters:sync – Authorizes the synchronization before checking.
is_started(*, sync: bool = False) → bool[source]

Checks if the build is started.

Parameters:sync – Authorizes the synchronization before checking.
restart() → PyTravisCI.resource_types.build.Build[source]

Restarts the current build.

Raises:BuildAlreadyStarted – When the current build was already started.
sync() → PyTravisCI.resource_types.build.Build[source]

Fetches the latest information of the current job.