Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/oniro-core/oniro
  • landgraf/oniro
  • zyga/oniro
  • mrybczyn/oniro
  • agherzan/oniro
  • pcoval/oniro
  • tony3oo3/oniro
  • stefanschmidt/oniro
  • waykovalenko/oniro
  • bero/oniro
  • esben/oniro
  • robertd/oniro
  • pidge/oniro
  • shettygururaj/oniro
  • thierrye/oniro
  • sradakovi/oniro
  • dricci783/oniro
  • ektor5/oniro
  • fldn/oniro
  • lucafavaretto/oniro
  • lucazizolfi/oniro
  • artemkondratiuk/oniro
  • lucaseri/oniro
  • gwozdzcfs/oniro
  • kristis/oniro
  • brgl/oniro
  • heurtemattes/oniro
  • idlethread/oniro
  • lquach/oniro
  • ghassaneben/oniro
  • heurtemattes/oniro-bitbake
  • kzarka/oniro
  • heurtemattes/oniro-migration
  • pastanki/oniro
  • malowe/oniro
  • chaseqi/oniro
  • mrfrank/oniro
37 results
Show changes
Commits on Source (6)
......@@ -93,6 +93,37 @@ bundle-raspberrypi4-64:
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-bundle-base
# Build a RAUC update bundle for SECO B68
bundle-seco-intel-b68:
extends: .build-rauc-bundle
stage: update
# Depend on the build job to prevent repeating build failures.
needs: [linux-seco-intel-b68]
variables:
MACHINE: seco-intel-b68
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-bundle-base
publish-raspberrypi4-64:
extends: .publish-rauc-bundle-to-hawkbit
dependencies: [bundle-raspberrypi4-64]
needs: [bundle-raspberrypi4-64]
variables:
CI_ONIRO_HAWKBIT_SWMOD_NAME: oniro-bundle-base-raspberrypi4-64
CI_ONIRO_HAWKBIT_DS_NAME: oniro-image-base-raspberrypi4-64
CI_ONIRO_RAUC_BUNDLE_NAME: oniro-bundle-base
MACHINE: raspberrypi4-64
publish-seco-intel-b68:
extends: .publish-rauc-bundle-to-hawkbit
dependencies: [bundle-seco-intel-b68]
needs: [bundle-seco-intel-b68]
variables:
CI_ONIRO_HAWKBIT_SWMOD_NAME: oniro-bundle-base-seco-intel-b68
CI_ONIRO_HAWKBIT_DS_NAME: oniro-image-base-seco-intel-b68
CI_ONIRO_RAUC_BUNDLE_NAME: oniro-bundle-base
MACHINE: seco-intel-b68
.build-wic-image-daily:
extends: .build-wic-image
variables:
......
......@@ -319,6 +319,88 @@
# Avoid pulling in any artifacts from the previous stage.
dependencies: []
.publish-rauc-bundle-to-hawkbit:
image: zyga/hawkbitctl:latest-ubuntu
# Use the deploy stage so that we only publish bundles to HawkBit if and only
# if all the bundles built in their stage completed successfully. This delays
# publishing to ensure that we have a consistent set and not some partial set
# when something failed to build.
stage: deploy
variables:
# Those variables have to be provided by specialized jobs.
CI_ONIRO_HAWKBIT_SWMOD_NAME: ""
CI_ONIRO_HAWKBIT_DS_NAME: ""
CI_ONIRO_RAUC_BUNDLE_NAME: ""
MACHINE: ""
script:
- set -e
- test -n "${CI_ONIRO_HAWKBIT_SWMOD_NAME:-}" || (
echo "precondition failed - CI_ONIRO_HAWKBIT_SWMOD_NAME is not set."
&& echo "It should be set to the name of the HawkBit software module"
&& exit 1 )
- test -n "${CI_ONIRO_HAWKBIT_DS_NAME:-}" || (
echo "precondition failed - CI_ONIRO_HAWKBIT_DS_NAME is not set."
&& echo "It should be set to the name of the HawkBit distribution set."
&& exit 1 )
- test -n "${CI_ONIRO_RAUC_BUNDLE_NAME:-}" || (
echo "precondition failed - CI_ONIRO_RAUC_BUNDLE_NAME is not set."
&& echo "It should be set to the name of the Yocto recipe constructing the RAUC bundle."
&& exit 1 )
- test -n "${MACHINE:-}" || (
echo "precondition failed - MACHINE is not set."
&& echo "It should be set to the name of the Yocto machine name."
&& exit 1 )
- test -n "${HAWKBIT_URL:-}" || (
echo "precondition failed - HAWKBIT_URL is not set."
&& exit 1 )
- test -n "${HAWKBIT_USERNAME:-}" || (
echo "precondition failed - HAWKBIT_USERNAME is not set."
&& exit 1 )
- test -n "${HAWKBIT_PASSWORD:-}" || (
echo "precondition failed - HAWKBIT_PASSWORD is not set."
&& echo "It should be set with a protected and masked variable."
&& exit 1 )
- test -L "${CI_PROJECT_DIR}/artifacts/images/${MACHINE}/${CI_ONIRO_RAUC_BUNDLE_NAME}-${MACHINE}.raucb" || (
echo "precondition failed - bundle file is either missing or is not a symbolic link."
&& find "${CI_PROJECT_DIR}/artifacts"
&& exit 1 )
- BUNDLE_FILE="$(readlink "${CI_PROJECT_DIR}/artifacts/images/${MACHINE}/${CI_ONIRO_RAUC_BUNDLE_NAME}-${MACHINE}.raucb")"
- test -n "$BUNDLE_FILE" || (
echo "Cannot compute BUNDLE_FILE"
&& ls -l "${CI_PROJECT_DIR}/artifacts/images/${MACHINE}/${CI_ONIRO_RAUC_BUNDLE_NAME}-${MACHINE}.raucb"
&& exit 1 )
- BUNDLE_VERSION="$(echo "$BUNDLE_FILE" | awk 'BEGIN { RS = "-" } /.*\.raucb/ { sub(".raucb", "", $NF); print $NF }')"
- test -n "$BUNDLE_VERSION" || (
echo "Cannot compute BUNDLE_VERSION"
&& echo "BUNDLE_FILE=$BUNDLE_FILE"
&& exit 1 )
# TODO: create or find sw mod type for SysOTA + RAUC bundle
- hawkbitctl create software-module
-name "$CI_ONIRO_HAWKBIT_SWMOD_NAME"
-version "$BUNDLE_VERSION"
-type os
-vendor "Onrio"
-description "Automatic build from Oniro CI"
# TODO: create or find ds type for MACHINE and OS
- hawkbitctl create distribution-set
-name "$CI_ONIRO_HAWKBIT_DS_NAME"
-version "$BUNDLE_VERSION"
-type os
-modules "$CI_ONIRO_HAWKBIT_SWMOD_NAME:$BUNDLE_VERSION"
-description "Automatic build from Oniro CI"
- hawkbitctl upload
-m "$CI_ONIRO_HAWKBIT_SWMOD_NAME:$BUNDLE_VERSION"
-a "${CI_PROJECT_DIR}/artifacts/images/${MACHINE}/$(readlink "${CI_PROJECT_DIR}/artifacts/images/${MACHINE}/${CI_ONIRO_RAUC_BUNDLE_NAME}-${MACHINE}.raucb")"
rules:
# Publishing is done only for scheduled builds
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# Run the job when a tag is placed.
- if: '$CI_COMMIT_TAG'
# For merge requests, the publishing is optional and can be triggered manually.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
allow_failure: true
.build-zephyr-image:
extends: .build-image
variables:
......
......@@ -29,3 +29,4 @@ implementation details.
lava-test
lava-report
aggregate-docs
publish-rauc-bundle-to-hawkbit
.. 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: ...` and `dependencies: ...`
keywords, 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.
......@@ -10,4 +10,4 @@ PACKAGECONFIG:remove:pn-mosquitto = "dlt"
# We use NetworkManager as the default network manager (included in our
# reference images).
PACKAGECONFIG:remove:pn-systemd = "networkd"
PACKAGECONFIG:remove:pn-systemd = "networkd wheel-group"