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

Class BuildsLogic

source code


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_srpm_build_tasks(cls, status, background=None)
Returns srpm build tasks with given status.
source code
 
get_recent_tasks(cls, user=None, limit=None) source code
 
get_tasks_by_time(cls, start, end) source code
 
get_tasks_from_last_day(cls) source code
 
get_build_importing_queue(cls, background=None)
Returns Builds which are waiting to be uploaded to dist git
source code
 
get_pending_srpm_build_tasks(cls, background=None) source code
 
get_pending_build_tasks(cls, background=None) source code
 
get_build_task(cls, task_id) source code
 
get_srpm_build_task(cls, build_id) 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_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, url, chroot_names=None, **build_options)
:type user: models.User :type copr: models.Copr
source code
 
create_new_from_scm(cls, user, copr, scm_type, clone_url, committish='', subdirectory='', spec='', srpm_build_method='rpkg', 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_custom(cls, user, copr, script, script_chroot=None, script_builddeps=None, script_resultdir=None, chroot_names=None, **kwargs)
:type user: models.User :type copr: models.Copr :type script: str :type script_chroot: str :type script_builddeps: str :type script_resultdir: 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, batch=None, srpm_url=None, **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 :type batch: models.Batch :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, batch=None, srpm_url=None) source code
 
rebuild_package(cls, package, source_dict_update={}) source code
 
get_buildchroots_by_build_id_and_branch(cls, build_id, branch)
Returns a list of BuildChroots identified by build_id and dist-git branch name.
source code
 
delete_local_source(cls, build)
Deletes the locally stored data for build purposes.
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 = {StatusEnum("failed"), StatusEnum("succeeded...
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_srpm_build_tasks(cls, status, background=None)
Class Method

source code 

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

create_new_from_url(cls, user, copr, 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_scm(cls, user, copr, scm_type, clone_url, committish='', subdirectory='', spec='', srpm_build_method='rpkg', 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

delete_local_source(cls, build)
Class Method

source code 

Deletes the locally stored data for build purposes. This is typically uploaded srpm file, uploaded spec file or webhook POST content.

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


Class Variable Details [hide private]

terminal_states

Value:
{StatusEnum("failed"), StatusEnum("succeeded"), StatusEnum("canceled")\
}