Skip to content
Snippets Groups Projects
Commit c64eda36 authored by Chase Qi's avatar Chase Qi
Browse files

ci: support to use lower case and colon substrings in build job variable


Signed-off-by: default avatarChase Qi <chase.qi@linaro.org>
parent ccbe4066
No related branches found
No related tags found
No related merge requests found
......@@ -136,13 +136,20 @@
# dropped. Some extra sed processing is used to quote the variables.
# Everything runs in a sub-shell with bash pipefail disabled, as otherwise
# lack of variables matching the grep pattern causes the execution to stop.
# Variables in the form of 'CI_ONIRO_BB_LOCAL_CONF_attr' are converted to
# 'attr = "value"'. It can include '_colon_' substrings which are converted
# to ':'.
- |
( set +o pipefail;
env \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_[A-Z_0-9]+=' \
| sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_//g' -e 's/"/\\"/g' -e 's/=/ = "/g' -e 's/$/"/g' \
| grep -v "_plus_equals_" \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_[a-zA-Z_0-9]+=' \
| sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_//g' -e 's/_colon_/:/g' -e 's/"/\\"/g' -e 's/=/ = "/g' -e 's/$/"/g' \
| sort \
| tee -a conf/local.conf )
# Variables in the form of 'CI_ONIRO_BB_LOCAL_CONF_plus_equals_attr' are
# converted to 'attr += "value"'
- |
( set +o pipefail;
env \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_plus_equals_[A-Z_0-9]+=' \
......@@ -150,7 +157,6 @@
| sort \
| tee -a conf/local.conf )
# Sanity check: disallow using public build cache with a specific setting
# in local.conf. The list of settings may grow over time.
- |
......
......@@ -89,9 +89,11 @@ Configuring BitBake
The ``local.conf`` file can define numerous variables that influence the
BitBake build process. This job offers a declarative method of doing that. Job
variables with have the prefix ``CI_ONIRO_BB_LOCAL_CONF_`` are converted to
``attr = "value"`` and those with prefix
``CI_ONIRO_BB_LOCAL_CONF_plus_equals_`` are converted to ``attr += "value"``.
variables can be of two forms. ``CI_ONIRO_BB_LOCAL_CONF_attr`` and
``CI_ONIRO_BB_LOCAL_CONF_plus_equals_attr``. The former is converted to
``attr = "value"``. It can include ``_colon_`` substrings which are converted
to ``:``. And variables in the latter form are converted to
``attr += "value"``.
This method is friendly to job inheritance and re-definition. Derivative jobs
can add or re-define variables without having to duplicate any imperative logic
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment