From 8a46b11dcfd96bf09c7d523870fc52c1b4f75a09 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Mon, 6 Jan 2025 15:55:55 +0100 Subject: [PATCH] fix: remove old deprecated scripts --- fpm/Dockerfile | 2 +- fpm/rootfs/setup | 29 ++--------- fpm/rootfs/usr/local/shopware/functions.sh | 56 ---------------------- fpm/rootfs/usr/local/shopware/setup_6.5.x | 35 -------------- fpm/rootfs/usr/local/shopware/setup_6.6.x | 44 ----------------- 5 files changed, 6 insertions(+), 160 deletions(-) delete mode 100644 fpm/rootfs/usr/local/shopware/functions.sh delete mode 100755 fpm/rootfs/usr/local/shopware/setup_6.5.x delete mode 100755 fpm/rootfs/usr/local/shopware/setup_6.6.x diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 59f4076..c5e6506 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -8,7 +8,7 @@ ARG REDIS_PHP_MODULE=redis ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ -RUN apk add --no-cache icu-data-full curl jq trurl && \ +RUN apk add --no-cache icu-data-full curl && \ apk upgrade --no-cache && \ chmod +x /usr/local/bin/install-php-extensions && \ install-php-extensions bcmath gd intl mysqli pdo_mysql pcntl sockets bz2 gmp soap zip ffi opcache ${REDIS_PHP_MODULE} apcu-5.1.24 amqp-2.1.2 zstd-0.13.3 && \ diff --git a/fpm/rootfs/setup b/fpm/rootfs/setup index ec66b06..7357620 100755 --- a/fpm/rootfs/setup +++ b/fpm/rootfs/setup @@ -8,32 +8,13 @@ if [[ -e /var/www/html/vendor/bin/shopware-deployment-helper ]]; then exec ./vendor/bin/shopware-deployment-helper run fi -echo "### DEPRECATION ###" +echo "### ERROR ###" echo "" -echo "### The setup scripts are deprecated and will be removed November 2024 ###" -echo "### Please install the Shopware Deployment Helper using composer require shopware/deployment-helper to get rid of this message ###" +echo "### The setup scripts are removed ###" +echo "### Please install the Shopware Deployment Helper using composer require shopware/deployment-helper to continue ###" echo "### For more information see https://developer.shopware.com/docs/guides/hosting/installation-updates/deployments/deployment-helper.html ###" echo "" -echo "### DEPRECATION ###" +echo "### ERROR ###" echo "" -echo "Sleeping 30 seconds to make the deprecation visible." -sleep 30 - -set -x - -shopware_version=$(jq '.packages[] | select (.name == "shopware/core") | .version' -r < composer.lock) -# shellcheck disable=SC2081,SC3010 -if [[ $shopware_version != v6* ]]; then - shopware_version="v$(jq '.packages[] | select (.name == "shopware/core") | .extra."branch-alias"."dev-trunk"' -r < composer.lock)" -fi - -# if shopware version starts with 6.6 echo 6.6 -# shellcheck disable=SC2081,SC3010 -if [[ $shopware_version == v6.6.* ]]; then - # shellcheck source-path=./fpm/rootfs source=./usr/local/shopware/setup_6.6.x - . /usr/local/shopware/setup_6.6.x -else - # shellcheck source-path=./fpm/rootfs source=./usr/local/shopware/setup_6.5.x - . /usr/local/shopware/setup_6.5.x -fi +exit 1 diff --git a/fpm/rootfs/usr/local/shopware/functions.sh b/fpm/rootfs/usr/local/shopware/functions.sh deleted file mode 100644 index 0ff6362..0000000 --- a/fpm/rootfs/usr/local/shopware/functions.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env sh - -set -e - -wait_for_mysql() { - database_host=${DATABASE_HOST:-"$(trurl "$DATABASE_URL" --get '{host}')"} - database_port=${DATABASE_PORT:-"$(trurl "$DATABASE_URL" --get '{port}')"} - MYSQL_WAIT_SECONDS=${MYSQL_WAIT_SECONDS:-20} - - try=0 - if [ "$MYSQL_WAIT_SECONDS" != 0 ]; then - until nc -z -v -w30 "$database_host" "${database_port:-3306}"; do - echo "Waiting for database connection..." - # wait for 5 seconds before check again - sleep 1 - - try=$((try + 1)) - - if [ $try = "$MYSQL_WAIT_SECONDS" ]; then - echo "Error: We have been waiting for database connection too long already; failing." - exit 1 - fi - done - fi -} - -console() { - php -derror_reporting=E_ALL bin/console "$@" -} - -install_all_plugins() { - list_with_updates=$(php bin/console plugin:list --json | jq 'map(select(.installedAt == null)) | .[].name' -r) - - for plugin in $list_with_updates; do - console plugin:install --activate "$plugin" - done -} - -update_all_plugins() { - list_with_updates=$(php bin/console plugin:list --json | jq 'map(select(.upgradeVersion != null)) | .[].name' -r) - - for plugin in $list_with_updates; do - php -derror_reporting=E_ALL bin/console plugin:update "$plugin" - done -} - -run_hooks() { - hook=$1 - if [ -d "/usr/local/shopware/$hook.d" ]; then - for file in "/usr/local/shopware/$hook.d"/*.sh; do - echo "Running $file for $hook" - # shellcheck source=../../../../../../../../../dev/null - . "$file" -done - fi -} diff --git a/fpm/rootfs/usr/local/shopware/setup_6.5.x b/fpm/rootfs/usr/local/shopware/setup_6.5.x deleted file mode 100755 index eab5423..0000000 --- a/fpm/rootfs/usr/local/shopware/setup_6.5.x +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env sh - -set -e -set -x - -. /usr/local/shopware/functions.sh - -if php bin/console system:config:get shopware.installed; then - run_hooks pre_update - - console system:update:finish - console plugin:refresh - - update_all_plugins - install_all_plugins - - run_hooks post_update -else - run_hooks pre_install - - # Shopware is not installed - console system:install --create-database "--shop-locale=$INSTALL_LOCALE" "--shop-currency=$INSTALL_CURRENCY" --force - console user:create "$INSTALL_ADMIN_USERNAME" --admin --password="$INSTALL_ADMIN_PASSWORD" -n - console sales-channel:create:storefront --name=Storefront --url="$APP_URL" - console theme:change --all Storefront - console system:config:set core.frw.completedAt '2019-10-07T10:46:23+00:00' - console system:config:set core.usageData.shareUsageData false --json - console plugin:refresh - - install_all_plugins - - run_hooks post_install -fi - -run_hooks post_setup \ No newline at end of file diff --git a/fpm/rootfs/usr/local/shopware/setup_6.6.x b/fpm/rootfs/usr/local/shopware/setup_6.6.x deleted file mode 100755 index b247c12..0000000 --- a/fpm/rootfs/usr/local/shopware/setup_6.6.x +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env sh - -set -e -set -x - -# shellcheck source=./functions.sh -. /usr/local/shopware/functions.sh - -wait_for_mysql - -if console system:is-installed; then - run_hooks pre_update - - if [ "${SHOPWARE_SKIP_ASSET_COPY-""}" ]; then - console system:update:finish --skip-asset-build - else - console system:update:finish - fi - - if [ "${SHOPWARE_SKIP_ASSET_COPY-""}" ]; then - console plugin:update:all - else - console plugin:update:all --skip-asset-build - fi - - install_all_plugins - - run_hooks post_update -else - run_hooks pre_install - - console system:install --create-database "--shop-locale=$INSTALL_LOCALE" "--shop-currency=$INSTALL_CURRENCY" --force - console user:create "$INSTALL_ADMIN_USERNAME" --admin --password="$INSTALL_ADMIN_PASSWORD" -n - console sales-channel:create:storefront --name=Storefront --url="$APP_URL" - console theme:change --all Storefront - console system:config:set core.frw.completedAt '2019-10-07T10:46:23+00:00' - console plugin:refresh - - install_all_plugins - - run_hooks post_install -fi - -run_hooks post_setup \ No newline at end of file