~jugmac00/lpci:add-more-hooks

Last commit made on 2021-12-17
Get this branch:
git clone -b add-more-hooks https://git.launchpad.net/~jugmac00/lpci
Only Jürgen Gmach can upload to this branch. If you are Jürgen Gmach please log in for upload directions.

Branch merges

Branch information

Name:
add-more-hooks
Repository:
lp:~jugmac00/lpci

Recent commits

f16ec90... by Jürgen Gmach

Generalize test outcome

f7024ff... by Jürgen Gmach

`run` command from configuration file takes precedence

Please note: when both a plugin and the configuration file are
providing a `run` command, the one from the configuration file will be
used

Previously, defining the `run` command twice errored.

abeecae... by Jürgen Gmach

Add todo comment

73986b7... by Jürgen Gmach

Add hook for environment variables

Please note: when there is the same environment variable provided by
the plugin and the configuration file, the one in the configuration
file will be taken into account.

f9ed3ad... by Jürgen Gmach

Add hook for the run command

Please note that it is not allowed to have more than one run command
specified, e.g. from configuration and from a plugin.

d5994ff... by Jürgen Gmach

Add hook for the snaps to be installed

dfd240b... by Jürgen Gmach

Introduce pluggy to manage plugins

pluggy ( https://pluggy.readthedocs.io/en/stable/ ) let's you define
hooks which then plugins can implement.

Example:
Using the new hook `lpcraft_install_packages` one can add additional
system packages to be installed with `apt`.

Please refer to the documentation on how to create your own plugin.

0e98f96... by Colin Watson

Note that run-one is subject to change

83c29b8... by Colin Watson

Simplify assertion

8825d44... by Colin Watson

Add a "run-one" command

We need a way to run only a single job from a pipeline, both because we
want an easy way to record log output for separate jobs separately, and
because we want to be able to retry individual jobs.

Matrix expansion makes this somewhat complicated, because as a result
there can be multiple expanded job definitions with the same name that
differ only in (for example) series or environment. The simplest
approach I can think of turns out to be to just take an index as well as
the job name; this is safe since matrix expansion has a stable order,
and in Launchpad the dispatcher end is going to need to do its own
matrix expansion anyway.

I went for a separate "run-one" command rather than options to "run"
since the command-line syntax is sufficiently different that it makes
sense to validate it separately.