Skip to content
Snippets Groups Projects

ci/Hawkbit: add system type variables to improve data model

Open Kareem Zarka requested to merge kzarka/oniro:hawkbit-new-image into kirkstone
All threads resolved!
Files
2
@@ -342,9 +342,31 @@
CI_ONIRO_HAWKBIT_SWMOD_NAME: ""
CI_ONIRO_HAWKBIT_DS_NAME: ""
CI_ONIRO_RAUC_BUNDLE_NAME: ""
CI_ONIRO_HAKWBIT_SWMOD_TYPE_NAME: ""
CI_ONIRO_HAWKBIT_SWMOD_TYPE_KEY: ""
CI_ONIRO_HAWKBIT_DS_TYPE_NAME: ""
CI_ONIRO_HAWKBIT_DS_TYPE_KEY: ""
MACHINE: ""
script:
- set -e
- test -n "${CI_ONIRO_HAWKBIT_DS_TYPE_KEY:-}" || (
echo "precondition failed - CI_ONIRO_HAWKBIT_DS_TYPE_KEY is not set."
&& echo "It should be set to the key of the HawkBit distribution set
type"
&& exit 1 )
- test -n "${CI_ONIRO_HAWKBIT_DS_TYPE_NAME:-}" || (
echo "precondition failed - CI_ONIRO_HAWKBIT_DS_TYPE_NAME is not set."
&& echo "It should be set to the name of the HawkBit distribution set
type"
&& exit 1 )
- test -n "${CI_ONIRO_HAWKBIT_SWMOD_TYPE_KEY:-}" || (
echo "precondition failed - CI_ONIRO_HAWKBIT_SWMOD_TYPE_KEY is not set."
&& echo "It should be set to the key of the HawkBit software module type"
&& exit 1 )
- test -n "${CI_ONIRO_HAKWBIT_SWMOD_TYPE_NAME:-}" || (
echo "precondition failed - CI_ONIRO_HAKWBIT_SWMOD_TYPE_NAME is not set."
&& echo "It should be set to the name of the HawkBit software module type"
&& exit 1 )
- 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"
@@ -385,18 +407,62 @@
echo "Cannot compute BUNDLE_VERSION"
&& echo "BUNDLE_FILE=$BUNDLE_FILE"
&& exit 1 )
# TODO: create or find sw mod type for SysOTA + RAUC bundle
#
# Create HawkBit objects that represent the bundle, with the right
# meta-data to improve usability. This works as follows:
#
# +----------------+
# | Artifact |
# | |
# | |
# +-------+--------+
# |beongs to
# |
# +-------v--------+ +--------------------+
# | Software Module+---------->|Software Module Type|
# | | of type | |
# | - name | | - name |
# | - version | | - key |
# | | | |
# +------+---------+ +---------^----------+
# |belongs to |requires presence of
# | |
# +------v---------+ +---------+------------+
# |Distribution Set+---------->|Distribution Set Type |
# | | of type | |
# | - name | | - name |
# | - version | | - key |
# | | | |
# +------^---------+ +--------^-------------+
# |has assigned | requires usage of
# | |
# +------+---------+ +--------+-------------+
# | Target | | Target Type |
# | | | |
# | - name +---------->| - name |
# | - controller_id| of type | |
# | | | |
# +----------------+ +----------------------+
#
- hawkbitctl create software-module-type
-name "$CI_ONIRO_HAKWBIT_SWMOD_TYPE_NAME"
-key "$CI_ONIRO_HAWKBIT_SWMOD_TYPE_KEY"
-max-assignments 1
- hawkbitctl create software-module
-name "$CI_ONIRO_HAWKBIT_SWMOD_NAME"
-version "$BUNDLE_VERSION"
-type os
-type "$CI_ONIRO_HAWKBIT_SWMOD_TYPE_KEY"
-vendor "Onrio"
-description "Automatic build from Oniro CI"
# TODO: create or find ds type for MACHINE and OS
- hawkbitctl create distribution-set-type
-name "$CI_ONIRO_HAWKBIT_DS_TYPE_NAME"
-version "$BUNDLE_VERSION"
-type "$CI_ONIRO_HAWKBIT_DS_TYPE_KEY"
-mandatory-module-types "$CI_ONIRO_HAWKBIT_SWMOD_TYPE_KEY"
- hawkbitctl create distribution-set
-name "$CI_ONIRO_HAWKBIT_DS_NAME"
-version "$BUNDLE_VERSION"
-type os
-type "$CI_ONIRO_HAWKBIT_DS_TYPE_KEY"
-modules "$CI_ONIRO_HAWKBIT_SWMOD_NAME:$BUNDLE_VERSION"
-description "Automatic build from Oniro CI"
- hawkbitctl upload
Loading