Skip to content
Snippets Groups Projects

.gitlab-ci.yml: share rules among build, bundle, publish jobs

Merged Zygmunt Krynicki requested to merge zyga/oniro:fix/tricky-build-rules into kirkstone
1 file
+ 35
7
Compare changes
  • Side-by-side
  • Inline
+ 35
7
@@ -46,13 +46,17 @@ aggregate-docs:
@@ -46,13 +46,17 @@ aggregate-docs:
variables:
variables:
CI_ONIRO_GIT_REPO_PATH: oniro
CI_ONIRO_GIT_REPO_PATH: oniro
# Customize the .bitbake-workspace job to set the rules governing when a build
# Anchor job rules, which govern if a job is instantiated in a given pipeline.
# is attempted to: modifications (changes) to the pipeline, meta-layers,
# This job is then used as another base to several different jobs, including
# flavours and assets OR to placement of a tag on a commit OR when a job is
# .bitbake-workspace, .build-rauc-bundle and the
# scheduled. In addition, draft merge requests will no longer start the heavy
# .publish-rauc-bundle-to-hawkbit jobs.
# build jobs automatically, giving an option to the developer, to start the
#
# desired jobs manually.
# The rules are: modifications (changes) to the pipeline, meta-layers, flavours
.bitbake-workspace:
# and assets OR to placement of a tag on a commit OR when a job is scheduled.
 
# In addition, draft merge requests will no longer start the heavy build jobs
 
# automatically, giving an option to the developer, to start the desired jobs
 
# manually.
 
.workspace-rules:
rules:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
variables:
variables:
@@ -82,6 +86,30 @@ aggregate-docs:
@@ -82,6 +86,30 @@ aggregate-docs:
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_TAG'
# XXX: This needs CI_ONIRO_MANIFEST_BRANCH as well, most likely.
# XXX: This needs CI_ONIRO_MANIFEST_BRANCH as well, most likely.
 
 
# The three jobs defined below override the definitions from build-generic.yaml
 
# to inject .workspace-rules and the rules defined therein. It is important to
 
# understand that this is based on several separate systems: parsing and
 
# loading yaml, processing the include rules, and processing extends rules.
 
#
 
# This specific trick (ab)uses the fact that yaml-top-level is one big map of
 
# entities, and we can define an entity multiple times to effectively extend or
 
# replace specific elements.
 
#
 
# The following three jobs are equivalent to copy-pasting the modified extends
 
# line into the jobs in .oniro-ci/build-generic.yaml, because map/dictionary
 
# entries compute the union of the defined keys, unlike list entries or scalars
 
# that replace the previous value.
 
 
.bitbake-workspace:
 
extends: [.workspace, .workspace-rules]
 
 
.build-rauc-bundle:
 
extends: [.build-image, .workspace-rules]
 
 
.publish-rauc-bundle-to-hawkbit:
 
extends: [.workspace-rules]
 
# Build a RAUC update bundle for Raspberry Pi 4
# Build a RAUC update bundle for Raspberry Pi 4
bundle-raspberrypi4-64:
bundle-raspberrypi4-64:
extends: .build-rauc-bundle
extends: .build-rauc-bundle
Loading