Skip to content

Commit

Permalink
Merge pull request #404 from PrestaShop/fix-build-assets
Browse files Browse the repository at this point in the history
Fix build assets
  • Loading branch information
jolelievre authored Nov 8, 2024
2 parents 46abef4 + b5a9362 commit 7ebdd8b
Show file tree
Hide file tree
Showing 29 changed files with 132 additions and 65 deletions.
1 change: 1 addition & 0 deletions Dockerfile-branch.model
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ RUN apt update
RUN apt -y install git

ENV PS_BRANCH=$branch_version
ENV NODE_VERSION=$node_version

CMD ["/tmp/docker_branch_run.sh"]
18 changes: 16 additions & 2 deletions HOW-TO-USE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,25 @@ Finally, you can launch your PrestaShop container using docker compose
$ PS_VERSION=9.0.x PHP_VERSION=8.3 docker compose -f images/docker-compose.yml up
```
Or you can use this script that performs these actions based on the arguments
Or you can use the `build-local-docker.sh` script that performs these actions based on the options
```
# Script options:
#
# -v PRESTA_SHOP_VERSION
# -s SERVER (apache|fpm)
# -p PHP_VERSION (7.1, 8.2, ...)
# -l Launch shop thanks to a docker compose (default false)
#
# Default values are nightly 8.3 apache
./build-local-docker.sh 9.0.x 8.1 fpm
$ ./build-local-docker.sh -v 9.0.x -p 8.1 -s fpm
```
Adding the `-l` option will also launch a container build with docker compose so you get an accessible shop locally
```
$ ./build-local-docker.sh -v 9.0.x -p 8.1 -s fpm -l
```
Now you should be able to access a shop at this address: `http://localhost:8001/`
Expand Down
7 changes: 4 additions & 3 deletions base/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.1-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.1-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.2-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.2-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.3-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.3-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.4-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/7.4-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.0-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.0-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.1-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.1-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.2-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.2-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.3-apache/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
7 changes: 4 additions & 3 deletions base/images/8.3-fpm/config_files/docker_branch_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -f /usr/local/bin/composer ]; then
fi
fi

# Install vendor dependencies
# Install vendor dependencies (vendor are always installed)
if [ ! -f /var/www/html/vendor/autoload.php ]; then
echo "\n* Running composer ...";
pushd /var/www/html
Expand All @@ -30,8 +30,9 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
popd
fi

# Build assets
if [ "${DISABLE_MAKE}" != "1" ]; then
# Build assets unless make is disabled (which can b the case when we only need PHP dependencies in CI)
# If auto install is enabled though we must build the assets
if [ "${DISABLE_MAKE}" != "1" ] || [ "${PS_INSTALL_AUTO}" == "1"]; then
mkdir -p /var/www/.npm
chown -R www-data:www-data /var/www/.npm

Expand Down
Loading

0 comments on commit 7ebdd8b

Please sign in to comment.