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
1 merge request!30flavours/zephyr/local.conf.sample: Bump CONF_VERSION
...@@ -136,13 +136,20 @@ ...@@ -136,13 +136,20 @@
# dropped. Some extra sed processing is used to quote the variables. # dropped. Some extra sed processing is used to quote the variables.
# Everything runs in a sub-shell with bash pipefail disabled, as otherwise # Everything runs in a sub-shell with bash pipefail disabled, as otherwise
# lack of variables matching the grep pattern causes the execution to stop. # 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; ( set +o pipefail;
env \ env \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_[A-Z_0-9]+=' \ | grep -v "_plus_equals_" \
| sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_//g' -e 's/"/\\"/g' -e 's/=/ = "/g' -e 's/$/"/g' \ | 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 \ | sort \
| tee -a conf/local.conf ) | 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; ( set +o pipefail;
env \ env \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_plus_equals_[A-Z_0-9]+=' \ | grep -E '^CI_ONIRO_BB_LOCAL_CONF_plus_equals_[A-Z_0-9]+=' \
...@@ -150,7 +157,6 @@ ...@@ -150,7 +157,6 @@
| sort \ | sort \
| tee -a conf/local.conf ) | tee -a conf/local.conf )
# Sanity check: disallow using public build cache with a specific setting # Sanity check: disallow using public build cache with a specific setting
# in local.conf. The list of settings may grow over time. # in local.conf. The list of settings may grow over time.
- | - |
......
...@@ -89,9 +89,11 @@ Configuring BitBake ...@@ -89,9 +89,11 @@ Configuring BitBake
The ``local.conf`` file can define numerous variables that influence the The ``local.conf`` file can define numerous variables that influence the
BitBake build process. This job offers a declarative method of doing that. Job 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 variables can be of two forms. ``CI_ONIRO_BB_LOCAL_CONF_attr`` and
``attr = "value"`` and those with prefix ``CI_ONIRO_BB_LOCAL_CONF_plus_equals_attr``. The former is converted to
``CI_ONIRO_BB_LOCAL_CONF_plus_equals_`` are converted to ``attr += "value"``. ``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 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 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