Provide a new build mode for containers

Providing a new build target --containers.

Container build targets typically need network access to
build, and do not need to be built as part of a regular build.

Container build targets are defined by: centos_pkg_dirs_containers
Container build targets can utilize the std and rt repos for
their build requirements.
Container target enables the mock flag: rpmbuild_networking

This also includes a fix where build-pkgs --installer in parallel
mode was building in serial mode instead.

Story: 2003909
Task: 27632
Change-Id: I3727a15fbdadc345a104c2af3446aee845171309
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey
2018-11-08 08:19:41 -06:00
parent 1615f28109
commit aa15df5887
8 changed files with 118 additions and 23 deletions

View File

@@ -95,9 +95,15 @@ fi
grep -q "config_opts\['chroot_setup_cmd'\] = 'install @buildsys-build pigz lbzip2 yum'" $FILE || \
echo "config_opts['chroot_setup_cmd'] = 'install @buildsys-build pigz lbzip2 yum'" >> $FILE
# Special case for containers.
# rpmbuild_networking is required for invoking helm commands within mock
grep -q "config_opts\['rpmbuild_networking'\] = True" $FILE || \
# building containers requires the std repo to be enabled.
if [ "containers" == "$BUILD_TYPE" ]; then
grep -q "config_opts\['rpmbuild_networking'\] = True" $FILE || \
echo "config_opts['rpmbuild_networking'] = True" >> $FILE
sed -i "/^\[local-std\]/,/^\[/ s/enabled=0/enabled=1/" $FILE
fi
#
# Read macros from tis.macros to add to the build config file,
# for use in RPM spec files