Skip to content

Commit

Permalink
engine: add PACKAGER_INSTALLER_EXTRA_FLAGS
Browse files Browse the repository at this point in the history
useful to pass additional arguments to dnf/apt when installing
packages in nested containers

Signed-off-by: Douglas Landgraf <[email protected]>
  • Loading branch information
dougsland committed Jun 29, 2024
1 parent c08ae7d commit c82f704
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions constants
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,25 @@ FEATURE_DISABLED=false
###############################################################################

###############################################################################
# Description:
# Define packager installer extra flags
#PACKAGER_INSTALLER_EXTRA_FLAGS=""
###############################################################################

###############################################################################
# Description
# Define Image Name
#IMAGE_NAME="alpine"
#IMAGE_NAME="quay.io/centos-sig-automotive/automotive-osbuild"
#IMAGE_COMMAND="sleep 3600"
###############################################################################


###############################################################################
# Description
# Number of containers to trigger. Default 10
# NUMBER_OF_CONTAINERS=5
###############################################################################

###############################################################################
# Description
Expand Down Expand Up @@ -264,6 +275,10 @@ if [ -z "${PACKAGER_INSTALLER+x}" ]; then
PACKAGER_INSTALLER="dnf"
fi

if [ -z "${PACKAGER_INSTALLER_EXTRA_FLAGS+x}" ]; then
PACKAGER_INSTALLER_EXTRA_FLAGS=""
fi

if [ -z "${VOLUME_PATH+x}" ]; then
VOLUME_PATH="/data"
fi
Expand Down
2 changes: 1 addition & 1 deletion engine
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ install_packages() {
echo -e "INFO: Installing packages in container ${container_name} - packages ${EXTRA_PACKAGES_TO_INSTALL}..."
fi

if ! sudo podman exec "${container_name}" "${PACKAGER_INSTALLER}" install -y -q ${EXTRA_PACKAGES_TO_INSTALL}; then
if ! sudo podman exec "${container_name}" "${PACKAGER_INSTALLER}" "${PACKAGER_INSTALLER_EXTRA_FLAGS}" install -y -q ${EXTRA_PACKAGES_TO_INSTALL}; then
if [[ "$VERBOSE" = "${FEATURE_ENABLED}" ]]; then
echo -e "FAIL: container ${container_name} fail to install package(s) ${EXTRA_PACKAGES_TO_INSTALL}"
return 1
Expand Down

0 comments on commit c82f704

Please sign in to comment.