From ed22e474bf79ebbb83ba7a1a033e940b3a1dafd2 Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Wed, 18 May 2022 13:54:56 +0200
Subject: [PATCH] docs: document hawkbit publishing job

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 .../publish-rauc-bundle-to-hawkbit.rst        | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 docs/ci/hidden-jobs/publish-rauc-bundle-to-hawkbit.rst

diff --git a/docs/ci/hidden-jobs/publish-rauc-bundle-to-hawkbit.rst b/docs/ci/hidden-jobs/publish-rauc-bundle-to-hawkbit.rst
new file mode 100644
index 00000000..bc4a7b32
--- /dev/null
+++ b/docs/ci/hidden-jobs/publish-rauc-bundle-to-hawkbit.rst
@@ -0,0 +1,36 @@
+.. SPDX-FileCopyrightText: Huawei Inc.
+..
+.. SPDX-License-Identifier: CC-BY-4.0
+
+===============================
+.publish-rauc-bundle-to-hawkbit
+===============================
+
+The `.publish-rauc-bundle-to-hawkbit` job uses `hawkbitctl` to publish a
+pre-build bundle to a HawkBit instance. The bundle is uploaded as an _artifact_
+to a new _software module_, which is then used to create a new _distribution
+set_.
+
+Usage Guide
+===========
+
+The `.publish-rauc-bundle-to-hawkbit` job should be paired with the
+:doc:`build-rauc-bundle-job` using the `needs: ...` keyword, so that the bundle
+file is transferred as an artifact between the two jobs, and no other artifacts
+are needlessly copied.
+
+The following variables should be set in the job definition:
+
+ - `CI_ONIRO_HAWKBIT_SWMOD_NAME` is the name of the software module to create.
+ - `CI_ONIRO_HAWKBIT_DS_NAME` is the name of the distribution set to create.
+ - `CI_ONIRO_RAUC_BUNDLE` is the name of the Yocto recipe responsible for the bundle.
+ - `MACHINE` is the Yocto machine variable.
+
+Note that the job relies on the presence of two artifact files: the bundle
+itself, which contains a timestamp-based version string, and the symbolic link
+pointing to it. The job that builds the bundle handles this automatically but
+custom jobs may need additional logic to preserve both files.
+
+The job will run automatically for tags, scheduled pipelines and for merge
+requests. Branch pipelines are excluded to avoid publishing extensive number of
+artifacts.
-- 
GitLab