1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
.. _tutorial-set-up-workflow-templates:
=========================
Set up workflow templates
=========================
The best way to ask Debusine to do some work for you is to create
:ref:`explanation-workflows`. In this tutorial, you will discover how to
set up workflow templates on your own instance.
Prerequisites
=============
This tutorial assumes that you installed :ref:`your own instance
<tutorial-install-debusine>` and that you have administrative access it via
:ref:`debusine-admin <debusine-admin-cli>`. You can skip this tutorial if
you're using a managed instance such as debusine.debian.net, since in those
cases suitable workflow templates have already been created for you.
If you haven't done so already, you'll need to make yourself an owner of the
default workspace in order to be allowed to create workflow templates in it.
.. code-block:: console
$ sudo debusine-admin group create debusine/Admins
$ sudo debusine-admin workspace grant_role debusine/System owner Admins
$ sudo debusine-admin group members debusine/Admins --add YOUR-USER-NAME
You will also need to :ref:`set up the Debusine client
<set-up-debusine-client>`.
Create a build environment
==========================
Various :ref:`worker tasks <explanation-tasks>` require build environments,
which are created using the :workflow:`update_environments` workflow.
Start by creating a :collection:`debian:environments` collection on your
server:
.. code-block:: console
$ sudo debusine-admin create_collection debian debian:environments </dev/null
Then, on your client, create a suitable workflow template and start it
running:
.. code-block:: console
$ debusine workflow-template create \
update_environments update-debian-environments <<END
static_parameters:
vendor: "debian"
targets:
- codenames: ["trixie"]
architectures: ["amd64"]
backends: ["unshare"]
mmdebstrap_template:
bootstrap_options:
variant: "minbase"
bootstrap_repositories:
- mirror: "http://deb.debian.org/debian"
components: ["main"]
- codenames: ["trixie"]
architectures: ["amd64"]
variants: ["sbuild"]
backends: ["unshare"]
mmdebstrap_template:
bootstrap_options:
variant: "buildd"
bootstrap_repositories:
- mirror: "http://deb.debian.org/debian"
components: ["main"]
END
$ debusine workflow start update-debian-environments <<END
{}
END
Once this workflow finishes (which will take a few minutes), you should have
a :collection:`debian:environments` collection populated with some useful
base tarballs for ``trixie/amd64`` that can be used with the ``unshare``
backend: a default variant containing only essential and required packages,
and an ``sbuild`` variant that also contains build-essential packages.
These can be :ref:`looked up by name <lookup-syntax>`. If you wish, you can
vary the ``targets`` dictionary to build different environments, or automate
this workflow to run regularly.
Set up the Debian pipeline
==========================
The :workflow:`debian_pipeline` workflow is a powerful tool that coordinates
all the steps typically involved in building and testing an upload to
Debian; it also has options to run tests on other packages that depend on
your package, and perform the upload for you at the end.
On your client, create a suitable workflow template:
.. code-block:: console
$ debusine workflow-template create \
debian_pipeline debian-qa-unshare <<END
static_parameters:
autopkgtest_backend: unshare
lintian_backend: unshare
piuparts_backend: unshare
sbuild_backend: unshare
upload_include_binaries: false
upload_merge_uploads: false
vendor: debian
codename: sid
runtime_parameters:
source_artifact: 'any'
codename: ['sid', 'forky']
autopkgtest_backend: ['unshare', 'incus-lxc', 'incus-vm']
lintian_backend: ['unshare', 'incus-lxc', 'incus-vm']
piuparts_backend: ['unshare', 'incus-lxc', 'incus-vm']
sbuild_backend: ['unshare', 'incus-lxc', 'incus-vm']
END
Any workflow parameters specified in ``runtime_parameters`` may be set
to any of the specified values when you create a workflow from the
template.
The special value ``'any'`` allows any value to be provided.
A global ``runtime_parameters: any`` allows all workflow parameters to
be specified at workflow creation time.
You will then be able to run this workflow for a given source artifact, as
shown in :ref:`tutorial-getting-started`.
|