Package coprs :: Package logic :: Module builds_logic :: Class BuildsLogic
[hide private]
[frames] | no frames]

Class BuildsLogic

source code


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
get(cls, build_id) source code
 
get_build_tasks(cls, status, background=None)
Returns tasks with given status.
source code
 
get_recent_tasks(cls, user=None, limit=None) source code
 
get_build_importing_queue(cls)
Returns BuildChroots which are waiting to be uploaded to dist git
source code
 
get_build_task_queue(cls, is_background=False)
Returns BuildChroots which are - waiting to be built or
source code
 
get_build_task(cls) source code
 
get_multiple(cls) source code
 
get_multiple_by_copr(cls, copr)
Get collection of builds in copr sorted by build_id descending
source code
 
get_multiple_by_user(cls, user)
Get collection of builds in copr sorted by build_id descending form the copr belonging to `user`
source code
 
init_db(cls) source code
 
get_copr_builds_list(cls, copr) source code
 
join_group(cls, query) source code
 
get_multiple_by_name(cls, username, coprname) source code
 
get_importing(cls)
Return builds that are waiting for dist git to import the sources.
source code
 
get_waiting(cls)
Return builds that aren't both started and finished (if build start submission fails, we still want to mark the build as non-waiting, if it ended) this has very different goal then get_multiple, so implement it alone
source code
 
get_by_ids(cls, ids) source code
 
get_by_id(cls, build_id) source code
 
create_new_from_other_build(cls, user, copr, source_build, chroot_names=None, **build_options) source code
 
create_new_from_url(cls, user, copr, srpm_url, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr
source code
 
create_new_from_tito(cls, user, copr, git_url, git_dir, git_branch, tito_test, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr
source code
 
create_new_from_mock(cls, user, copr, scm_type, scm_url, scm_branch, spec, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr
source code
 
create_new_from_pypi(cls, user, copr, pypi_package_name, pypi_package_version, python_versions, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr :type package_name: str :type version: str :type python_versions: List[str]
source code
 
create_new_from_rubygems(cls, user, copr, gem_name, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr :type gem_name: str :type chroot_names: List[str] :rtype: models.Build
source code
 
create_new_from_distgit(cls, user, copr, clone_url, branch, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr :type clone_url: str :type branch: str :type chroot_names: List[str] :rtype: models.Build
source code
 
create_new_from_upload(cls, user, copr, f_uploader, orig_filename, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr :param f_uploader(file_path): function which stores data at the given `file_path` :return:
source code
 
create_new(cls, user, copr, source_type, source_json, chroot_names=None, pkgs='', git_hashes=None, skip_import=False, background=False, **build_options)
:type user: models.User :type copr: models.Copr :type chroot_names: List[str] :type source_type: int value from helpers.BuildSourceEnum :type source_json: str in json format :type pkgs: str :type git_hashes: dict :type skip_import: bool :type background: bool :rtype: models.Build
source code
 
add(cls, user, pkgs, copr, source_type=None, source_json=None, repos=None, chroots=None, timeout=None, enable_net=True, git_hashes=None, skip_import=False, background=False) source code
 
rebuild_package(cls, package) source code
 
get_chroots_from_dist_git_task_id(cls, task_id)
Returns a list of BuildChroots identified with task_id task_id consists of a name of git branch + build id Example: 42-f22 -> build id 42, chroots fedora-22-*
source code
 
delete_local_srpm(cls, build)
Deletes the source rpm locally stored for upload (if exists)
source code
 
update_state_from_dict(cls, build, upd_dict)
:param build:...
source code
 
cancel_build(cls, user, build) source code
 
delete_build(cls, user, build, send_delete_action=True)
:type user: models.User :type build: models.Build
source code
 
mark_as_failed(cls, build_id)
Marks build as failed on all its non-finished chroots
source code
 
last_modified(cls, copr)
Get build datetime (as epoch) of last successful build
source code
 
filter_is_finished(cls, query, is_finished) source code
 
filter_by_group_name(cls, query, group_name) source code
Class Variables [hide private]
  terminal_states = set([0, 1, 2])
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

get_build_tasks(cls, status, background=None)
Class Method

source code 

Returns tasks with given status. If background is specified then returns normal jobs (false) or background jobs (true)

get_build_task_queue(cls, is_background=False)
Class Method

source code 

Returns BuildChroots which are - waiting to be built or

  • older than 2 hours and unfinished

create_new_from_url(cls, user, copr, srpm_url, chroot_names=None, **build_options)
Class Method

source code 

:type user: models.User :type copr: models.Copr

:type chroot_names: List[str]

:rtype: models.Build

create_new_from_tito(cls, user, copr, git_url, git_dir, git_branch, tito_test, chroot_names=None, **build_options)
Class Method

source code 

:type user: models.User :type copr: models.Copr

:type chroot_names: List[str]

:rtype: models.Build

create_new_from_mock(cls, user, copr, scm_type, scm_url, scm_branch, spec, chroot_names=None, **build_options)
Class Method

source code 

:type user: models.User :type copr: models.Copr

:type chroot_names: List[str]

:rtype: models.Build

create_new_from_pypi(cls, user, copr, pypi_package_name, pypi_package_version, python_versions, chroot_names=None, **build_options)
Class Method

source code 

:type user: models.User :type copr: models.Copr :type package_name: str :type version: str :type python_versions: List[str]

:type chroot_names: List[str]

:rtype: models.Build

update_state_from_dict(cls, build, upd_dict)
Class Method

source code 

:param build:
:param upd_dict:
    example:
    {
      "builds":[
       {
         "id": 1,
         "copr_id": 2,
         "started_on": 139086644000
       },
       {
         "id": 2,
         "copr_id": 1,
         "status": 0,
         "chroot": "fedora-18-x86_64",
         "results": "http://server/results/foo/bar/",
         "ended_on": 139086644000
       }]
    }

last_modified(cls, copr)
Class Method

source code 

Get build datetime (as epoch) of last successful build

:arg copr: object of copr