.. _tutorial-getting-started: ============================= Getting started with Debusine ============================= In this tutorial you will discover two of Debusine's building blocks: :ref:`workflows ` and :ref:`artifacts `. Workflows let you schedule the execution of different kind of :ref:`tasks ` on remote workers, while artifacts represent a set of files managed by Debusine. For the purpose of this tutorial, we will use Debusine's command line interface to upload a source package, build it, and run various tests on it. Prerequisites ------------- You need to have access to a working Debusine instance: * If you are a Debian developer, you can use `debusine.debian.net `_. You can login there with your salsa.debian.org account, and it will automatically create your Debusine account. * Otherwise, please follow the instructions from :ref:`tutorial-install-debusine`. Once completed, the Debusine instance will be available under the ``debusine.internal`` hostname and this is the name that we will continue to use here. Install the client and configure it ----------------------------------- You should first install the ``debusine-client`` package (if needed configure APT with one of the :ref:`supported package repositories `): .. code-block:: console $ sudo apt install debusine-client Now it's time to create yourself a token that the client will use to connect to the server. With ``debusine-client`` version 0.10.0 or newer, you can run ``debusine setup`` and follow the prompts. With older versions, see :ref:`create-api-token`. More information about the Debusine command line interface is available in :ref:`debusine-cli`. Set up workflow templates ------------------------- If you're using a managed instance such as debusine.debian.net, you can skip this step. Otherwise, follow the instructions in :ref:`tutorial-set-up-workflow-templates` to prepare your Debusine instance for running workflows. Check workspace configuration ----------------------------- Debusine organizes most objects into :ref:`workspaces `, and you need to work within a workspace where you have at least the "contributor" role. If you're using your own instance, then the default workspace (``System``) is fine. Otherwise, you will need to add appropriate ``--workspace`` options to the commands below. For example, on debusine.debian.net, Debian developers may use ``--workspace developers`` (see https://wiki.debian.org/DebusineDebianNet for more details). Create an artifact by uploading a source package ------------------------------------------------ The low-level ``debusine create-artifact`` command can be used to create any arbitrary artifact, but when it comes to Debian source packages (``.dsc``) or Debian uploads (``.changes``), Debusine offers a more convenient interface with ``debusine import-debian-artifact [FILE|URL]``. You can refer to a local file or to a remote URL. For instance, on your client, you can create and upload an artifact for the "hello" source package with: .. code-block:: console $ debusine import-debian-artifact http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-3.dsc [...] message: New artifact created in http://debusine.internal/api in workspace System with id 536. artifact_id: 536 Or, if you're using debusine.debian.net: .. code-block:: console $ debusine import-debian-artifact --workspace developers \ http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-3.dsc Artifacts can be provided as input to many different Debusine workflows and tasks, using their artifact ID: take note of it. Create a workflow to build and test your package ------------------------------------------------ Creating a :ref:`workflow ` asks the Debusine server to do some work for you, possibly involving many smaller tasks. Debusine can run many different :ref:`workflows ` with many different underlying :ref:`tasks `. It is up to each workspace owner to define which workflows their workspace supports, using templates. You can find out what workflow templates are currently available by looking at the workspace in the web interface (e.g. ``http://debusine.internal/debusine/System/`` or https://debusine.debian.net/debian/developers/). Once you know what workflow template you want to use, you can start a workflow. The ``debusine create-workflow`` command takes key-value parameters for each workflow as YAML data on standard input. Try this on your client, taking care to refer to the ID of the artifact that we created in the previous step (``536`` for the source package in this example): .. code-block:: console $ debusine create-workflow debian-qa-unshare <