Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-Lematre committed May 21, 2024
1 parent 1b365b8 commit feb5333
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion assets/hydrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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
Expand Down
15 changes: 8 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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" \
Expand All @@ -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")" \
.
6 changes: 3 additions & 3 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG PHP_FLAVOUR
ARG GIT_SHA
ARG NODE_VERSION
ARG ZIP_SOURCE
ARG INSTALL_MODULES
ARG PRE_INSTALLED_MODULES

# -------------------------------------
# PrestaShop Flashlight: Alpine image
Expand Down Expand Up @@ -46,8 +46,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
Expand Down
6 changes: 3 additions & 3 deletions docker/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG PHP_FLAVOUR
ARG GIT_SHA
ARG NODE_VERSION
ARG ZIP_SOURCE
ARG INSTALL_MODULES
ARG PRE_INSTALLED_MODULES

# -------------------------------------
# PrestaShop Flashlight: Debian image
Expand Down Expand Up @@ -46,8 +46,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
Expand Down

0 comments on commit feb5333

Please sign in to comment.