diff --git a/assets/hydrate.sh b/assets/hydrate.sh index 329ccb4..9e60fe0 100755 --- a/assets/hydrate.sh +++ b/assets/hydrate.sh @@ -68,7 +68,7 @@ sudo php -f "${PS_FOLDER}/install/index_cli.php" -- \ --newsletter=0 \ --send_email=0 \ --ssl=0 \ - "$([ "$INSTALL_MODULES" == "true" ] && echo "--modules=$(find "$PS_FOLDER"/modules/* -maxdepth 0 -type d -exec basename {} \; | paste -s -d ',')" || echo "" )" + "$([ "$PRE_INSTALLED_MODULES" == "true" ] && echo "--modules=$(find "$PS_FOLDER"/modules/* -maxdepth 0 -type d -exec basename {} \; | paste -s -d ',')" || echo "" )" echo "✅ PrestaShop installed" # 7. Swap off dev mode diff --git a/build.sh b/build.sh index 8bd2ee0..f017bf7 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ declare PLATFORM; # -- alias for $TARGET_PLATFORM declare TARGET_IMAGE; # -- docker image name, defaults to "prestashop/prestashop-flashlight" declare PUSH; # -- set it to "true" if you want to push the resulting image declare ZIP_SOURCE; # -- the zip to unpack in flashlight -declare INSTALL_MODULES; # -- install modules during zip installation +declare PRE_INSTALLED_MODULES; # -- install modules during zip installation declare DRY_RUN; # -- if used, won't really build the image. Useful to check tags compliance declare CUSTOM_LABELS; # -- only when PRIVATE : list of key=value pairs separated by a comma, for overriding official flashlight labels @@ -192,14 +192,15 @@ if [ -n "${DRY_RUN}" ]; then } fi -labelString= +COMPUTED_LABELS=() for key in "${!IMAGE_LABELS[@]}" do - labelString=$labelString' --label '$key'="'${IMAGE_LABELS[$key]}'"' + COMPUTED_LABELS+=("--label") + COMPUTED_LABELS+=("$key=\"${IMAGE_LABELS[$key]}\"") done docker pull "$CACHE_IMAGE" 2> /dev/null || true -eval docker buildx build \ +docker buildx build \ --progress=plain \ --file "./docker/${OS_FLAVOUR}.Dockerfile" \ --platform "$TARGET_PLATFORM" \ @@ -211,8 +212,8 @@ eval docker buildx build \ --build-arg GIT_SHA="$GIT_SHA" \ --build-arg NODE_VERSION="$NODE_VERSION" \ --build-arg ZIP_SOURCE="$ZIP_SOURCE" \ - --build-arg INSTALL_MODULES="$INSTALL_MODULES" \ - "$labelString" \ - "${TARGET_IMAGES[*]}" \ + --build-arg PRE_INSTALLED_MODULES="$PRE_INSTALLED_MODULES" \ + "${COMPUTED_LABELS[@]}" \ + "${TARGET_IMAGES[@]}" \ "$([ "${PUSH}" == "true" ] && echo "--push" || echo "--load")" \ . diff --git a/docker/alpine.Dockerfile b/docker/alpine.Dockerfile index 106b128..e13076c 100644 --- a/docker/alpine.Dockerfile +++ b/docker/alpine.Dockerfile @@ -4,7 +4,7 @@ ARG PHP_FLAVOUR=8.3-fpm-alpine ARG GIT_SHA ARG NODE_VERSION ARG ZIP_SOURCE -ARG INSTALL_MODULES +ARG PRE_INSTALLED_MODULES # ------------------------------------- # PrestaShop Flashlight: Alpine image @@ -47,8 +47,8 @@ ARG PHP_VERSION ARG GIT_SHA ARG PS_FOLDER=/var/www/html ARG ZIP_SOURCE -ARG INSTALL_MODULES -ENV INSTALL_MODULES=$INSTALL_MODULES +ARG PRE_INSTALLED_MODULES +ENV PRE_INSTALLED_MODULES=$PRE_INSTALLED_MODULES # Get PrestaShop source code # hadolint ignore=DL3020 diff --git a/docker/debian.Dockerfile b/docker/debian.Dockerfile index 5aa0524..765e7f4 100644 --- a/docker/debian.Dockerfile +++ b/docker/debian.Dockerfile @@ -4,7 +4,7 @@ ARG PHP_FLAVOUR=8.3-fpm-bookworm ARG GIT_SHA ARG NODE_VERSION ARG ZIP_SOURCE -ARG INSTALL_MODULES +ARG PRE_INSTALLED_MODULES # ------------------------------------- # PrestaShop Flashlight: Debian image @@ -47,8 +47,8 @@ ARG PHP_VERSION ARG GIT_SHA ARG PS_FOLDER=/var/www/html ARG ZIP_SOURCE -ARG INSTALL_MODULES -ENV INSTALL_MODULES=$INSTALL_MODULES +ARG PRE_INSTALLED_MODULES +ENV PRE_INSTALLED_MODULES=$PRE_INSTALLED_MODULES # Get PrestaShop source code # hadolint ignore=DL3020