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

OP-289: Refactor #54

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
17d8a93
OP-289: Update readme
hmfilar Jul 30, 2024
16e4782
OP-289: Add docker support
hmfilar Jul 30, 2024
8dac202
OP-289: Add mapping configuration to traits
hmfilar Jul 31, 2024
c451f99
OP-289: Remove ProductVariantRepository
hmfilar Jul 31, 2024
6820572
OP-289: Add grid config to plugin resources
hmfilar Aug 1, 2024
a90ff5a
OP-289: Update FE build
hmfilar Aug 1, 2024
42b4665
OP-289: Add a migration for creating plugin tables
hmfilar Aug 1, 2024
dd20f78
OP-289: Use test application build action from SyliusLabs
hmfilar Aug 1, 2024
ed6d75b
OP-289: Drop php 8.0 support, bump minimal symfony 6 version to 6.4
hmfilar Aug 2, 2024
5366129
OP-289: Refactor templates
hmfilar Aug 2, 2024
4903ee2
OP-289: Add grid type and filter to handle bundles
hmfilar Aug 12, 2024
c859d50
OP-289: Add xdebug support for docker
hmfilar Aug 13, 2024
d8a0d97
OP-289: Fix bundle filter handling
hmfilar Aug 13, 2024
09dc0e8
OP-289: List bundles on product detail admin page
hmfilar Aug 19, 2024
9124743
OP-289: Add fixtures
hmfilar Aug 20, 2024
def83b3
OP-289: Disable bundle form for simple and configurable products
hmfilar Aug 21, 2024
208659e
OP-289: Don't create bundle entities for simple and configurable prod…
hmfilar Aug 22, 2024
4678d05
OP-289: Reformat configs for consistency
hmfilar Aug 22, 2024
2ec8439
OP-289: Make properties readonly
hmfilar Aug 22, 2024
bb778ca
OP-289: Add accordion with bundled products on order view
hmfilar Aug 26, 2024
d8df943
OP-289: Add accordion with bundled products on cart summary
hmfilar Aug 26, 2024
4fe1f9b
OP-289: Add accordion with bundled products on order complete view an…
hmfilar Aug 27, 2024
0e91c5e
OP-289: Update readme to cover new templates
hmfilar Aug 27, 2024
60c8461
OP-289: Install rector and add rules for extending entities, update r…
hmfilar Aug 27, 2024
1f8bc20
OP-289: Disable variant management buttons for bundles
hmfilar Aug 28, 2024
4e50cc4
OP-289: Move resource definitions to Configuration tree
hmfilar Aug 29, 2024
f4db7d2
OP-289: Convert API resource definition to yaml
hmfilar Sep 2, 2024
9ac1c75
OP-289: Convert phpspec test to phpunit
hmfilar Sep 2, 2024
44bf4a0
OP-289: Add more behat scenarios
hmfilar Sep 3, 2024
65e9982
OP-289: Add a helpbox explaining what "Is packed product" does
hmfilar Sep 9, 2024
3dff2a8
OP-289: Fix handling unpacked bundles in shop
hmfilar Sep 9, 2024
e36d8a0
OP-289: Implement handling unpacked bundles in API
hmfilar Sep 10, 2024
8d279a7
OP-289: Adjust unit tests to handle unpacked bundles logic
hmfilar Sep 11, 2024
32a5795
OP-289: Add running unit tests to build
hmfilar Sep 11, 2024
0391920
OP-289: Add unit tests to command provider
hmfilar Sep 11, 2024
11b768e
OP-289: Cover overwriting variants with behat scenarios
hmfilar Sep 12, 2024
eec3b65
OP-289: Add new inventory management logic
hmfilar Sep 12, 2024
67b2053
OP-289: Bump min required patches, fix version selection in builds, f…
hmfilar Sep 16, 2024
04f657e
OP-289: Add info on enabling bundled products stock management to readme
hmfilar Sep 19, 2024
ccee940
OP-289: Add products in bundle section on admin product show page
hmfilar Sep 19, 2024
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
73 changes: 73 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG PHP_VERSION=8.2
ENV LC_ALL=C.UTF-8

# Install basic tools
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
make \
supervisor \
unzip \
python2 \
g++

# Append NODE, NGINX and PHP repositories
RUN add-apt-repository ppa:ondrej/php \
&& add-apt-repository ppa:ondrej/nginx \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash -

# Install required PHP extensions
RUN apt-get update && apt-get install -y \
nodejs \
nginx \
php${PHP_VERSION} \
php${PHP_VERSION}-apcu \
php${PHP_VERSION}-calendar \
php${PHP_VERSION}-common \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-ctype \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dom \
php${PHP_VERSION}-exif \
php${PHP_VERSION}-fpm \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-pdo \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-sqlite \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-xsl \
php${PHP_VERSION}-yaml \
php${PHP_VERSION}-zip

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename composer

# Cleanup
RUN apt-get remove --purge -y software-properties-common curl && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# Create directory for php-fpm socket
# Link php-fpm binary file without version
# -p Creates missing intermediate path name directories
RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm && mkdir -p /run/php

# Install yarn
RUN npm install -g yarn && npm cache clean --force

# Initialize config files
COPY .docker/supervisord.conf /etc/supervisor/conf.d/supervisor.conf
COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY .docker/fpm.conf /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf
COPY .docker/php.ini /etc/php/${PHP_VERSION}/fpm/php.ini
COPY .docker/php.ini /etc/php/${PHP_VERSION}/cli/php.ini

WORKDIR /app

EXPOSE 80

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
74 changes: 74 additions & 0 deletions .docker/Dockerfile-xdebug
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG PHP_VERSION=8.1
ENV LC_ALL=C.UTF-8

# Install basic tools
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
make \
supervisor \
unzip \
python2 \
g++

# Append NODE, NGINX and PHP repositories
RUN add-apt-repository ppa:ondrej/php \
&& add-apt-repository ppa:ondrej/nginx \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash -

# Install required PHP extensions
RUN apt-get update && apt-get install -y \
nodejs \
nginx \
php${PHP_VERSION} \
php${PHP_VERSION}-apcu \
php${PHP_VERSION}-calendar \
php${PHP_VERSION}-common \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-ctype \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dom \
php${PHP_VERSION}-exif \
php${PHP_VERSION}-fpm \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-pdo \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-sqlite \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-xsl \
php${PHP_VERSION}-yaml \
php${PHP_VERSION}-xdebug \
php${PHP_VERSION}-zip

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename composer

# Cleanup
RUN apt-get remove --purge -y software-properties-common curl && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# Create directory for php-fpm socket
# Link php-fpm binary file without version
# -p Creates missing intermediate path name directories
RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm && mkdir -p /run/php

# Install yarn
RUN npm install -g yarn && npm cache clean --force

# Initialize config files
COPY .docker/supervisord.conf /etc/supervisor/conf.d/supervisor.conf
COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY .docker/fpm.conf /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf
COPY .docker/php-xdebug.ini /etc/php/${PHP_VERSION}/fpm/php.ini
COPY .docker/php-xdebug.ini /etc/php/${PHP_VERSION}/cli/php.ini

WORKDIR /app

EXPOSE 80

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
21 changes: 21 additions & 0 deletions .docker/fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[www]
user = www-data
group = www-data

listen = /var/run/php-www.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

clear_env = no

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

pm.status_path = /status
catch_workers_output = yes

security.limit_extensions = .php
48 changes: 48 additions & 0 deletions .docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
user www-data;
worker_processes auto;
daemon off;
pid /run/nginx.pid;

include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

server_tokens off;

client_max_body_size 64m;
sendfile on;
tcp_nodelay on;
tcp_nopush on;

gzip_vary on;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

server {
listen 80;

root /app/tests/Application/public;
index index.php;

location / {
try_files $uri /index.php$is_args$args;
}

location ~ \.php$ {
include fastcgi_params;

fastcgi_pass unix:/var/run/php-www.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
}
}
22 changes: 22 additions & 0 deletions .docker/php-xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[PHP]
memory_limit=512M

[date]
date.timezone=${PHP_DATE_TIMEZONE}

[opcache]
opcache.enable=0
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0
;opcache.preload=/app/config/preload.php
opcache.preload_user=www-data
opcache.jit=1255
opcache.jit_buffer_size=256M

[xdebug]
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request = yes
xdebug.client_port = 9003
xdebug.discover_client_host = 1
15 changes: 15 additions & 0 deletions .docker/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[PHP]
memory_limit=512M

[date]
date.timezone=${PHP_DATE_TIMEZONE}

[opcache]
opcache.enable=0
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0
;opcache.preload=/app/config/preload.php
opcache.preload_user=www-data
opcache.jit=1255
opcache.jit_buffer_size=256M
14 changes: 14 additions & 0 deletions .docker/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[supervisord]
nodaemon = true
user = root
pidfile = /run/supervisord.pid

[program:nginx]
command = /usr/sbin/nginx
user = root
autostart = true

[program:php-fpm]
command = /usr/sbin/php-fpm -F
user = root
autostart = true
Loading
Loading