Skip to content

Commit 81af21b

Browse files
feat: patch shopware to remove need for specific mysql version
1 parent 04ccdc9 commit 81af21b

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

alpine/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ RUN \
1616

1717
ARG TEMPLATE_REPOSITORY=https://github.com/shopware/shopware
1818

19+
COPY patches/Migration1586260286AddProductMainVariant.php.patch ./tmp/
20+
1921
RUN \
2022
start-mysql && \
2123
mysql -e "CREATE DATABASE shopware" && \
2224
mysqladmin --user=root password 'root' && \
2325
mkdir -p /opt/shopware && \
2426
git clone -b ${SHOPWARE_VERSION} --depth 1 "${TEMPLATE_REPOSITORY}" "${SHOPWARE_BUILD_DIR}" && \
2527
cd "${SHOPWARE_BUILD_DIR}" && \
28+
if echo "${SHOPWARE_VERSION}" | grep -q '^v6.4.*'; then \
29+
git apply /tmp/Migration1586260286AddProductMainVariant.php.patch && \
30+
fi && \
31+
rm /tmp/Migration1586260286AddProductMainVariant.php.patch && \
2632
mkdir -p custom && \
2733
composer install --no-interaction -o && \
2834
APP_URL="http://localhost" php bin/console system:setup --database-url=mysql://root:root@localhost:3306/shopware --generate-jwt-keys -nq && \

alpine/Dockerfile.base

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr
77
RUN \
88
apk add --no-cache git zip unzip zlib-dev libpng-dev icu-dev libzip-dev bash jq \
99
python3 make g++ && \
10-
if cat /etc/alpine-release | grep -q '^3.16.*'; then \
11-
apk add --no-cache --repository="https://mirror.fel.cvut.cz/alpine/snapshots/2024-01-20/v3.16/main" 'mysql=10.6.14-r0' 'mariadb=10.6.14-r0' 'mysql-client=10.6.14-r0' 'mariadb-client=10.6.14-r0' 'mariadb-common=10.6.14-r0'; \
12-
else \
13-
apk add --no-cache mysql mysql-client; \
14-
fi && \
10+
apk add --no-cache mysql mysql-client; \
1511
echo 'alias ll="ls -lha"' >> ~/.bashrc && \
1612
install-php-extensions gd intl pdo_mysql zip xsl pcov redis bcmath && \
1713
curl -1sLf 'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.alpine.sh' | bash && \
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- /src/Core/Migration/V6_3/Migration1586260286AddProductMainVariant.php 2024-12-06 22:11:11
2+
+++ /src/Core/Migration/V6_3/Migration1586260286AddProductMainVariant.php 2024-12-06 22:22:02
3+
@@ -22,11 +22,7 @@
4+
$connection->executeStatement('
5+
ALTER TABLE `product`
6+
ADD `main_variant_id` BINARY(16) NULL
7+
- AFTER `configurator_group_config`,
8+
- ADD CONSTRAINT `fk.product.main_variant_id`
9+
- FOREIGN KEY (`main_variant_id`)
10+
- REFERENCES `product` (`id`)
11+
- ON DELETE SET NULL
12+
+ AFTER `configurator_group_config`
13+
');
14+
}
15+

0 commit comments

Comments
 (0)