Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build assets #404

Merged
merged 5 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading