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 1, 2024
1 parent 76fbef3 commit 46f0830
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
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 @@ -48,8 +48,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 @@ -48,8 +48,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 46f0830

Please sign in to comment.