pmb.ci package

Module contents

pmb.ci.ask_which_scripts_to_run(scripts_available)

Display an interactive prompt about which of the scripts the user wishes to run, or all of them.

Parameters:

scripts_available – same format as get_ci_scripts()

Returns:

either full scripts_available (all selected), or a subset

pmb.ci.copy_git_repo_to_chroot(topdir)

Create a tarball of the git repo (including unstaged changes and new files) and extract it in chroot_native.

Parameters:

topdir – top directory of the git repository, get it with: pmb.helpers.git.get_topdir()

pmb.ci.get_ci_scripts(topdir)

Find ‘pmbootstrap ci’-compatible scripts inside a git repository, and parse their metadata (description, options). The reference is at: https://postmarketos.org/pmb-ci

Parameters:

topdir – top directory of the git repository, get it with: pmb.helpers.git.get_topdir()

Returns:

a dict of CI scripts found in the git repository, e.g. {“ruff”: {“description”: “lint all python scripts”, “options”: []}, …}

pmb.ci.run_scripts(topdir, scripts)

Run one of the given scripts after another, either natively or in a chroot. Display a progress message and stop on error (without printing a python stack trace).

Parameters:
  • topdir – top directory of the git repository, get it with: pmb.helpers.git.get_topdir()

  • scripts – return of get_ci_scripts()

pmb.ci.sort_scripts_by_speed(scripts)

Order the scripts, so fast scripts run before slow scripts. Whether a script is fast or not is determined by the ‘# Options: slow’ comment in the file.

Parameters:

scripts – return of get_ci_scripts()

Returns:

same format as get_ci_scripts(), but as ordered dict with fast scripts before slow scripts