From 055e04bd3677e64e7fad1cc4f3399f8ad6519789 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 28 Nov 2022 15:56:30 -0600 Subject: [PATCH 001/113] MCLOUD-9683: Update Code of Conduct on public Cloud repos --- .github/CODE_OF_CONDUCT.md | 70 ++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 637f3a24..5eb057af 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -1,47 +1,75 @@ -# Contributor Covenant Code of Conduct +# Magento Code of Conduct ## Our Pledge -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to creating a positive environment include: +Examples of behavior that contribute to a positive environment for our project and community include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best, not just for us as individuals but for the overall community -Examples of unacceptable behavior by participants include: +Examples of unacceptable behavior include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Publishing others’ private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. +This Code of Conduct applies when an individual is representing the project or its community both within project spaces and in public spaces. Examples of representing a project or community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by first contacting the project team at engcom@adobe.com. Oversight of Adobe projects is handled by the Adobe Open Source Office, which has final say in any violations and enforcement of this Code of Conduct and can be reached at Grp-opensourceoffice@adobe.com. All complaints will be reviewed and investigated promptly and fairly. -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. +The project team must respect the privacy and security of the reporter of any incident. -## Attribution +Project maintainers who do not follow or enforce the Code of Conduct may face temporary or permanent repercussions as determined by other members of the project's leadership or the Adobe Open Source Office. + +## Enforcement Guidelines + +Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem to be in violation of this Code of Conduct: + +**1. Correction** + +Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +Consequence: A private, written warning from project maintainers describing the violation and why the behavior was unacceptable. A public apology may be requested from the violator before any further involvement in the project by violator. + +**2. Warning** -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +Community Impact: A relatively minor violation through a single incident or series of actions. -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +Consequence: A written warning from project maintainers that includes stated consequences for continued unacceptable behavior. Violator must refrain from interacting with the people involved for a specified period of time as determined by the project maintainers, including, but not limited to, unsolicited interaction with those enforcing the Code of Conduct through channels such as community spaces and social media. Continued violations may lead to a temporary or permanent ban. + +**3. Temporary Ban** + +Community Impact: A more serious violation of community standards, including sustained unacceptable behavior. + +Consequence: A temporary ban from any interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Failure to comply with the temporary ban may lead to a permanent ban. + +**4. Permanent Ban** + +Community Impact: Demonstrating a consistent pattern of violation of community standards or an egregious violation of community standards, including, but not limited to, sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +Consequence: A permanent ban from any interaction with the community. + +## Attribution +This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. From e414436fe39982c092d9cc4265809a888738a5f7 Mon Sep 17 00:00:00 2001 From: Dmitry Chayka Date: Tue, 6 Dec 2022 22:53:36 -0500 Subject: [PATCH 002/113] Added ionCube extension to PHP8.1 image Dockerfile --- images/php/8.1-cli/Dockerfile | 9 +++++++++ images/php/8.1-fpm/Dockerfile | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 9708007e..651f17d9 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -164,6 +164,15 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && cd / \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium +RUN cd /tmp \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ + && export PHP_EXT_DIR=$(php-config --extension-dir) \ + && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ + && rm -rf ./ioncube \ + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini diff --git a/images/php/8.1-fpm/Dockerfile b/images/php/8.1-fpm/Dockerfile index bb188c99..f9f544dd 100644 --- a/images/php/8.1-fpm/Dockerfile +++ b/images/php/8.1-fpm/Dockerfile @@ -139,6 +139,15 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && cd / \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium +RUN cd /tmp \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ + && export PHP_EXT_DIR=$(php-config --extension-dir) \ + && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ + && rm -rf ./ioncube \ + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini From 9a22833b0eb07c4f1be09cc202199c0aa184fbd7 Mon Sep 17 00:00:00 2001 From: Dmitry Chayka Date: Wed, 7 Dec 2022 15:02:00 -0500 Subject: [PATCH 003/113] added php8.1 version to ExtensionResolver for ioncube --- src/Compose/Php/ExtensionResolver.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index c00f9198..45c74dcf 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -481,6 +481,20 @@ public static function getConfig(): array rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz BASH ], + '8.1' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, + self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH +cd /tmp +if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi +curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_\${ioncube_arch}.tar.gz +tar zxvf ioncube_loaders_lin_\${ioncube_arch}.tar.gz +export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") +export PHP_EXT_DIR=$(php-config --extension-dir) +cp "./ioncube/ioncube_loader_lin_\${PHP_VERSION}.so" "\${PHP_EXT_DIR}/ioncube.so" +rm -rf ./ioncube +rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz +BASH + ] ], ]; } From 3a25089c19fbaff45d320441c0a1ddb9cf3f2a3c Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 9 Dec 2022 14:30:35 -0600 Subject: [PATCH 004/113] MCLOUD-9761: Added ionCube extension to PHP8.1 images to MCD --- src/Compose/Php/ExtensionResolver.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 45c74dcf..8fa9a01a 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -467,7 +467,7 @@ public static function getConfig(): array '>=7.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], ], 'ioncube' => [ - '>=7.0 <=7.4' => [ + '>=7.0 <8.0 || >8.0 <=8.1' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH cd /tmp @@ -481,20 +481,6 @@ public static function getConfig(): array rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz BASH ], - '8.1' => [ - self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, - self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH -cd /tmp -if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi -curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_\${ioncube_arch}.tar.gz -tar zxvf ioncube_loaders_lin_\${ioncube_arch}.tar.gz -export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") -export PHP_EXT_DIR=$(php-config --extension-dir) -cp "./ioncube/ioncube_loader_lin_\${PHP_VERSION}.so" "\${PHP_EXT_DIR}/ioncube.so" -rm -rf ./ioncube -rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz -BASH - ] ], ]; } From 5094270281216a67e154a812ac70ed2400af6510 Mon Sep 17 00:00:00 2001 From: Sandeep Sikharam Date: Fri, 16 Dec 2022 11:18:32 -0600 Subject: [PATCH 005/113] MCLOUD-9738: Adding images for new service versions. (#105) --- images/opensearch/2.3/Dockerfile | 21 +++ images/opensearch/2.3/docker-entrypoint.sh | 12 ++ images/opensearch/2.3/docker-healthcheck.sh | 12 ++ images/opensearch/2.4/Dockerfile | 21 +++ images/opensearch/2.4/docker-entrypoint.sh | 12 ++ images/opensearch/2.4/docker-healthcheck.sh | 12 ++ images/php/8.2-cli/Dockerfile | 192 ++++++++++++++++++++ images/php/8.2-cli/bin/cloud-build | 44 +++++ images/php/8.2-cli/bin/cloud-deploy | 37 ++++ images/php/8.2-cli/bin/cloud-post-deploy | 11 ++ images/php/8.2-cli/bin/ece-command | 7 + images/php/8.2-cli/bin/magento-command | 7 + images/php/8.2-cli/bin/magento-installer | 11 ++ images/php/8.2-cli/bin/mftf-command | 7 + images/php/8.2-cli/bin/run-cron | 3 + images/php/8.2-cli/bin/run-hooks | 61 +++++++ images/php/8.2-cli/docker-entrypoint.sh | 31 ++++ images/php/8.2-cli/etc/mail.ini | 2 + images/php/8.2-cli/etc/php-cli.ini | 10 + images/php/8.2-cli/etc/php-gnupg.ini | 1 + images/php/8.2-cli/etc/php-pcov.ini | 2 + images/php/8.2-cli/etc/php-xdebug.ini | 8 + images/php/8.2-fpm/Dockerfile | 150 +++++++++++++++ images/php/8.2-fpm/docker-entrypoint.sh | 24 +++ images/php/8.2-fpm/etc/mail.ini | 2 + images/php/8.2-fpm/etc/php-fpm.conf | 25 +++ images/php/8.2-fpm/etc/php-fpm.ini | 4 + images/php/8.2-fpm/etc/php-gnupg.ini | 1 + images/php/8.2-fpm/etc/php-pcov.ini | 2 + images/php/8.2-fpm/etc/php-xdebug.ini | 8 + images/varnish/7.1.1/Dockerfile | 3 + images/varnish/7.1.1/etc/default.vcl | 177 ++++++++++++++++++ src/Command/Image/GenerateOs.php | 6 + src/Command/Image/GeneratePhp.php | 22 ++- src/Compose/Php/ExtensionResolver.php | 8 +- 35 files changed, 949 insertions(+), 7 deletions(-) create mode 100644 images/opensearch/2.3/Dockerfile create mode 100755 images/opensearch/2.3/docker-entrypoint.sh create mode 100644 images/opensearch/2.3/docker-healthcheck.sh create mode 100644 images/opensearch/2.4/Dockerfile create mode 100755 images/opensearch/2.4/docker-entrypoint.sh create mode 100644 images/opensearch/2.4/docker-healthcheck.sh create mode 100644 images/php/8.2-cli/Dockerfile create mode 100644 images/php/8.2-cli/bin/cloud-build create mode 100644 images/php/8.2-cli/bin/cloud-deploy create mode 100644 images/php/8.2-cli/bin/cloud-post-deploy create mode 100644 images/php/8.2-cli/bin/ece-command create mode 100644 images/php/8.2-cli/bin/magento-command create mode 100644 images/php/8.2-cli/bin/magento-installer create mode 100644 images/php/8.2-cli/bin/mftf-command create mode 100644 images/php/8.2-cli/bin/run-cron create mode 100644 images/php/8.2-cli/bin/run-hooks create mode 100644 images/php/8.2-cli/docker-entrypoint.sh create mode 100644 images/php/8.2-cli/etc/mail.ini create mode 100644 images/php/8.2-cli/etc/php-cli.ini create mode 100644 images/php/8.2-cli/etc/php-gnupg.ini create mode 100644 images/php/8.2-cli/etc/php-pcov.ini create mode 100644 images/php/8.2-cli/etc/php-xdebug.ini create mode 100644 images/php/8.2-fpm/Dockerfile create mode 100644 images/php/8.2-fpm/docker-entrypoint.sh create mode 100644 images/php/8.2-fpm/etc/mail.ini create mode 100644 images/php/8.2-fpm/etc/php-fpm.conf create mode 100644 images/php/8.2-fpm/etc/php-fpm.ini create mode 100644 images/php/8.2-fpm/etc/php-gnupg.ini create mode 100644 images/php/8.2-fpm/etc/php-pcov.ini create mode 100644 images/php/8.2-fpm/etc/php-xdebug.ini create mode 100755 images/varnish/7.1.1/Dockerfile create mode 100755 images/varnish/7.1.1/etc/default.vcl diff --git a/images/opensearch/2.3/Dockerfile b/images/opensearch/2.3/Dockerfile new file mode 100644 index 00000000..1f52e728 --- /dev/null +++ b/images/opensearch/2.3/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.3.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/2.3/docker-entrypoint.sh b/images/opensearch/2.3/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.3/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/2.3/docker-healthcheck.sh b/images/opensearch/2.3/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.3/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/opensearch/2.4/Dockerfile b/images/opensearch/2.4/Dockerfile new file mode 100644 index 00000000..b38adc78 --- /dev/null +++ b/images/opensearch/2.4/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.4.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/2.4/docker-entrypoint.sh b/images/opensearch/2.4/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.4/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/2.4/docker-healthcheck.sh b/images/opensearch/2.4/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.4/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile new file mode 100644 index 00000000..f5bebb6a --- /dev/null +++ b/images/php/8.2-cli/Dockerfile @@ -0,0 +1,192 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.2-cli + +ARG COMPOSER_VERSION=2.2.18 +ARG MAGENTO_ROOT=/app +ARG COMPOSER_ALLOW_SUPERUSER=1 +ARG COMPOSER_HOME=/composer +ARG CRONTAB="" + +ENV COMPOSER_MEMORY_LIMIT -1 +ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} +ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV PHP_MEMORY_LIMIT -1 +ENV PHP_VALIDATE_TIMESTAMPS 1 +ENV DEBUG false +ENV MAGENTO_RUN_MODE production +ENV SENDMAIL_PATH /dev/null +ENV PHPRC ${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl + +# Configure Node.js version +RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + cron \ + git \ + mariadb-client \ + nano \ + nodejs \ + python3 \ + python3-pip \ + redis-tools \ + sendmail-bin \ + sendmail \ + sudo \ + unzip \ + vim \ + openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + && rm -rf /var/lib/apt/lists/* + +# Install PyYAML +RUN pip3 install --upgrade setuptools \ + && pip3 install pyyaml + +# Install Grunt +RUN npm install -g grunt-cli + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + pspell \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.2.0 \ + xmlrpc-1.0.0RC3 \ + yaml + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini +ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +# Get composer installed to /usr/local/bin/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer + +ADD bin/* /usr/local/bin/ + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +ADD docker-entrypoint.sh /docker-entrypoint.sh + +RUN ["chmod", "+x", \ + "/docker-entrypoint.sh", \ + "/usr/local/bin/magento-installer", \ + "/usr/local/bin/magento-command", \ + "/usr/local/bin/mftf-command", \ + "/usr/local/bin/ece-command", \ + "/usr/local/bin/cloud-build", \ + "/usr/local/bin/cloud-deploy", \ + "/usr/local/bin/cloud-post-deploy", \ + "/usr/local/bin/run-cron", \ + "/usr/local/bin/run-hooks" \ +] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["bash"] diff --git a/images/php/8.2-cli/bin/cloud-build b/images/php/8.2-cli/bin/cloud-build new file mode 100644 index 00000000..bbd584c9 --- /dev/null +++ b/images/php/8.2-cli/bin/cloud-build @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +RUN_HOOKS="run-hooks" + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Cleaning directories:" + + if [ "$INSTALLATION_TYPE" == "composer" ]; then + echo "Cleaning setup directory." + rm -rf $MAGENTO_ROOT/setup/* + fi + + echo "Cleaning vendor directory." + rm -rf $MAGENTO_ROOT/vendor/* + + echo "Cleaning generated directory." + rm -rf $MAGENTO_ROOT/generated/* + + echo "Removing app/etc/env.php file" + rm -f $MAGENTO_ROOT/app/etc/env.php +fi + +echo "Installing dependencies." + +composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist + +echo "Running \"build\" hook." + +$RUN_HOOKS build + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Setting file permissions." + + chown -R www:www $MAGENTO_ROOT + + find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; + find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; +fi + +echo "Building complete." diff --git a/images/php/8.2-cli/bin/cloud-deploy b/images/php/8.2-cli/bin/cloud-deploy new file mode 100644 index 00000000..f6b891bf --- /dev/null +++ b/images/php/8.2-cli/bin/cloud-deploy @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"deploy\" hook." + +run-hooks deploy + +# check that Varnish exists +if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then + minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") + if [[ "$minor_magento_version" != "2.1" ]]; then + output=$(magento-command config:set system/full_page_cache/caching_application 2) + # as config:set does not return error code, we check output text to continue set varnish settings + if [[ $output == *"Value was saved"* ]]; then + echo "Setting Varnish for Magento FPC." + magento-command setup:config:set --http-cache-hosts=varnish -n + else + echo $output + fi + fi +fi + +# set developer mode if it is configured in $MAGENTO_RUN_MODE +if [ "$MAGENTO_RUN_MODE" == "developer" ]; then + output=$(magento-command deploy:mode:set developer) + if [[ $output == *"Enabled developer mode."* ]]; then + echo "Enabled developer mode." + else + echo $output + fi +fi + + +echo "Deployment finished." diff --git a/images/php/8.2-cli/bin/cloud-post-deploy b/images/php/8.2-cli/bin/cloud-post-deploy new file mode 100644 index 00000000..f5bb3956 --- /dev/null +++ b/images/php/8.2-cli/bin/cloud-post-deploy @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"post-deploy\" hook." + +run-hooks post_deploy + +echo "Post deployment finished." diff --git a/images/php/8.2-cli/bin/ece-command b/images/php/8.2-cli/bin/ece-command new file mode 100644 index 00000000..36d896c5 --- /dev/null +++ b/images/php/8.2-cli/bin/ece-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" + +exec $ECE_COMMAND "$@" diff --git a/images/php/8.2-cli/bin/magento-command b/images/php/8.2-cli/bin/magento-command new file mode 100644 index 00000000..8d439f7d --- /dev/null +++ b/images/php/8.2-cli/bin/magento-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" + +exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.2-cli/bin/magento-installer b/images/php/8.2-cli/bin/magento-installer new file mode 100644 index 00000000..73645ab7 --- /dev/null +++ b/images/php/8.2-cli/bin/magento-installer @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +BUILD_COMMAND="cloud-build" +DEPLOY_COMMAND="cloud-deploy" + +$BUILD_COMMAND +$DEPLOY_COMMAND diff --git a/images/php/8.2-cli/bin/mftf-command b/images/php/8.2-cli/bin/mftf-command new file mode 100644 index 00000000..88eaa1df --- /dev/null +++ b/images/php/8.2-cli/bin/mftf-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" + +exec $MFTF_COMMAND "$@" diff --git a/images/php/8.2-cli/bin/run-cron b/images/php/8.2-cli/bin/run-cron new file mode 100644 index 00000000..f6554a5c --- /dev/null +++ b/images/php/8.2-cli/bin/run-cron @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.2-cli/bin/run-hooks b/images/php/8.2-cli/bin/run-hooks new file mode 100644 index 00000000..8ac215c9 --- /dev/null +++ b/images/php/8.2-cli/bin/run-hooks @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import os +import sys +import subprocess +import json +import base64 + +# Disable output buffering. +os.environ['PYTHONUNBUFFERED'] = "1" + +# The list of available hooks. +available_hooks = ["build", "deploy", "post_deploy"] + + +# Prints a message and returns an exit code. +def error_exit(msg, code=1): + print(msg) + sys.exit(code) + + +# Gets Magento root path. +def get_magento_root(): + try: + return str(os.environ['MAGENTO_ROOT']) + except KeyError: + error_exit('Environment variable MAGENTO_ROOT is not available') + + +# Gets set hooks by hook name. +def get_hooks(hook_name): + try: + application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) + content = json.loads(base64.b64decode(application).decode("utf-8")) + + return content['hooks'][hook_name] + except Exception as exc: + error_exit("Cannot decode string: " + str(exc)) + + +# Main function. +def main(): + if len(sys.argv) != 2: + error_exit("Usage: run-hooks ") + + hook_name = str(sys.argv[1]) + if hook_name not in available_hooks: + error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) + + try: + subprocess.check_call( + get_hooks(hook_name), + shell=True, + cwd=get_magento_root() + ) + except subprocess.CalledProcessError as exc: + error_exit("returned non-zero exit status " + str(exc.returncode)) + + +if __name__ == '__main__': + main() diff --git a/images/php/8.2-cli/docker-entrypoint.sh b/images/php/8.2-cli/docker-entrypoint.sh new file mode 100644 index 00000000..1e025ca7 --- /dev/null +++ b/images/php/8.2-cli/docker-entrypoint.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +if [ ! -z "${CRONTAB}" ]; then + echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log +fi + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Configure composer +[ ! -z "${COMPOSER_VERSION}" ] && \ + composer self-update $COMPOSER_VERSION + +[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ + composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN + +[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ + composer config --global http-basic.repo.magento.com \ + $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD + +exec "$@" diff --git a/images/php/8.2-cli/etc/mail.ini b/images/php/8.2-cli/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.2-cli/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.2-cli/etc/php-cli.ini b/images/php/8.2-cli/etc/php-cli.ini new file mode 100644 index 00000000..dfaf04e4 --- /dev/null +++ b/images/php/8.2-cli/etc/php-cli.ini @@ -0,0 +1,10 @@ +; php.ini +memory_limit = ${PHP_MEMORY_LIMIT} +zlib.output_compression = on +realpath_cache_size = 32k +realpath_cache_ttl = 7200 +always_populate_raw_post_data = -1 +max_input_vars = 10000 +session.gc_probability = 1 +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/8.2-cli/etc/php-gnupg.ini b/images/php/8.2-cli/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.2-cli/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.2-cli/etc/php-pcov.ini b/images/php/8.2-cli/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.2-cli/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.2-cli/etc/php-xdebug.ini b/images/php/8.2-cli/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.2-cli/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM diff --git a/images/php/8.2-fpm/Dockerfile b/images/php/8.2-fpm/Dockerfile new file mode 100644 index 00000000..7ae884d7 --- /dev/null +++ b/images/php/8.2-fpm/Dockerfile @@ -0,0 +1,150 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.2-fpm + +ARG MAGENTO_ROOT=/app + +ENV PHP_MEMORY_LIMIT 2G +ENV PHP_VALIDATE_TIMESTAMPS 1 +ENV DEBUG false +ENV MAGENTO_RUN_MODE production +ENV UPLOAD_MAX_FILESIZE 64M +ENV SENDMAIL_PATH /dev/null +ENV PHPRC ${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + sendmail-bin \ + sendmail \ + sudo \ + iproute2 \ + git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + && rm -rf /var/lib/apt/lists/* + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + pspell \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.2.0 \ + xmlrpc-1.0.0RC3 \ + yaml + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini +COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +COPY etc/php-fpm.conf /usr/local/etc/ +COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN ["chmod", "+x", "/docker-entrypoint.sh"] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["php-fpm", "-R"] diff --git a/images/php/8.2-fpm/docker-entrypoint.sh b/images/php/8.2-fpm/docker-entrypoint.sh new file mode 100644 index 00000000..0c8c5c9c --- /dev/null +++ b/images/php/8.2-fpm/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Set host.docker.internal if not available +HOST_NAME="host.docker.internal" +HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") +if [[ "$HOST_IP" == "$HOST_NAME" ]]; then + HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') + printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts +fi + +exec "$@" diff --git a/images/php/8.2-fpm/etc/mail.ini b/images/php/8.2-fpm/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.2-fpm/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.2-fpm/etc/php-fpm.conf b/images/php/8.2-fpm/etc/php-fpm.conf new file mode 100644 index 00000000..d988b314 --- /dev/null +++ b/images/php/8.2-fpm/etc/php-fpm.conf @@ -0,0 +1,25 @@ +[global] + +error_log = /proc/self/fd/2 +daemonize = no + +[www] + +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + +listen = [::]:9000 + +pm = dynamic +pm.max_children = 10 +pm.start_servers = 4 +pm.min_spare_servers = 2 +pm.max_spare_servers = 6 +pm.status_path = /status + +clear_env = no + +env[MAGE_MODE] = $MAGENTO_RUN_MODE + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes diff --git a/images/php/8.2-fpm/etc/php-fpm.ini b/images/php/8.2-fpm/etc/php-fpm.ini new file mode 100644 index 00000000..387c8aeb --- /dev/null +++ b/images/php/8.2-fpm/etc/php-fpm.ini @@ -0,0 +1,4 @@ +memory_limit = ${PHP_MEMORY_LIMIT} +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} +user_ini.filename = diff --git a/images/php/8.2-fpm/etc/php-gnupg.ini b/images/php/8.2-fpm/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.2-fpm/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.2-fpm/etc/php-pcov.ini b/images/php/8.2-fpm/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.2-fpm/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.2-fpm/etc/php-xdebug.ini b/images/php/8.2-fpm/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.2-fpm/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM diff --git a/images/varnish/7.1.1/Dockerfile b/images/varnish/7.1.1/Dockerfile new file mode 100755 index 00000000..90b5f19a --- /dev/null +++ b/images/varnish/7.1.1/Dockerfile @@ -0,0 +1,3 @@ +FROM varnish:7.1.1 + +COPY etc/default.vcl /etc/varnish/ diff --git a/images/varnish/7.1.1/etc/default.vcl b/images/varnish/7.1.1/etc/default.vcl new file mode 100755 index 00000000..d9a17a55 --- /dev/null +++ b/images/varnish/7.1.1/etc/default.vcl @@ -0,0 +1,177 @@ +vcl 4.0; + +import std; + +# The minimal Varnish version is 4.0 +# For SSL offloading, pass the following header in your proxy server or load balancer: 'SSL-OFFLOADED: https' + +backend default { + .host = "web"; + .port = "8080"; + .first_byte_timeout = 300s; + .between_bytes_timeout = 300s; +} + +sub vcl_recv { + # Ensure the true IP is sent onwards. + # This was an issue getting xdebug working through varnish + # whilst having a proxy infront of varnish (for local docker dev) + if (req.http.X-Real-Ip) { + set req.http.X-Forwarded-For = req.http.X-Real-Ip; + } + + if (req.method == "PURGE") { + if (!req.http.X-Magento-Tags-Pattern) { + return (synth(400, "X-Magento-Tags-Pattern header required")); + } + ban("obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern); + return (synth(200, "Purged")); + } + + # Bypass debug session + if (req.http.Cookie ~ "(^|;\s*)(XDEBUG_SESSION=.*)(;|$)") { + return (pass); + } + + if (req.method != "GET" && + req.method != "HEAD" && + req.method != "PUT" && + req.method != "POST" && + req.method != "TRACE" && + req.method != "OPTIONS" && + req.method != "DELETE") { + /* Non-RFC2616 or CONNECT which is weird. */ + return (pipe); + } + + # We only deal with GET and HEAD by default + if (req.method != "GET" && req.method != "HEAD") { + return (pass); + } + + # Bypass shopping cart, checkout and search requests + if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { + return (pass); + } + + # normalize url in case of leading HTTP scheme and domain + set req.url = regsub(req.url, "^http[s]?://", ""); + + # collect all cookies + std.collect(req.http.Cookie); + + # Compression filter. See https://www.varnish-cache.org/trac/wiki/FAQ/Compression + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf|flv)$") { + # No point in compressing these + unset req.http.Accept-Encoding; + } elsif (req.http.Accept-Encoding ~ "gzip") { + set req.http.Accept-Encoding = "gzip"; + } elsif (req.http.Accept-Encoding ~ "deflate" && req.http.user-agent !~ "MSIE") { + set req.http.Accept-Encoding = "deflate"; + } else { + # unkown algorithm + unset req.http.Accept-Encoding; + } + } + + # Remove Google gclid parameters to minimize the cache objects + set req.url = regsuball(req.url,"\?gclid=[^&]+$",""); # strips when QS = "?gclid=AAA" + set req.url = regsuball(req.url,"\?gclid=[^&]+&","?"); # strips when QS = "?gclid=AAA&foo=bar" + set req.url = regsuball(req.url,"&gclid=[^&]+",""); # strips when QS = "?foo=bar&gclid=AAA" or QS = "?foo=bar&gclid=AAA&bar=baz" + + # static files are always cacheable. remove SSL flag and cookie + if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") { + unset req.http.Https; + unset req.http.SSL-OFFLOADED; + unset req.http.Cookie; + } + + return (hash); +} + +sub vcl_hash { + if (req.http.cookie ~ "X-Magento-Vary=") { + hash_data(regsub(req.http.cookie, "^.*?X-Magento-Vary=([^;]+);*.*$", "\1")); + } + + # For multi site configurations to not cache each other's content + if (req.http.host) { + hash_data(req.http.host); + } else { + hash_data(server.ip); + } + + # To make sure http users don't see ssl warning + if (req.http.SSL-OFFLOADED) { + hash_data(req.http.SSL-OFFLOADED); + } + + # Cache https seperately + if (req.http.X-Forwarded-Proto) { + hash_data(req.http.X-Forwarded-Proto); + } +} + +sub vcl_backend_response { + if (beresp.http.content-type ~ "text") { + set beresp.do_esi = true; + } + + if (bereq.url ~ "\.js$" || beresp.http.content-type ~ "text") { + set beresp.do_gzip = true; + } + + # cache only successfully responses and 404s + if (beresp.status != 200 && beresp.status != 404) { + set beresp.ttl = 0s; + set beresp.uncacheable = true; + return (deliver); + } elsif (beresp.http.Cache-Control ~ "private") { + set beresp.uncacheable = true; + set beresp.ttl = 86400s; + return (deliver); + } + + if (beresp.http.X-Magento-Debug) { + set beresp.http.X-Magento-Cache-Control = beresp.http.Cache-Control; + } + + # validate if we need to cache it and prevent from setting cookie + # images, css and js are cacheable by default so we have to remove cookie also + if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) { + unset beresp.http.set-cookie; + if (bereq.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") { + set beresp.http.Pragma = "no-cache"; + set beresp.http.Expires = "-1"; + set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0"; + set beresp.grace = 1m; + } + } + + # If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass + if (beresp.ttl <= 0s || + beresp.http.Surrogate-control ~ "no-store" || + (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { + # Mark as Hit-For-Pass for the next 2 minutes + set beresp.ttl = 120s; + set beresp.uncacheable = true; + } + return (deliver); +} + +sub vcl_deliver { + if (resp.http.x-varnish ~ " ") { + set resp.http.X-Magento-Cache-Debug = "HIT"; + } else { + set resp.http.X-Magento-Cache-Debug = "MISS"; + } + + unset resp.http.X-Magento-Debug; + unset resp.http.X-Magento-Tags; + unset resp.http.X-Powered-By; + unset resp.http.Server; + unset resp.http.X-Varnish; + unset resp.http.Via; + unset resp.http.Link; +} diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index 4b277b02..f2ebefab 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -34,6 +34,12 @@ class GenerateOs extends Command '1.2' => [ 'real-version' => '1.2.1', ], + '2.3' => [ + 'real-version' => '2.3.0' + ], + '2.4' => [ + 'real-version' => '2.4.0' + ] ]; /** diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index d6dd63c0..e33e4c33 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,14 +26,15 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1']; + private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']; private const VERSION_MAP = [ '7.2' => '7.2', '7.3' => '7.3', '7.4' => '7.4', '8.0' => '8.0.14', - '8.1' => '8.1.1' + '8.1' => '8.1.1', + '8.2' => '8.2' ]; private const EDITION_CLI = 'cli'; @@ -303,9 +304,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string [ '{%note%}' => '# This file is automatically generated. Do not edit directly. #', '{%version%}' => self::VERSION_MAP[$phpVersion], - '{%composer_version%}' => $this->semver::satisfies($phpVersion, '<8.0') - ? '1.10.22' - : '2.1.14', + '{%composer_version%}' => $this->getComposerVersion($phpVersion), '{%packages%}' => implode(" \\\n ", array_unique($packages)), '{%docker-php-ext-configure%}' => implode(PHP_EOL, $phpExtCoreConfigOptions), '{%docker-php-ext-install%}' => $phpExtCore @@ -325,4 +324,17 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string ] ); } + + /** + * @param string $phpVersion + * @return string + */ + private function getComposerVersion(string $phpVersion) : string + { + if ($this->semver::satisfies($phpVersion, '<8.0')) { + return '1.10.22'; + } + + return $this->semver::satisfies($phpVersion, '<8.2') ? '2.1.14' : '2.2.18'; + } } diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 8fa9a01a..46b95dde 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -340,7 +340,7 @@ public static function getConfig(): array '>=7.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], ], 'zookeeper' => [ - '>=7.2' => [ + '>=7.2 <8.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, // phpcs:disable self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH @@ -423,10 +423,14 @@ public static function getConfig(): array ], ], 'xdebug' => [ - '>=7.2' => [ + '>=7.2 <8.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.1.2', ], + '>=8.2' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + ], ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], From 864e6c7a54155e5af052b2e1c86a928a9b9cacad Mon Sep 17 00:00:00 2001 From: Rimple Saini Date: Wed, 4 Jan 2023 22:03:53 +0530 Subject: [PATCH 006/113] AC-7423::Upgrade Test Pipeline jenkins job failed while upgrading from 245p1 to 245p2 - Clear composer cache --- images/php/7.4-cli/docker-entrypoint.sh | 1 + images/php/8.0-cli/docker-entrypoint.sh | 1 + images/php/8.1-cli/docker-entrypoint.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/images/php/7.4-cli/docker-entrypoint.sh b/images/php/7.4-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/7.4-cli/docker-entrypoint.sh +++ b/images/php/7.4-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.0-cli/docker-entrypoint.sh b/images/php/8.0-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/8.0-cli/docker-entrypoint.sh +++ b/images/php/8.0-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.1-cli/docker-entrypoint.sh b/images/php/8.1-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/8.1-cli/docker-entrypoint.sh +++ b/images/php/8.1-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ From cd00c87b47ca068070636576cb9fb7906437dec1 Mon Sep 17 00:00:00 2001 From: Rimple Saini Date: Thu, 5 Jan 2023 00:08:06 +0530 Subject: [PATCH 007/113] AC-7423::Upgrade Test Pipeline jenkins job failed while upgrading - Clear composer cache --- images/php/8.2-cli/docker-entrypoint.sh | 1 + images/php/cli/docker-entrypoint.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/images/php/8.2-cli/docker-entrypoint.sh b/images/php/8.2-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/8.2-cli/docker-entrypoint.sh +++ b/images/php/8.2-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/cli/docker-entrypoint.sh b/images/php/cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100755 --- a/images/php/cli/docker-entrypoint.sh +++ b/images/php/cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ From 91ab379ac36004c88458f560a4e697e68fcd6af8 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 17 Jan 2023 15:37:29 -0600 Subject: [PATCH 008/113] MCLOUD-9856: Bump MCD version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bdee8976..55559df2 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.4", + "version": "1.3.5", "license": [ "OSL-3.0", "AFL-3.0" From 06a392d8d0c0a30db7ad4c69f63f4a4cfcde9a0d Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 14 Feb 2023 14:48:54 -0600 Subject: [PATCH 009/113] MCLOUD-9951: MCD uses wrong OpenSearch version for Magento 2.4.6 --- .../ProductionBuilder/Service/OpenSearch.php | 24 +- src/Test/Integration/BuildComposeTest.php | 18 ++ .../.docker/config.php.dist | 2 +- .../.magento/services.yaml | 2 +- .../docker-compose.exp.yml | 2 +- .../cloud_base_os_2.3_cli/.docker/.gitignore | 0 .../.docker/config.php.dist | 75 ++++++ .../cloud_base_os_2.3_cli/.magento.app.yaml | 30 +++ .../.magento/services.yaml | 22 ++ .../cloud_base_os_2.3_cli/composer.json | 6 + .../docker-compose.exp.yml | 234 ++++++++++++++++++ .../cloud_base_os_2_cli/.docker/.gitignore | 0 .../.docker/config.php.dist | 75 ++++++ .../cloud_base_os_2_cli/.magento.app.yaml | 30 +++ .../.magento/services.yaml | 22 ++ .../_files/cloud_base_os_2_cli/composer.json | 6 + .../docker-compose.exp.yml | 234 ++++++++++++++++++ 17 files changed, 778 insertions(+), 4 deletions(-) create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/composer.json create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml diff --git a/src/Compose/ProductionBuilder/Service/OpenSearch.php b/src/Compose/ProductionBuilder/Service/OpenSearch.php index 79056fc0..32519de2 100644 --- a/src/Compose/ProductionBuilder/Service/OpenSearch.php +++ b/src/Compose/ProductionBuilder/Service/OpenSearch.php @@ -18,8 +18,16 @@ */ class OpenSearch implements ServiceBuilderInterface { + /** + * The list of installed plugins by default + */ private const INSTALLED_PLUGINS = ['analysis-icu', 'analysis-phonetic']; + /** + * The default OpenSearch version, which will be used if config has only major version + */ + private const DEFAULT_VERSION = '2.4'; + /** * @var ServiceFactory */ @@ -75,7 +83,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), - $config->getServiceVersion($this->getServiceName()), + $this->getVersion($config), !empty($osEnvVars) ? ['environment' => $osEnvVars] : [], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), @@ -98,4 +106,18 @@ public function getDependsOn(Config $config): array { return []; } + + /** + * If config has only major version 2 - returns default OpenSearch version for MCD + * @see OpenSearch::DEFAULT_VERSION + * + * @param Config $config + * @return string + * @throws \Magento\CloudDocker\App\ConfigurationMismatchException + */ + private function getVersion(Config $config): string + { + $version = $config->getServiceVersion($this->getServiceName()); + return $version == '2' ? self::DEFAULT_VERSION : $version; + } } diff --git a/src/Test/Integration/BuildComposeTest.php b/src/Test/Integration/BuildComposeTest.php index 707c262f..288f5635 100644 --- a/src/Test/Integration/BuildComposeTest.php +++ b/src/Test/Integration/BuildComposeTest.php @@ -82,6 +82,24 @@ public function buildDataProvider(): array [CliSource::OPTION_WITH_MARIADB_CONF, true] ] ], + 'cloud-base-os-2-cli' => [ + __DIR__ . '/_files/cloud_base_os_2_cli', + [ + [CliSource::OPTION_MODE, BuilderFactory::BUILDER_PRODUCTION], + [CliSource::OPTION_WITH_ENTRYPOINT, true], + [CliSource::OPTION_WITH_MARIADB_CONF, true], + [CliSource::OPTION_OS, '2'], + ] + ], + 'cloud-base-os-2.3-cli' => [ + __DIR__ . '/_files/cloud_base_os_2.3_cli', + [ + [CliSource::OPTION_MODE, BuilderFactory::BUILDER_PRODUCTION], + [CliSource::OPTION_WITH_ENTRYPOINT, true], + [CliSource::OPTION_WITH_MARIADB_CONF, true], + [CliSource::OPTION_OS, '2.3'], + ] + ], 'custom_registry' => [ __DIR__ . '/_files/custom_registry', [ diff --git a/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist b/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist index 73c31674..f0e88e79 100644 --- a/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist +++ b/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist @@ -30,7 +30,7 @@ return [ [ 'host' => 'opensearch', 'port' => '9200', - 'type' => 'opensearch:1.1' + 'type' => 'opensearch:2' ] ] ])), diff --git a/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml b/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml index cad17cb8..f2b85f32 100644 --- a/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml +++ b/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml @@ -14,7 +14,7 @@ elasticsearch: - plugin_2 opensearch: - type: opensearchsearch:1.1 + type: opensearchsearch:2 disk: 512 configuration: plugins: diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index 4282169c..e56337e6 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -65,7 +65,7 @@ services: - elasticsearch.magento2.docker opensearch: hostname: opensearch.magento2.docker - image: 'magento/magento-cloud-docker-opensearch:1.1-1.2.0' + image: 'magento/magento-cloud-docker-opensearch:2.4-1.2.0' ulimits: memlock: soft: -1 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist new file mode 100644 index 00000000..a6fc549b --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist @@ -0,0 +1,75 @@ + base64_encode(json_encode([ + 'database' => [ + [ + 'host' => 'db', + 'path' => 'magento2', + 'password' => 'magento2', + 'username' => 'magento2', + 'port' => '3306', + 'type' => 'mysql:10.2' + ] + ], + 'redis' => [ + [ + 'host' => 'redis', + 'port' => '6379', + 'type' => 'redis:5.0' + ] + ], + 'elasticsearch' => [ + [ + 'host' => 'elasticsearch', + 'port' => '9200', + 'type' => 'elasticsearch:6.5' + ] + ], + 'opensearch' => [ + [ + 'host' => 'opensearch', + 'port' => '9200', + 'type' => 'opensearch:2.3' + ] + ] + ])), + 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ + 'http://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'http://{default}' + ], + 'https://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'https://{default}' + ] + ])), + 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ + 'ADMIN_EMAIL' => 'admin@example.com', + 'ADMIN_PASSWORD' => '123123q', + 'ADMIN_URL' => 'admin' + ])), + 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ + 'hooks' => [ + + ], + 'mounts' => [ + 'var' => [ + 'path' => 'var', + 'orig' => 'shared:files/var' + ], + 'app/etc' => [ + 'path' => 'app/etc', + 'orig' => 'shared:files/etc' + ], + 'pub/media' => [ + 'path' => 'pub/media', + 'orig' => 'shared:files/media' + ], + 'pub/static' => [ + 'path' => 'pub/static', + 'orig' => 'shared:files/static' + ] + ] + ])), +]; diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml new file mode 100644 index 00000000..03f4f7b2 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml @@ -0,0 +1,30 @@ +name: magento + +type: php:7.3 +build: + flavor: composer + +runtime: + extensions: + - redis + - xsl + - json + - newrelic + - sodium + +relationships: + database: "mysql:mysql" + redis: "redis:redis" + elasticsearch: "elasticsearch:elasticsearch" + opensearch: "opensearch:opensearch" + +mounts: + "var": "shared:files/var" + "app/etc": "shared:files/etc" + "pub/media": "shared:files/media" + "pub/static": "shared:files/static" + +crons: + cronrun: + spec: "* * * * *" + cmd: "php bin/magento cron:run" diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml new file mode 100644 index 00000000..cad17cb8 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml @@ -0,0 +1,22 @@ +mysql: + type: mysql:10.2 + disk: 2048 + +redis: + type: redis:5.0 + +elasticsearch: + type: elasticsearch:6.5 + disk: 1024 + configuration: + plugins: + - plugin_1 + - plugin_2 + +opensearch: + type: opensearchsearch:1.1 + disk: 512 + configuration: + plugins: + - plugin_3 + - plugin_4 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json b/src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json new file mode 100644 index 00000000..6ed415ed --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json @@ -0,0 +1,6 @@ +{ + "name": "magento/project-enterprise-edition", + "description": "Composer file for integration tests", + "type": "project", + "version": "2.2.0" +} diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml new file mode 100644 index 00000000..e5ec19e0 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -0,0 +1,234 @@ +version: '2.1' +services: + db: + hostname: db.magento2.docker + image: 'mariadb:10.2' + shm_size: 2gb + environment: + - MYSQL_ROOT_PASSWORD=magento2 + - MYSQL_DATABASE=magento2 + - MYSQL_USER=magento2 + - MYSQL_PASSWORD=magento2 + ports: + - '3306' + volumes: + - '.docker/mnt:/mnt:rw,delegated' + - '.docker/mysql/mariadb.conf.d:/etc/mysql/mariadb.conf.d' + - 'magento-magento-db:/var/lib/mysql' + - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' + healthcheck: + test: 'mysqladmin ping -h localhost -pmagento2' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - db.magento2.docker + redis: + hostname: redis.magento2.docker + image: 'redis:5.0' + volumes: + - /data + ports: + - 6379 + sysctls: + net.core.somaxconn: 1024 + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + healthcheck: + test: 'redis-cli ping || exit 1' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - redis.magento2.docker + elasticsearch: + hostname: elasticsearch.magento2.docker + image: 'magento/magento-cloud-docker-elasticsearch:6.5-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - bootstrap.memory_lock=true + - 'ES_PLUGINS=plugin_1 plugin_2' + networks: + magento: + aliases: + - elasticsearch.magento2.docker + opensearch: + hostname: opensearch.magento2.docker + image: 'magento/magento-cloud-docker-opensearch:2.3-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - discovery.type=single-node + - discovery.seed_hosts=opensearch + - bootstrap.memory_lock=true + - DISABLE_SECURITY_PLUGIN=true + - 'OS_PLUGINS=plugin_3 plugin_4' + networks: + magento: + aliases: + - opensearch.magento2.docker + fpm: + hostname: fpm.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - fpm.magento2.docker + depends_on: + db: + condition: service_healthy + web: + hostname: web.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + environment: + - WITH_XDEBUG=0 + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + networks: + magento: + aliases: + - web.magento2.docker + depends_on: + fpm: + condition: service_started + varnish: + hostname: varnish.magento2.docker + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' + networks: + magento: + aliases: + - varnish.magento2.docker + depends_on: + web: + condition: service_started + tls: + hostname: tls.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + networks: + magento: + aliases: + - magento2.docker + environment: + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + - UPSTREAM_HOST=varnish + - UPSTREAM_PORT=80 + ports: + - '80:80' + - '443:443' + depends_on: + varnish: + condition: service_started + generic: + hostname: generic.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + env_file: ./.docker/config.env + environment: + - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' + - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' + build: + hostname: build.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:rw,delegated' + - 'magento-vendor:/app/vendor:rw,delegated' + - 'magento-generated:/app/generated:rw,delegated' + - '~/.composer/cache:/composer/cache:rw,delegated' + networks: + magento-build: + aliases: + - build.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + deploy: + hostname: deploy.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - deploy.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + mailhog: + hostname: mailhog.magento2.docker + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' + ports: + - '1025:1025' + - '8025:8025' + networks: + magento: + aliases: + - mailhog.magento2.docker +volumes: + magento-vendor: { } + magento-generated: { } + magento-var: { } + magento-app-etc: { } + magento-pub-media: { } + magento-pub-static: { } + magento-magento-db: { } +networks: + magento: + driver: bridge + magento-build: + driver: bridge diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore b/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist b/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist new file mode 100644 index 00000000..f0e88e79 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist @@ -0,0 +1,75 @@ + base64_encode(json_encode([ + 'database' => [ + [ + 'host' => 'db', + 'path' => 'magento2', + 'password' => 'magento2', + 'username' => 'magento2', + 'port' => '3306', + 'type' => 'mysql:10.2' + ] + ], + 'redis' => [ + [ + 'host' => 'redis', + 'port' => '6379', + 'type' => 'redis:5.0' + ] + ], + 'elasticsearch' => [ + [ + 'host' => 'elasticsearch', + 'port' => '9200', + 'type' => 'elasticsearch:6.5' + ] + ], + 'opensearch' => [ + [ + 'host' => 'opensearch', + 'port' => '9200', + 'type' => 'opensearch:2' + ] + ] + ])), + 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ + 'http://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'http://{default}' + ], + 'https://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'https://{default}' + ] + ])), + 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ + 'ADMIN_EMAIL' => 'admin@example.com', + 'ADMIN_PASSWORD' => '123123q', + 'ADMIN_URL' => 'admin' + ])), + 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ + 'hooks' => [ + + ], + 'mounts' => [ + 'var' => [ + 'path' => 'var', + 'orig' => 'shared:files/var' + ], + 'app/etc' => [ + 'path' => 'app/etc', + 'orig' => 'shared:files/etc' + ], + 'pub/media' => [ + 'path' => 'pub/media', + 'orig' => 'shared:files/media' + ], + 'pub/static' => [ + 'path' => 'pub/static', + 'orig' => 'shared:files/static' + ] + ] + ])), +]; diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml new file mode 100644 index 00000000..03f4f7b2 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml @@ -0,0 +1,30 @@ +name: magento + +type: php:7.3 +build: + flavor: composer + +runtime: + extensions: + - redis + - xsl + - json + - newrelic + - sodium + +relationships: + database: "mysql:mysql" + redis: "redis:redis" + elasticsearch: "elasticsearch:elasticsearch" + opensearch: "opensearch:opensearch" + +mounts: + "var": "shared:files/var" + "app/etc": "shared:files/etc" + "pub/media": "shared:files/media" + "pub/static": "shared:files/static" + +crons: + cronrun: + spec: "* * * * *" + cmd: "php bin/magento cron:run" diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml new file mode 100644 index 00000000..cad17cb8 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml @@ -0,0 +1,22 @@ +mysql: + type: mysql:10.2 + disk: 2048 + +redis: + type: redis:5.0 + +elasticsearch: + type: elasticsearch:6.5 + disk: 1024 + configuration: + plugins: + - plugin_1 + - plugin_2 + +opensearch: + type: opensearchsearch:1.1 + disk: 512 + configuration: + plugins: + - plugin_3 + - plugin_4 diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/composer.json b/src/Test/Integration/_files/cloud_base_os_2_cli/composer.json new file mode 100644 index 00000000..6ed415ed --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/composer.json @@ -0,0 +1,6 @@ +{ + "name": "magento/project-enterprise-edition", + "description": "Composer file for integration tests", + "type": "project", + "version": "2.2.0" +} diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml new file mode 100644 index 00000000..c385367a --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -0,0 +1,234 @@ +version: '2.1' +services: + db: + hostname: db.magento2.docker + image: 'mariadb:10.2' + shm_size: 2gb + environment: + - MYSQL_ROOT_PASSWORD=magento2 + - MYSQL_DATABASE=magento2 + - MYSQL_USER=magento2 + - MYSQL_PASSWORD=magento2 + ports: + - '3306' + volumes: + - '.docker/mnt:/mnt:rw,delegated' + - '.docker/mysql/mariadb.conf.d:/etc/mysql/mariadb.conf.d' + - 'magento-magento-db:/var/lib/mysql' + - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' + healthcheck: + test: 'mysqladmin ping -h localhost -pmagento2' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - db.magento2.docker + redis: + hostname: redis.magento2.docker + image: 'redis:5.0' + volumes: + - /data + ports: + - 6379 + sysctls: + net.core.somaxconn: 1024 + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + healthcheck: + test: 'redis-cli ping || exit 1' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - redis.magento2.docker + elasticsearch: + hostname: elasticsearch.magento2.docker + image: 'magento/magento-cloud-docker-elasticsearch:6.5-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - bootstrap.memory_lock=true + - 'ES_PLUGINS=plugin_1 plugin_2' + networks: + magento: + aliases: + - elasticsearch.magento2.docker + opensearch: + hostname: opensearch.magento2.docker + image: 'magento/magento-cloud-docker-opensearch:2.4-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - discovery.type=single-node + - discovery.seed_hosts=opensearch + - bootstrap.memory_lock=true + - DISABLE_SECURITY_PLUGIN=true + - 'OS_PLUGINS=plugin_3 plugin_4' + networks: + magento: + aliases: + - opensearch.magento2.docker + fpm: + hostname: fpm.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - fpm.magento2.docker + depends_on: + db: + condition: service_healthy + web: + hostname: web.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + environment: + - WITH_XDEBUG=0 + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + networks: + magento: + aliases: + - web.magento2.docker + depends_on: + fpm: + condition: service_started + varnish: + hostname: varnish.magento2.docker + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' + networks: + magento: + aliases: + - varnish.magento2.docker + depends_on: + web: + condition: service_started + tls: + hostname: tls.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + networks: + magento: + aliases: + - magento2.docker + environment: + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + - UPSTREAM_HOST=varnish + - UPSTREAM_PORT=80 + ports: + - '80:80' + - '443:443' + depends_on: + varnish: + condition: service_started + generic: + hostname: generic.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + env_file: ./.docker/config.env + environment: + - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' + - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' + build: + hostname: build.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:rw,delegated' + - 'magento-vendor:/app/vendor:rw,delegated' + - 'magento-generated:/app/generated:rw,delegated' + - '~/.composer/cache:/composer/cache:rw,delegated' + networks: + magento-build: + aliases: + - build.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + deploy: + hostname: deploy.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - deploy.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + mailhog: + hostname: mailhog.magento2.docker + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' + ports: + - '1025:1025' + - '8025:8025' + networks: + magento: + aliases: + - mailhog.magento2.docker +volumes: + magento-vendor: { } + magento-generated: { } + magento-var: { } + magento-app-etc: { } + magento-pub-media: { } + magento-pub-static: { } + magento-magento-db: { } +networks: + magento: + driver: bridge + magento-build: + driver: bridge From 52012b18c90fc21eeb0fcdfc830676c635b16b04 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 1 Mar 2023 14:28:34 -0600 Subject: [PATCH 010/113] MCLOUD-9902: Add FT to Magento Cloud Tools for PHP 8.2 & Magento 2.4.6 (#109) --- composer.json | 2 +- .../Functional/Acceptance/AbstractCest.php | 4 +- .../Acceptance/Acceptance81Cest.php | 21 ++++++++ .../Functional/Acceptance/AcceptanceCest.php | 4 +- .../Functional/Acceptance/DeveloperCest.php | 4 +- .../Acceptance/Elasticsearch81Cest.php | 43 +++++++++++++++ .../Acceptance/ElasticsearchCest.php | 6 +-- .../Functional/Acceptance/MailHogCest.php | 4 +- .../Acceptance/Opensearch81Cest.php | 54 +++++++++++++++++++ .../Functional/Acceptance/OpensearchCest.php | 17 ++++-- 10 files changed, 144 insertions(+), 15 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Acceptance81Cest.php create mode 100644 src/Test/Functional/Acceptance/Elasticsearch81Cest.php create mode 100644 src/Test/Functional/Acceptance/Opensearch81Cest.php diff --git a/composer.json b/composer.json index 55559df2..dff91e7a 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "codeception/module-db": "^1.0", "codeception/module-phpbrowser": "^1.0", "codeception/module-rest": "^1.2", - "consolidation/robo": "^1.2", + "consolidation/robo": "^1.2 || ^2.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^8.5 || ^9.5", diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index e9432f19..14f5e603 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,9 +33,9 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.3.1'); + $I->createArtifactCurrentTestedCode('docker', '1.3.5'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.3.1'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.3.5'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( diff --git a/src/Test/Functional/Acceptance/Acceptance81Cest.php b/src/Test/Functional/Acceptance/Acceptance81Cest.php new file mode 100644 index 00000000..c748f419 --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance81Cest.php @@ -0,0 +1,21 @@ + '7.6', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/ElasticsearchCest.php b/src/Test/Functional/Acceptance/ElasticsearchCest.php index 98e29c77..7ecdb78b 100644 --- a/src/Test/Functional/Acceptance/ElasticsearchCest.php +++ b/src/Test/Functional/Acceptance/ElasticsearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php81 + * @group php82 */ class ElasticsearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.4'; + protected const TEMPLATE_VERSION = '2.4.6'; /** * @param CliTester $I @@ -81,7 +81,7 @@ protected function dataProvider(): array { return [ [ - 'version' => '7.6', + 'version' => '7.10', 'xms' => '520m', 'xmx' => '520m', 'plugins' => ['analysis-nori'], diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 96e74941..0ef9461e 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -8,14 +8,14 @@ namespace Magento\CloudDocker\Test\Functional\Acceptance; /** - * @group php81 + * @group php82 */ class MailHogCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.4'; + protected const TEMPLATE_VERSION = '2.4.6'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/Opensearch81Cest.php b/src/Test/Functional/Acceptance/Opensearch81Cest.php new file mode 100644 index 00000000..cd49356a --- /dev/null +++ b/src/Test/Functional/Acceptance/Opensearch81Cest.php @@ -0,0 +1,54 @@ + '1.1', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + [ + 'version' => '1.2', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/OpensearchCest.php b/src/Test/Functional/Acceptance/OpensearchCest.php index 4ebcf492..74271ada 100644 --- a/src/Test/Functional/Acceptance/OpensearchCest.php +++ b/src/Test/Functional/Acceptance/OpensearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php81 + * @group php82 */ class OpensearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.4'; + protected const TEMPLATE_VERSION = '2.4.6'; /** * @param CliTester $I @@ -81,7 +81,18 @@ protected function dataProvider(): array { return [ [ - 'version' => '1.2', + 'version' => '2.3', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + [ + 'version' => '2.4', 'xms' => '520m', 'xmx' => '520m', 'plugins' => ['analysis-nori'], From b583dce2ad43597f3c3267ed339a773e7daa613f Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 31 May 2023 11:40:53 -0500 Subject: [PATCH 011/113] MCLOUD-10593: Add needed services to MCD for Magento 2.4.7 & 2.4.6-p1 (#113) --- images/opensearch/2.5/Dockerfile | 21 +++++++++++++++++++++ images/opensearch/2.5/docker-entrypoint.sh | 12 ++++++++++++ images/opensearch/2.5/docker-healthcheck.sh | 12 ++++++++++++ src/Command/Image/GenerateOs.php | 3 +++ 4 files changed, 48 insertions(+) create mode 100644 images/opensearch/2.5/Dockerfile create mode 100755 images/opensearch/2.5/docker-entrypoint.sh create mode 100644 images/opensearch/2.5/docker-healthcheck.sh diff --git a/images/opensearch/2.5/Dockerfile b/images/opensearch/2.5/Dockerfile new file mode 100644 index 00000000..a1b197fa --- /dev/null +++ b/images/opensearch/2.5/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.5.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/2.5/docker-entrypoint.sh b/images/opensearch/2.5/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.5/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/2.5/docker-healthcheck.sh b/images/opensearch/2.5/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.5/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index f2ebefab..2b71aabe 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -39,6 +39,9 @@ class GenerateOs extends Command ], '2.4' => [ 'real-version' => '2.4.0' + ], + '2.5' => [ + 'real-version' => '2.5.0' ] ]; From 1dc3a11140faea24826b93a02d29163988903156 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 11 Jul 2023 12:27:47 -0500 Subject: [PATCH 012/113] MCLOUD-10406: update magento/magento-cloud-docker-php:8.2-cli-1.3.5 to stop clearing composer cache --- images/php/7.2-cli/Dockerfile | 1 + images/php/7.2-cli/docker-entrypoint.sh | 4 ++++ images/php/7.3-cli/Dockerfile | 1 + images/php/7.3-cli/docker-entrypoint.sh | 4 ++++ images/php/7.4-cli/Dockerfile | 1 + images/php/7.4-cli/docker-entrypoint.sh | 5 ++++- images/php/8.0-cli/Dockerfile | 1 + images/php/8.0-cli/docker-entrypoint.sh | 5 ++++- images/php/8.1-cli/Dockerfile | 1 + images/php/8.1-cli/docker-entrypoint.sh | 5 ++++- images/php/8.2-cli/Dockerfile | 1 + images/php/8.2-cli/docker-entrypoint.sh | 5 ++++- images/php/cli/Dockerfile | 1 + images/php/cli/docker-entrypoint.sh | 5 ++++- 14 files changed, 35 insertions(+), 5 deletions(-) diff --git a/images/php/7.2-cli/Dockerfile b/images/php/7.2-cli/Dockerfile index d474c800..39f17216 100644 --- a/images/php/7.2-cli/Dockerfile +++ b/images/php/7.2-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/7.2-cli/docker-entrypoint.sh b/images/php/7.2-cli/docker-entrypoint.sh index 1e025ca7..ee380b80 100644 --- a/images/php/7.2-cli/docker-entrypoint.sh +++ b/images/php/7.2-cli/docker-entrypoint.sh @@ -17,6 +17,10 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ composer self-update $COMPOSER_VERSION diff --git a/images/php/7.3-cli/Dockerfile b/images/php/7.3-cli/Dockerfile index 065b9b45..6d424736 100644 --- a/images/php/7.3-cli/Dockerfile +++ b/images/php/7.3-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/7.3-cli/docker-entrypoint.sh b/images/php/7.3-cli/docker-entrypoint.sh index 1e025ca7..ee380b80 100644 --- a/images/php/7.3-cli/docker-entrypoint.sh +++ b/images/php/7.3-cli/docker-entrypoint.sh @@ -17,6 +17,10 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ composer self-update $COMPOSER_VERSION diff --git a/images/php/7.4-cli/Dockerfile b/images/php/7.4-cli/Dockerfile index 108426f4..09765fe8 100644 --- a/images/php/7.4-cli/Dockerfile +++ b/images/php/7.4-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/7.4-cli/docker-entrypoint.sh b/images/php/7.4-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/7.4-cli/docker-entrypoint.sh +++ b/images/php/7.4-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index e00a862f..d589d990 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/8.0-cli/docker-entrypoint.sh b/images/php/8.0-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/8.0-cli/docker-entrypoint.sh +++ b/images/php/8.0-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 651f17d9..e2a36392 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/8.1-cli/docker-entrypoint.sh b/images/php/8.1-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/8.1-cli/docker-entrypoint.sh +++ b/images/php/8.1-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index f5bebb6a..4d015234 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/8.2-cli/docker-entrypoint.sh b/images/php/8.2-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/8.2-cli/docker-entrypoint.sh +++ b/images/php/8.2-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/cli/Dockerfile b/images/php/cli/Dockerfile index b793da07..835d6bd6 100755 --- a/images/php/cli/Dockerfile +++ b/images/php/cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false diff --git a/images/php/cli/docker-entrypoint.sh b/images/php/cli/docker-entrypoint.sh index f26def5d..ee380b80 100755 --- a/images/php/cli/docker-entrypoint.sh +++ b/images/php/cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ From e8e2b14cc9329a73cf768fcf374ae40a23e2e6a7 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 13 Jul 2023 14:49:38 -0500 Subject: [PATCH 013/113] MCLOUD-10406: update magento/magento-cloud-docker-php:8.2-cli-1.3.5 to stop clearing composer cache --- images/php/7.2-cli/Dockerfile | 5 ++--- images/php/7.3-cli/Dockerfile | 5 ++--- images/php/7.4-cli/Dockerfile | 5 ++--- images/php/8.0-cli/Dockerfile | 5 ++--- images/php/8.1-cli/Dockerfile | 5 ++--- images/php/8.2-cli/Dockerfile | 6 +++--- images/php/8.2-fpm/Dockerfile | 1 + images/php/cli/Dockerfile | 5 ++--- src/Command/Image/GeneratePhp.php | 8 ++++++++ 9 files changed, 24 insertions(+), 21 deletions(-) diff --git a/images/php/7.2-cli/Dockerfile b/images/php/7.2-cli/Dockerfile index 39f17216..712c1f95 100644 --- a/images/php/7.2-cli/Dockerfile +++ b/images/php/7.2-cli/Dockerfile @@ -83,9 +83,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/7.3-cli/Dockerfile b/images/php/7.3-cli/Dockerfile index 6d424736..0cc15df7 100644 --- a/images/php/7.3-cli/Dockerfile +++ b/images/php/7.3-cli/Dockerfile @@ -81,9 +81,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/7.4-cli/Dockerfile b/images/php/7.4-cli/Dockerfile index 09765fe8..949519b7 100644 --- a/images/php/7.4-cli/Dockerfile +++ b/images/php/7.4-cli/Dockerfile @@ -77,9 +77,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index d589d990..45dd71d1 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -74,9 +74,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index e2a36392..99010a5f 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -74,9 +74,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index 4d015234..dbafd471 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -72,11 +72,11 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages + # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.2-fpm/Dockerfile b/images/php/8.2-fpm/Dockerfile index 7ae884d7..de75c9a5 100644 --- a/images/php/8.2-fpm/Dockerfile +++ b/images/php/8.2-fpm/Dockerfile @@ -53,6 +53,7 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog diff --git a/images/php/cli/Dockerfile b/images/php/cli/Dockerfile index 835d6bd6..f42d1d1b 100755 --- a/images/php/cli/Dockerfile +++ b/images/php/cli/Dockerfile @@ -41,9 +41,8 @@ RUN apt-get update \ {%packages%} \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +{%python_packages%} # Install Grunt RUN npm install -g grunt-cli diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index e33e4c33..ddaee938 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -286,6 +286,13 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } + if ($this->semver::satisfies($phpVersion, '8.2.*')) { + $packages = array_merge($packages, ['python3-yaml']); + $pythonPackages = ''; + } else { + $pythonPackages = 'RUN pip3 install --upgrade setuptools && pip3 install pyyaml'; + } + $volumes = [ 'root' => [ 'def' => 'VOLUME ${MAGENTO_ROOT}', @@ -319,6 +326,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string '{%env_php_extensions%}' => $phpExtEnabledDefault ? 'ENV PHP_EXTENSIONS ' . implode(' ', $phpExtEnabledDefault) : '', + '{%python_packages%}' => $pythonPackages, '{%volumes_cmd%}' => rtrim($volumesCmd), '{%volumes_def%}' => rtrim($volumesDef) ] From 14d04fe582fbb53db6811a81e7bdf54b1f03ce73 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 17 Jul 2023 13:25:25 -0500 Subject: [PATCH 014/113] Update src/Command/Image/GeneratePhp.php Co-authored-by: Michael Casey <12436335+michaelcasey316@users.noreply.github.com> --- src/Command/Image/GeneratePhp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index ddaee938..5ab86f07 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -287,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } if ($this->semver::satisfies($phpVersion, '8.2.*')) { - $packages = array_merge($packages, ['python3-yaml']); + $packages[] = 'python3-yaml' $pythonPackages = ''; } else { $pythonPackages = 'RUN pip3 install --upgrade setuptools && pip3 install pyyaml'; From 11071ba9456d8985d82e85c0144a5c7d68789152 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 17 Jul 2023 13:42:15 -0500 Subject: [PATCH 015/113] MCLOUD-10406: update magento/magento-cloud-docker-php:8.2-cli-1.3.5 to stop clearing composer cache --- src/Command/Image/GeneratePhp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 5ab86f07..238b3052 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -287,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } if ($this->semver::satisfies($phpVersion, '8.2.*')) { - $packages[] = 'python3-yaml' + $packages[] = 'python3-yaml'; $pythonPackages = ''; } else { $pythonPackages = 'RUN pip3 install --upgrade setuptools && pip3 install pyyaml'; From c968e905fa24a33cc8429f9cc85904ef915a9e78 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 25 Jul 2023 20:26:21 -0500 Subject: [PATCH 016/113] MCLOUD-10863: Release MCD 1.3.6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dff91e7a..95eeda60 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.5", + "version": "1.3.6", "license": [ "OSL-3.0", "AFL-3.0" From 1535731c47a6a0b34f1b692471609160838c3f30 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 4 Oct 2023 16:49:45 -0500 Subject: [PATCH 017/113] MAGREQ-8989: Add metadata file to active repos --- .github/.metadata.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/.metadata.json b/.github/.metadata.json index 4f52d256..1c8a4040 100644 --- a/.github/.metadata.json +++ b/.github/.metadata.json @@ -1,14 +1,14 @@ { - "templateVersion": "0.1", + "templateVersion": "0.2", "product": { "name": "Magento Cloud Docker", "description": "The Magento Cloud Docker implementation deploys Cloud projects to a local workstation so that you can develop and test your code in a simulated Cloud environment" }, "contacts": { "team": { - "name": "Magic Mountain", - "DL": "Grp-magento-cloud-all", - "slackChannel": "magic_mountain" + "name": "Mystic Mountain", + "DL": "Grp-Mystic-Mountain", + "slackChannel": "#mystic-mountain-team" } }, "ticketTracker": { @@ -17,10 +17,8 @@ }, "securityJiraQueue": { "projectKey": "MAGREQ", - "component": "Magento Cloud Engineering" + "component": "MAGREQ/Magento Cloud Engineering" } }, - "staticScan": { - "enable": false - } + "productionCodeBranches": ["1.0", "1.1", "1.2", "1.3"] } From ad7b8f9cfcb97b7648cbf5eff20a542b72af28f0 Mon Sep 17 00:00:00 2001 From: nadtochi Date: Thu, 12 Oct 2023 14:27:17 -0500 Subject: [PATCH 018/113] Ticket: MCLOUD-10948 This PR changes version of nginx. Current nginx version: 1.19 will be changed to 1.24 Old version will not be supported. --- images/nginx/{1.19 => 1.24}/Dockerfile | 2 +- images/nginx/{1.19 => 1.24}/docker-entrypoint.sh | 0 images/nginx/{1.19 => 1.24}/etc/nginx.conf | 0 images/nginx/{1.19 => 1.24}/etc/vhost.conf | 0 images/nginx/{1.19 => 1.24}/etc/xdebug-upstream.conf | 0 src/Service/ServiceFactory.php | 2 +- src/Test/Functional/Acceptance/Services72Cest.php | 8 ++++---- src/Test/Functional/Acceptance/ServicesCest.php | 8 ++++---- src/Test/Integration/BuildCustomComposeTest.php | 2 +- .../Integration/_files/cloud_base/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_developer/docker-compose.exp.yml | 4 ++-- .../cloud_base_developer_manual/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_mftf/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_os_2.3_cli/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_os_2_cli/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_test/docker-compose.exp.yml | 4 ++-- .../docker-compose.exp.yml | 4 ++-- .../docker-compose.exp.yml | 4 ++-- .../docker-compose.exp.yml | 4 ++-- .../_files/cloud_no_tls_service/docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../cloud_no_varnish_service/docker-compose.exp.yml | 4 ++-- .../_files/custom_cloud_base/docker-compose.exp.yml | 4 ++-- .../custom_cloud_base_native/docker-compose.exp.yml | 4 ++-- .../custom_cloud_custom_images/docker-compose.exp.yml | 4 ++-- .../custom_cloud_no_tls_service/docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 4 ++-- .../_files/custom_registry/docker-compose.exp.yml | 4 ++-- 29 files changed, 47 insertions(+), 47 deletions(-) rename images/nginx/{1.19 => 1.24}/Dockerfile (98%) rename images/nginx/{1.19 => 1.24}/docker-entrypoint.sh (100%) rename images/nginx/{1.19 => 1.24}/etc/nginx.conf (100%) rename images/nginx/{1.19 => 1.24}/etc/vhost.conf (100%) rename images/nginx/{1.19 => 1.24}/etc/xdebug-upstream.conf (100%) diff --git a/images/nginx/1.19/Dockerfile b/images/nginx/1.24/Dockerfile similarity index 98% rename from images/nginx/1.19/Dockerfile rename to images/nginx/1.24/Dockerfile index e75bac29..ca4a2585 100644 --- a/images/nginx/1.19/Dockerfile +++ b/images/nginx/1.24/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.19 +FROM nginx:1.24 ENV UPLOAD_MAX_FILESIZE 64M ENV XDEBUG_HOST fpm_xdebug diff --git a/images/nginx/1.19/docker-entrypoint.sh b/images/nginx/1.24/docker-entrypoint.sh similarity index 100% rename from images/nginx/1.19/docker-entrypoint.sh rename to images/nginx/1.24/docker-entrypoint.sh diff --git a/images/nginx/1.19/etc/nginx.conf b/images/nginx/1.24/etc/nginx.conf similarity index 100% rename from images/nginx/1.19/etc/nginx.conf rename to images/nginx/1.24/etc/nginx.conf diff --git a/images/nginx/1.19/etc/vhost.conf b/images/nginx/1.24/etc/vhost.conf similarity index 100% rename from images/nginx/1.19/etc/vhost.conf rename to images/nginx/1.24/etc/vhost.conf diff --git a/images/nginx/1.19/etc/xdebug-upstream.conf b/images/nginx/1.24/etc/xdebug-upstream.conf similarity index 100% rename from images/nginx/1.19/etc/xdebug-upstream.conf rename to images/nginx/1.24/etc/xdebug-upstream.conf diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index b04286fb..c52206a5 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -42,7 +42,7 @@ class ServiceFactory */ private const SERVICE_NGINX_CONFIG = [ 'image' => 'magento/magento-cloud-docker-nginx', - 'version' => '1.19', + 'version' => '1.24', 'pattern' => self::PATTERN_VERSIONED, 'config' => [ 'extends' => ServiceInterface::SERVICE_GENERIC, diff --git a/src/Test/Functional/Acceptance/Services72Cest.php b/src/Test/Functional/Acceptance/Services72Cest.php index b627e4bd..65e71849 100644 --- a/src/Test/Functional/Acceptance/Services72Cest.php +++ b/src/Test/Functional/Acceptance/Services72Cest.php @@ -28,7 +28,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2' @@ -40,7 +40,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', @@ -53,7 +53,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', @@ -66,7 +66,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index 52916362..669cf39d 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -92,7 +92,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2' @@ -104,7 +104,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', @@ -117,7 +117,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', @@ -130,7 +130,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', diff --git a/src/Test/Integration/BuildCustomComposeTest.php b/src/Test/Integration/BuildCustomComposeTest.php index 32a5d2b4..de1600c7 100644 --- a/src/Test/Integration/BuildCustomComposeTest.php +++ b/src/Test/Integration/BuildCustomComposeTest.php @@ -248,7 +248,7 @@ public function buildDataProvider(): array ], 'nginx' => [ 'image' => 'nginx-v1', - 'version' => '1.19', + 'version' => '1.24', 'image-pattern' => '%s:%s', 'enabled' => 'true', ], diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index e054a41c..b30d706b 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index e56337e6..9efb15b4 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -96,7 +96,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:delegated' @@ -123,7 +123,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index d8c7d928..974390b4 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -76,7 +76,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - 'magento-app:/app' @@ -103,7 +103,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index 6e8bab5e..f42e86ff 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -72,7 +72,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - './magento2ce:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml index e5ec19e0..7487f54f 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml index c385367a..044e3738 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index 0585618f..ca55c534 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -72,7 +72,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index 53d8630b..ee750e4a 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index 428d8228..e0a50c5a 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index a38f457a..ec1bd183 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index e29152a7..72b7c93f 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index fe34a339..cfb3e7da 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index 519258d7..819e0e80 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index 2b9e82d2..bab4b358 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -46,7 +46,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,7 +80,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index 2b9e82d2..bab4b358 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -46,7 +46,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,7 +80,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml index 5bd8a9e7..e06213a8 100644 --- a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml @@ -84,7 +84,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'nginx-v1:1.19' + image: 'nginx-v1:1.24' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,7 +119,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'nginx-v1:1.19' + image: 'nginx-v1:1.24' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index f2b4ae19..33166249 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml index 026a62e1..876f2b95 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml index 0de6c3ab..152351e0 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -61,7 +61,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index 74f1e281..d7bf7488 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -85,7 +85,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,7 +119,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: From d6cb5a4fde4647b8da0c58ae1589973f1c547903 Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Wed, 3 Jan 2024 22:36:35 +0530 Subject: [PATCH 019/113] Added PHP8.3 --- images/php/8.3-cli/Dockerfile | 193 +++++++++++++++++++++++ images/php/8.3-cli/bin/cloud-build | 44 ++++++ images/php/8.3-cli/bin/cloud-deploy | 37 +++++ images/php/8.3-cli/bin/cloud-post-deploy | 11 ++ images/php/8.3-cli/bin/ece-command | 7 + images/php/8.3-cli/bin/magento-command | 7 + images/php/8.3-cli/bin/magento-installer | 11 ++ images/php/8.3-cli/bin/mftf-command | 7 + images/php/8.3-cli/bin/run-cron | 3 + images/php/8.3-cli/bin/run-hooks | 61 +++++++ images/php/8.3-cli/docker-entrypoint.sh | 35 ++++ images/php/8.3-cli/etc/mail.ini | 2 + images/php/8.3-cli/etc/php-cli.ini | 10 ++ images/php/8.3-cli/etc/php-gnupg.ini | 1 + images/php/8.3-cli/etc/php-pcov.ini | 2 + images/php/8.3-cli/etc/php-xdebug.ini | 8 + images/php/8.3-fpm/Dockerfile | 151 ++++++++++++++++++ images/php/8.3-fpm/docker-entrypoint.sh | 24 +++ images/php/8.3-fpm/etc/mail.ini | 2 + images/php/8.3-fpm/etc/php-fpm.conf | 25 +++ images/php/8.3-fpm/etc/php-fpm.ini | 4 + images/php/8.3-fpm/etc/php-gnupg.ini | 1 + images/php/8.3-fpm/etc/php-pcov.ini | 2 + images/php/8.3-fpm/etc/php-xdebug.ini | 8 + 24 files changed, 656 insertions(+) create mode 100644 images/php/8.3-cli/Dockerfile create mode 100644 images/php/8.3-cli/bin/cloud-build create mode 100644 images/php/8.3-cli/bin/cloud-deploy create mode 100644 images/php/8.3-cli/bin/cloud-post-deploy create mode 100644 images/php/8.3-cli/bin/ece-command create mode 100644 images/php/8.3-cli/bin/magento-command create mode 100644 images/php/8.3-cli/bin/magento-installer create mode 100644 images/php/8.3-cli/bin/mftf-command create mode 100644 images/php/8.3-cli/bin/run-cron create mode 100644 images/php/8.3-cli/bin/run-hooks create mode 100644 images/php/8.3-cli/docker-entrypoint.sh create mode 100644 images/php/8.3-cli/etc/mail.ini create mode 100644 images/php/8.3-cli/etc/php-cli.ini create mode 100644 images/php/8.3-cli/etc/php-gnupg.ini create mode 100644 images/php/8.3-cli/etc/php-pcov.ini create mode 100644 images/php/8.3-cli/etc/php-xdebug.ini create mode 100644 images/php/8.3-fpm/Dockerfile create mode 100644 images/php/8.3-fpm/docker-entrypoint.sh create mode 100644 images/php/8.3-fpm/etc/mail.ini create mode 100644 images/php/8.3-fpm/etc/php-fpm.conf create mode 100644 images/php/8.3-fpm/etc/php-fpm.ini create mode 100644 images/php/8.3-fpm/etc/php-gnupg.ini create mode 100644 images/php/8.3-fpm/etc/php-pcov.ini create mode 100644 images/php/8.3-fpm/etc/php-xdebug.ini diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile new file mode 100644 index 00000000..2af8d4d7 --- /dev/null +++ b/images/php/8.3-cli/Dockerfile @@ -0,0 +1,193 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.3-cli + +ARG COMPOSER_VERSION=2.2.18 +ARG MAGENTO_ROOT=/app +ARG COMPOSER_ALLOW_SUPERUSER=1 +ARG COMPOSER_HOME=/composer +ARG CRONTAB="" + +ENV COMPOSER_MEMORY_LIMIT -1 +ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} +ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false +ENV PHP_MEMORY_LIMIT -1 +ENV PHP_VALIDATE_TIMESTAMPS 1 +ENV DEBUG false +ENV MAGENTO_RUN_MODE production +ENV SENDMAIL_PATH /dev/null +ENV PHPRC ${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl + +# Configure Node.js version +RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + cron \ + git \ + mariadb-client \ + nano \ + nodejs \ + python3 \ + python3-pip \ + redis-tools \ + sendmail-bin \ + sendmail \ + sudo \ + unzip \ + vim \ + openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install Python packages + + +# Install Grunt +RUN npm install -g grunt-cli + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + pspell \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.2.0 \ + xmlrpc-1.0.0RC3 \ + yaml + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini +ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +# Get composer installed to /usr/local/bin/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer + +ADD bin/* /usr/local/bin/ + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +ADD docker-entrypoint.sh /docker-entrypoint.sh + +RUN ["chmod", "+x", \ + "/docker-entrypoint.sh", \ + "/usr/local/bin/magento-installer", \ + "/usr/local/bin/magento-command", \ + "/usr/local/bin/mftf-command", \ + "/usr/local/bin/ece-command", \ + "/usr/local/bin/cloud-build", \ + "/usr/local/bin/cloud-deploy", \ + "/usr/local/bin/cloud-post-deploy", \ + "/usr/local/bin/run-cron", \ + "/usr/local/bin/run-hooks" \ +] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["bash"] diff --git a/images/php/8.3-cli/bin/cloud-build b/images/php/8.3-cli/bin/cloud-build new file mode 100644 index 00000000..bbd584c9 --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-build @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +RUN_HOOKS="run-hooks" + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Cleaning directories:" + + if [ "$INSTALLATION_TYPE" == "composer" ]; then + echo "Cleaning setup directory." + rm -rf $MAGENTO_ROOT/setup/* + fi + + echo "Cleaning vendor directory." + rm -rf $MAGENTO_ROOT/vendor/* + + echo "Cleaning generated directory." + rm -rf $MAGENTO_ROOT/generated/* + + echo "Removing app/etc/env.php file" + rm -f $MAGENTO_ROOT/app/etc/env.php +fi + +echo "Installing dependencies." + +composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist + +echo "Running \"build\" hook." + +$RUN_HOOKS build + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Setting file permissions." + + chown -R www:www $MAGENTO_ROOT + + find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; + find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; +fi + +echo "Building complete." diff --git a/images/php/8.3-cli/bin/cloud-deploy b/images/php/8.3-cli/bin/cloud-deploy new file mode 100644 index 00000000..f6b891bf --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-deploy @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"deploy\" hook." + +run-hooks deploy + +# check that Varnish exists +if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then + minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") + if [[ "$minor_magento_version" != "2.1" ]]; then + output=$(magento-command config:set system/full_page_cache/caching_application 2) + # as config:set does not return error code, we check output text to continue set varnish settings + if [[ $output == *"Value was saved"* ]]; then + echo "Setting Varnish for Magento FPC." + magento-command setup:config:set --http-cache-hosts=varnish -n + else + echo $output + fi + fi +fi + +# set developer mode if it is configured in $MAGENTO_RUN_MODE +if [ "$MAGENTO_RUN_MODE" == "developer" ]; then + output=$(magento-command deploy:mode:set developer) + if [[ $output == *"Enabled developer mode."* ]]; then + echo "Enabled developer mode." + else + echo $output + fi +fi + + +echo "Deployment finished." diff --git a/images/php/8.3-cli/bin/cloud-post-deploy b/images/php/8.3-cli/bin/cloud-post-deploy new file mode 100644 index 00000000..f5bb3956 --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-post-deploy @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"post-deploy\" hook." + +run-hooks post_deploy + +echo "Post deployment finished." diff --git a/images/php/8.3-cli/bin/ece-command b/images/php/8.3-cli/bin/ece-command new file mode 100644 index 00000000..36d896c5 --- /dev/null +++ b/images/php/8.3-cli/bin/ece-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" + +exec $ECE_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/magento-command b/images/php/8.3-cli/bin/magento-command new file mode 100644 index 00000000..8d439f7d --- /dev/null +++ b/images/php/8.3-cli/bin/magento-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" + +exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/magento-installer b/images/php/8.3-cli/bin/magento-installer new file mode 100644 index 00000000..73645ab7 --- /dev/null +++ b/images/php/8.3-cli/bin/magento-installer @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +BUILD_COMMAND="cloud-build" +DEPLOY_COMMAND="cloud-deploy" + +$BUILD_COMMAND +$DEPLOY_COMMAND diff --git a/images/php/8.3-cli/bin/mftf-command b/images/php/8.3-cli/bin/mftf-command new file mode 100644 index 00000000..88eaa1df --- /dev/null +++ b/images/php/8.3-cli/bin/mftf-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" + +exec $MFTF_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/run-cron b/images/php/8.3-cli/bin/run-cron new file mode 100644 index 00000000..f6554a5c --- /dev/null +++ b/images/php/8.3-cli/bin/run-cron @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.3-cli/bin/run-hooks b/images/php/8.3-cli/bin/run-hooks new file mode 100644 index 00000000..8ac215c9 --- /dev/null +++ b/images/php/8.3-cli/bin/run-hooks @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import os +import sys +import subprocess +import json +import base64 + +# Disable output buffering. +os.environ['PYTHONUNBUFFERED'] = "1" + +# The list of available hooks. +available_hooks = ["build", "deploy", "post_deploy"] + + +# Prints a message and returns an exit code. +def error_exit(msg, code=1): + print(msg) + sys.exit(code) + + +# Gets Magento root path. +def get_magento_root(): + try: + return str(os.environ['MAGENTO_ROOT']) + except KeyError: + error_exit('Environment variable MAGENTO_ROOT is not available') + + +# Gets set hooks by hook name. +def get_hooks(hook_name): + try: + application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) + content = json.loads(base64.b64decode(application).decode("utf-8")) + + return content['hooks'][hook_name] + except Exception as exc: + error_exit("Cannot decode string: " + str(exc)) + + +# Main function. +def main(): + if len(sys.argv) != 2: + error_exit("Usage: run-hooks ") + + hook_name = str(sys.argv[1]) + if hook_name not in available_hooks: + error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) + + try: + subprocess.check_call( + get_hooks(hook_name), + shell=True, + cwd=get_magento_root() + ) + except subprocess.CalledProcessError as exc: + error_exit("returned non-zero exit status " + str(exc.returncode)) + + +if __name__ == '__main__': + main() diff --git a/images/php/8.3-cli/docker-entrypoint.sh b/images/php/8.3-cli/docker-entrypoint.sh new file mode 100644 index 00000000..ee380b80 --- /dev/null +++ b/images/php/8.3-cli/docker-entrypoint.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +if [ ! -z "${CRONTAB}" ]; then + echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log +fi + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + +# Configure composer +[ ! -z "${COMPOSER_VERSION}" ] && \ + composer self-update $COMPOSER_VERSION + +[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ + composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN + +[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ + composer config --global http-basic.repo.magento.com \ + $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD + +exec "$@" diff --git a/images/php/8.3-cli/etc/mail.ini b/images/php/8.3-cli/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.3-cli/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.3-cli/etc/php-cli.ini b/images/php/8.3-cli/etc/php-cli.ini new file mode 100644 index 00000000..dfaf04e4 --- /dev/null +++ b/images/php/8.3-cli/etc/php-cli.ini @@ -0,0 +1,10 @@ +; php.ini +memory_limit = ${PHP_MEMORY_LIMIT} +zlib.output_compression = on +realpath_cache_size = 32k +realpath_cache_ttl = 7200 +always_populate_raw_post_data = -1 +max_input_vars = 10000 +session.gc_probability = 1 +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/8.3-cli/etc/php-gnupg.ini b/images/php/8.3-cli/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.3-cli/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.3-cli/etc/php-pcov.ini b/images/php/8.3-cli/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.3-cli/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.3-cli/etc/php-xdebug.ini b/images/php/8.3-cli/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.3-cli/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile new file mode 100644 index 00000000..f21959e6 --- /dev/null +++ b/images/php/8.3-fpm/Dockerfile @@ -0,0 +1,151 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.3-fpm + +ARG MAGENTO_ROOT=/app + +ENV PHP_MEMORY_LIMIT 2G +ENV PHP_VALIDATE_TIMESTAMPS 1 +ENV DEBUG false +ENV MAGENTO_RUN_MODE production +ENV UPLOAD_MAX_FILESIZE 64M +ENV SENDMAIL_PATH /dev/null +ENV PHPRC ${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + sendmail-bin \ + sendmail \ + sudo \ + iproute2 \ + git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + pspell \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.2.0 \ + xmlrpc-1.0.0RC3 \ + yaml + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini +COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +COPY etc/php-fpm.conf /usr/local/etc/ +COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN ["chmod", "+x", "/docker-entrypoint.sh"] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["php-fpm", "-R"] diff --git a/images/php/8.3-fpm/docker-entrypoint.sh b/images/php/8.3-fpm/docker-entrypoint.sh new file mode 100644 index 00000000..0c8c5c9c --- /dev/null +++ b/images/php/8.3-fpm/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Set host.docker.internal if not available +HOST_NAME="host.docker.internal" +HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") +if [[ "$HOST_IP" == "$HOST_NAME" ]]; then + HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') + printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts +fi + +exec "$@" diff --git a/images/php/8.3-fpm/etc/mail.ini b/images/php/8.3-fpm/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.3-fpm/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.3-fpm/etc/php-fpm.conf b/images/php/8.3-fpm/etc/php-fpm.conf new file mode 100644 index 00000000..d988b314 --- /dev/null +++ b/images/php/8.3-fpm/etc/php-fpm.conf @@ -0,0 +1,25 @@ +[global] + +error_log = /proc/self/fd/2 +daemonize = no + +[www] + +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + +listen = [::]:9000 + +pm = dynamic +pm.max_children = 10 +pm.start_servers = 4 +pm.min_spare_servers = 2 +pm.max_spare_servers = 6 +pm.status_path = /status + +clear_env = no + +env[MAGE_MODE] = $MAGENTO_RUN_MODE + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes diff --git a/images/php/8.3-fpm/etc/php-fpm.ini b/images/php/8.3-fpm/etc/php-fpm.ini new file mode 100644 index 00000000..387c8aeb --- /dev/null +++ b/images/php/8.3-fpm/etc/php-fpm.ini @@ -0,0 +1,4 @@ +memory_limit = ${PHP_MEMORY_LIMIT} +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} +user_ini.filename = diff --git a/images/php/8.3-fpm/etc/php-gnupg.ini b/images/php/8.3-fpm/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.3-fpm/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.3-fpm/etc/php-pcov.ini b/images/php/8.3-fpm/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.3-fpm/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.3-fpm/etc/php-xdebug.ini b/images/php/8.3-fpm/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.3-fpm/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM From 11895980c7528cd3375f733f7b5725be8f7ad4ab Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Mon, 8 Jan 2024 21:04:18 +0530 Subject: [PATCH 020/113] Images generated through ./bin/ece-docker image:generate:php --- images/php/8.3-cli/Dockerfile | 4 ++-- images/php/8.3-fpm/Dockerfile | 2 +- src/Command/Image/GeneratePhp.php | 5 +++-- src/Compose/Php/ExtensionResolver.php | 5 +++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 2af8d4d7..c9fbd1cc 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -72,11 +72,10 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ - python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install Python packages - +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli @@ -125,6 +124,7 @@ RUN pecl install -o -f \ raphf \ redis \ xdebug-3.2.0 \ + xdebug-3.2.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile index f21959e6..6e8a1585 100644 --- a/images/php/8.3-fpm/Dockerfile +++ b/images/php/8.3-fpm/Dockerfile @@ -53,7 +53,6 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ - python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog @@ -100,6 +99,7 @@ RUN pecl install -o -f \ raphf \ redis \ xdebug-3.2.0 \ + xdebug-3.2.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 238b3052..a5bd5416 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,7 +26,7 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']; + private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']; private const VERSION_MAP = [ '7.2' => '7.2', @@ -34,7 +34,8 @@ class GeneratePhp extends Command '7.4' => '7.4', '8.0' => '8.0.14', '8.1' => '8.1.1', - '8.2' => '8.2' + '8.2' => '8.2', + '8.3' => '8.3' ]; private const EDITION_CLI = 'cli'; diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 46b95dde..109cc71c 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -431,6 +431,11 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', ], + '>=8.3' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + ], + ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], From 1f98a47b0f17148d66a3637b08daed7db53e6bd7 Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Tue, 9 Jan 2024 21:44:30 +0530 Subject: [PATCH 021/113] Remove space and added missing php8.3v --- src/Command/Image/GeneratePhp.php | 2 +- src/Compose/Php/ExtensionResolver.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index a5bd5416..664f2a2d 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -287,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } - if ($this->semver::satisfies($phpVersion, '8.2.*')) { + if ($this->semver::satisfies($phpVersion, '8.3.*')) { $packages[] = 'python3-yaml'; $pythonPackages = ''; } else { diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 109cc71c..a626febb 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -433,9 +433,8 @@ public static function getConfig(): array ], '>=8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', ], - ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], From 759c37f38b142764515804a91b905a61550d74b0 Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Wed, 10 Jan 2024 05:51:55 +0530 Subject: [PATCH 022/113] PHP Debug version updated --- src/Compose/Php/ExtensionResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index a626febb..d13c7c74 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -427,9 +427,9 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.1.2', ], - '>=8.2' => [ + '>=8.2 <8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', ], '>=8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, From 54854f1ce3aaa7b5afd4d3d496e951230acc587e Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 10 Jan 2024 13:46:26 -0600 Subject: [PATCH 023/113] MCLOUD-11525: Fix xDebug version and constrains for python3-yaml --- images/php/8.3-cli/Dockerfile | 6 +++--- images/php/8.3-fpm/Dockerfile | 4 ++-- src/Command/Image/GeneratePhp.php | 2 +- src/Compose/Php/ExtensionResolver.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index c9fbd1cc..2f3dd059 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -72,10 +72,11 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml + # Install Grunt RUN npm install -g grunt-cli @@ -123,8 +124,7 @@ RUN pecl install -o -f \ pcov \ raphf \ redis \ - xdebug-3.2.0 \ - xdebug-3.2.0 \ + xdebug-3.3.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile index 6e8a1585..039114c4 100644 --- a/images/php/8.3-fpm/Dockerfile +++ b/images/php/8.3-fpm/Dockerfile @@ -53,6 +53,7 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog @@ -98,8 +99,7 @@ RUN pecl install -o -f \ pcov \ raphf \ redis \ - xdebug-3.2.0 \ - xdebug-3.2.0 \ + xdebug-3.3.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 664f2a2d..044a5ba0 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -287,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } - if ($this->semver::satisfies($phpVersion, '8.3.*')) { + if ($this->semver::satisfies($phpVersion, '>=8.2')) { $packages[] = 'python3-yaml'; $pythonPackages = ''; } else { diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index d13c7c74..97db7a5b 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -429,7 +429,7 @@ public static function getConfig(): array ], '>=8.2 <8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', ], '>=8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, From e8a99f2284857389b2028fa2b5d3be529a1297ce Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Tue, 23 Jan 2024 22:56:39 +0530 Subject: [PATCH 024/113] Symfony packages updated for PHP8.3 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 95eeda60..b37279a3 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ "composer/composer": "^1.4 || ^2.0", "composer/semver": "@stable", "illuminate/config": "^5.5||^8.77", - "symfony/config": "^4.4 || ^5.1", - "symfony/console": "^2.8 || ^4.0 || ^5.1", - "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1", - "symfony/yaml": "^3.3 || ^4.0 || ^5.1" + "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", + "symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4", + "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1|| ^5.4 || ^6.4", + "symfony/yaml": "^3.3 || ^4.0 || ^5.1 || ^5.4|| ^6.4" }, "require-dev": { "codeception/codeception": "^4.1", From 6aee55cce5c8906ec3ae3e4bbfd97be6353f9fe3 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 29 Jan 2024 14:07:10 -0600 Subject: [PATCH 025/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- composer.json | 2 +- config/services.xml | 1 + src/Compose/ProductionBuilder/Service/ElasticSearch.php | 2 +- src/Compose/ProductionBuilder/Service/OpenSearch.php | 2 +- tests/static/phpstan.neon | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b37279a3..aeeebcc5 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "codeception/module-rest": "^1.2", "consolidation/robo": "^1.2 || ^2.0", "phpmd/phpmd": "@stable", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^8.5 || ^9.5", "squizlabs/php_codesniffer": "^3.0" }, diff --git a/config/services.xml b/config/services.xml index 3e08211f..d7ca845f 100644 --- a/config/services.xml +++ b/config/services.xml @@ -9,6 +9,7 @@ + diff --git a/src/Compose/ProductionBuilder/Service/ElasticSearch.php b/src/Compose/ProductionBuilder/Service/ElasticSearch.php index bd450b54..6c1af0d5 100644 --- a/src/Compose/ProductionBuilder/Service/ElasticSearch.php +++ b/src/Compose/ProductionBuilder/Service/ElasticSearch.php @@ -73,7 +73,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), $config->getServiceVersion($this->getServiceName()), - !empty($esEnvVars) ? ['environment' => $esEnvVars] : [], + ['environment' => $esEnvVars], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), $config->getServiceImagePattern($this->getServiceName()) diff --git a/src/Compose/ProductionBuilder/Service/OpenSearch.php b/src/Compose/ProductionBuilder/Service/OpenSearch.php index 32519de2..460d532f 100644 --- a/src/Compose/ProductionBuilder/Service/OpenSearch.php +++ b/src/Compose/ProductionBuilder/Service/OpenSearch.php @@ -84,7 +84,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), $this->getVersion($config), - !empty($osEnvVars) ? ['environment' => $osEnvVars] : [], + ['environment' => $osEnvVars], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), $config->getServiceImagePattern($this->getServiceName()) diff --git a/tests/static/phpstan.neon b/tests/static/phpstan.neon index ea86c28c..6d5cf820 100644 --- a/tests/static/phpstan.neon +++ b/tests/static/phpstan.neon @@ -2,7 +2,7 @@ parameters: level: 5 paths: - ../../src - excludes_analyse: + excludePaths: - ../../src/Test/* reportUnmatchedIgnoredErrors: false ignoreErrors: From ef4eb83e263b0696c20398f966d8042e1f815558 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Feb 2024 10:42:52 -0600 Subject: [PATCH 026/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- src/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Application.php b/src/Application.php index 2aca8022..a6403b9e 100644 --- a/src/Application.php +++ b/src/Application.php @@ -35,7 +35,7 @@ public function __construct(ContainerInterface $container) /** * @inheritdoc */ - protected function getDefaultCommands() + protected function getDefaultCommands(): array { return array_merge(parent::getDefaultCommands(), [ $this->container->get(Command\BuildCompose::class), From ab954c8dcf4a2c71aee556e24ac3e4a487f389aa Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Feb 2024 14:32:09 -0600 Subject: [PATCH 027/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Robo/Tasks/DockerCompose/Run.php | 2 +- tests/functional/Robo/Tasks/EnvCleanUp.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Robo/Tasks/DockerCompose/Run.php b/tests/functional/Robo/Tasks/DockerCompose/Run.php index a7dd896d..38bade14 100644 --- a/tests/functional/Robo/Tasks/DockerCompose/Run.php +++ b/tests/functional/Robo/Tasks/DockerCompose/Run.php @@ -63,7 +63,7 @@ public function __construct($container) public function getCommand() { return trim(sprintf( - 'docker-compose run -w %s %s %s ' . $this->runWrapper, + 'docker-compose run --rm -w %s %s %s ' . $this->runWrapper, escapeshellarg($this->workingDir), $this->arguments, escapeshellarg($this->container), diff --git a/tests/functional/Robo/Tasks/EnvCleanUp.php b/tests/functional/Robo/Tasks/EnvCleanUp.php index 7f1d5942..0e84a64f 100644 --- a/tests/functional/Robo/Tasks/EnvCleanUp.php +++ b/tests/functional/Robo/Tasks/EnvCleanUp.php @@ -44,7 +44,7 @@ public function getCommand(): string foreach ($this->volumes as $volume) { $commands[] = sprintf( - 'docker-compose run %s bash -c "mkdir -p %s"', + 'docker-compose run --rm %s bash -c "mkdir -p %s"', Docker::BUILD_CONTAINER, $volume ); From d38d910b96ed255b3dc861c605859a00abc3bf73 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Feb 2024 14:36:04 -0600 Subject: [PATCH 028/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- src/Test/Functional/Acceptance/AcceptanceCest.php | 12 ++++++------ src/Test/Functional/Acceptance/DeveloperCest.php | 4 ++-- src/Test/Functional/Acceptance/MailHogCest.php | 2 +- tests/functional/Codeception/Docker.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index ee2edfc4..3bee5e28 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -28,9 +28,9 @@ public function testProductionMode(\CliTester $I): void $I->assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run build cloud-build'); - $I->runDockerComposeCommand('run deploy cloud-deploy'); - $I->runDockerComposeCommand('run deploy cloud-post-deploy'); + $I->runDockerComposeCommand('run --rm build cloud-build'); + $I->runDockerComposeCommand('run --rm deploy cloud-deploy'); + $I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); @@ -51,9 +51,9 @@ public function testCustomHost(\CliTester $I): void ); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run --rm build cloud-build'), 'Build phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-deploy'), 'Deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'), 'Post deploy phase failed'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 3ca2efce..86f65c56 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -31,10 +31,10 @@ public function testDevPhpIni(CliTester $I) $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run --rm deploy php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); - $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run --rm fpm php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); } } diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 0ef9461e..caea8d38 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -61,7 +61,7 @@ private function runAndAssert(\CliTester $I): void $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); $I->assertTrue( - $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') + $I->runDockerComposeCommand('run --rm deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') ); $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); $I->seeResponseIsJson(); diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 9ed7a70a..77b87ac0 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -108,7 +108,7 @@ public function runDockerComposeCommand(string $command): bool public function resetFilesOwner(): bool { return $this->runDockerComposeCommand( - 'run build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' + 'run --rm build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' ); } From 0631039cf34a10e502c449e8f3e9f918c3722922 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 13:40:40 -0600 Subject: [PATCH 029/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Codeception/Docker.php | 6 +++--- tests/functional/Codeception/MagentoDb.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 77b87ac0..6f7de6cb 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -23,7 +23,7 @@ class Docker extends BaseModule /** * @var array */ - protected $config = [ + protected array $config = [ 'system_magento_dir' => '', 'printOutput' => false, ]; @@ -31,12 +31,12 @@ class Docker extends BaseModule /** * @var array */ - protected $services = []; + protected array $services = []; /** * @inheritdoc */ - public function _initialize() + public function _initialize(): void { $container = Robo::createDefaultContainer(); $builder = CollectionBuilder::create($container, $this); diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index be5d5d6b..6f632a0f 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -122,7 +122,7 @@ public function _after(TestInterface $test) * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _initialize() {} + public function _initialize(): void {} /** * This method is overridden to avoid connection attempts before running Docker From 64ba3bd515780c1187686a274f471b76cbf174dc Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 13:47:07 -0600 Subject: [PATCH 030/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Codeception/MagentoDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index 6f632a0f..58e3fc2a 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -128,7 +128,7 @@ public function _initialize(): void {} * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _beforeSuite($settings = []) {} + public function _beforeSuite($settings = []): void {} /** * This method is overridden to avoid connection attempts before running Docker From eed93834756063681acfd51ef504c499d5918fc4 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 13:50:19 -0600 Subject: [PATCH 031/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Codeception/MagentoDb.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index 58e3fc2a..c8dd9d6c 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -113,7 +113,7 @@ public function _beforeStep(Step $step) /** * @inheritdoc */ - public function _after(TestInterface $test) + public function _after(TestInterface $test): void { $this->disconnectDatabases(); } @@ -134,5 +134,5 @@ public function _beforeSuite($settings = []): void {} * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _before(TestInterface $test) {} + public function _before(TestInterface $test): void {} } From a9088917ecd50c2446491fc1715be142cb2e0f66 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 14:19:37 -0600 Subject: [PATCH 032/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- src/Test/Functional/Acceptance/AcceptanceCest.php | 12 ++++++------ src/Test/Functional/Acceptance/DeveloperCest.php | 4 ++-- src/Test/Functional/Acceptance/MailHogCest.php | 2 +- tests/functional/Codeception/Docker.php | 2 +- tests/functional/Robo/Tasks/DockerCompose/Run.php | 2 +- tests/functional/Robo/Tasks/EnvCleanUp.php | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index 3bee5e28..ee2edfc4 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -28,9 +28,9 @@ public function testProductionMode(\CliTester $I): void $I->assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run --rm build cloud-build'); - $I->runDockerComposeCommand('run --rm deploy cloud-deploy'); - $I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'); + $I->runDockerComposeCommand('run build cloud-build'); + $I->runDockerComposeCommand('run deploy cloud-deploy'); + $I->runDockerComposeCommand('run deploy cloud-post-deploy'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); @@ -51,9 +51,9 @@ public function testCustomHost(\CliTester $I): void ); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->assertTrue($I->runDockerComposeCommand('run --rm build cloud-build'), 'Build phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-deploy'), 'Deploy phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'), 'Post deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 86f65c56..3ca2efce 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -31,10 +31,10 @@ public function testDevPhpIni(CliTester $I) $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run --rm deploy php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); - $I->runDockerComposeCommand('run --rm fpm php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); } } diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index caea8d38..0ef9461e 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -61,7 +61,7 @@ private function runAndAssert(\CliTester $I): void $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); $I->assertTrue( - $I->runDockerComposeCommand('run --rm deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') + $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') ); $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); $I->seeResponseIsJson(); diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 6f7de6cb..ac65e51d 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -108,7 +108,7 @@ public function runDockerComposeCommand(string $command): bool public function resetFilesOwner(): bool { return $this->runDockerComposeCommand( - 'run --rm build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' + 'run build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' ); } diff --git a/tests/functional/Robo/Tasks/DockerCompose/Run.php b/tests/functional/Robo/Tasks/DockerCompose/Run.php index 38bade14..a7dd896d 100644 --- a/tests/functional/Robo/Tasks/DockerCompose/Run.php +++ b/tests/functional/Robo/Tasks/DockerCompose/Run.php @@ -63,7 +63,7 @@ public function __construct($container) public function getCommand() { return trim(sprintf( - 'docker-compose run --rm -w %s %s %s ' . $this->runWrapper, + 'docker-compose run -w %s %s %s ' . $this->runWrapper, escapeshellarg($this->workingDir), $this->arguments, escapeshellarg($this->container), diff --git a/tests/functional/Robo/Tasks/EnvCleanUp.php b/tests/functional/Robo/Tasks/EnvCleanUp.php index 0e84a64f..7f1d5942 100644 --- a/tests/functional/Robo/Tasks/EnvCleanUp.php +++ b/tests/functional/Robo/Tasks/EnvCleanUp.php @@ -44,7 +44,7 @@ public function getCommand(): string foreach ($this->volumes as $volume) { $commands[] = sprintf( - 'docker-compose run --rm %s bash -c "mkdir -p %s"', + 'docker-compose run %s bash -c "mkdir -p %s"', Docker::BUILD_CONTAINER, $volume ); From 22c4e7cf3302fd3506a651e099bebbee856fcc75 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 14:49:49 -0600 Subject: [PATCH 033/113] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Robo/Tasks/CopyFromDocker.php | 2 +- tests/functional/Robo/Tasks/CopyToDocker.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Robo/Tasks/CopyFromDocker.php b/tests/functional/Robo/Tasks/CopyFromDocker.php index 2dd862d4..1a071542 100644 --- a/tests/functional/Robo/Tasks/CopyFromDocker.php +++ b/tests/functional/Robo/Tasks/CopyFromDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker cp "$(docker-compose ps -q %s)":%s %s', + 'docker-compose cp %s:%s %s', $this->container, $this->source, $this->destination diff --git a/tests/functional/Robo/Tasks/CopyToDocker.php b/tests/functional/Robo/Tasks/CopyToDocker.php index 5e3cf0c3..22cecf6e 100644 --- a/tests/functional/Robo/Tasks/CopyToDocker.php +++ b/tests/functional/Robo/Tasks/CopyToDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker cp %s "$(docker-compose ps -q %s)":%s', + 'docker-compose cp %s %s:%s', $this->source, $this->container, $this->destination From ebb0e4c336269911e1244e07a4a80c722ceded8b Mon Sep 17 00:00:00 2001 From: Charly Maupetit Date: Tue, 27 Feb 2024 16:13:02 +0100 Subject: [PATCH 034/113] fix composer vulnerability CVE-2024-24821 --- images/php/8.0-cli/Dockerfile | 2 +- images/php/8.1-cli/Dockerfile | 2 +- images/php/8.2-cli/Dockerfile | 2 +- images/php/8.3-cli/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 45dd71d1..03ddcad2 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 99010a5f..d810cd61 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index dbafd471..1427b2fd 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 2f3dd059..e518ef16 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From 9487d0a18d422b2bd9592eaeba9309250404bbf5 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 11 Mar 2024 12:45:36 -0400 Subject: [PATCH 035/113] Add php 8.3 functional tests --- .../Acceptance/Acceptance82Cest.php | 61 ++++++++++ .../Functional/Acceptance/AcceptanceCest.php | 4 +- .../Functional/Acceptance/Developer82Cest.php | 40 +++++++ .../Functional/Acceptance/DeveloperCest.php | 4 +- .../Acceptance/Elasticsearch82Cest.php | 96 ++++++++++++++++ .../Acceptance/ElasticsearchCest.php | 4 +- .../Functional/Acceptance/MailHog82Cest.php | 70 ++++++++++++ .../Functional/Acceptance/MailHogCest.php | 4 +- .../Acceptance/Opensearch82Cest.php | 107 ++++++++++++++++++ .../Functional/Acceptance/OpensearchCest.php | 4 +- 10 files changed, 384 insertions(+), 10 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Acceptance82Cest.php create mode 100644 src/Test/Functional/Acceptance/Developer82Cest.php create mode 100644 src/Test/Functional/Acceptance/Elasticsearch82Cest.php create mode 100644 src/Test/Functional/Acceptance/MailHog82Cest.php create mode 100644 src/Test/Functional/Acceptance/Opensearch82Cest.php diff --git a/src/Test/Functional/Acceptance/Acceptance82Cest.php b/src/Test/Functional/Acceptance/Acceptance82Cest.php new file mode 100644 index 00000000..5738615c --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance82Cest.php @@ -0,0 +1,61 @@ +assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + $I->runDockerComposeCommand('run build cloud-build'); + $I->runDockerComposeCommand('run deploy cloud-deploy'); + $I->runDockerComposeCommand('run deploy cloud-post-deploy'); + $I->amOnPage('/'); + $I->see('Home page'); + $I->see('CMS homepage content goes here.'); + } + + /** + * @param \CliTester $I + * @throws TaskException + * @throws \Codeception\Exception\ModuleConfigException + * @throws \Codeception\Exception\ModuleException + */ + public function testCustomHost(\CliTester $I): void + { + $I->updateBaseUrl('http://magento2.test/'); + $I->assertTrue( + $I->generateDockerCompose('--mode=production --host=magento2.test'), + 'Command build:compose failed' + ); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); + $I->amOnPage('/'); + $I->see('Home page'); + $I->see('CMS homepage content goes here.'); + } +} diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index ee2edfc4..bda150fb 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -10,14 +10,14 @@ use Robo\Exception\TaskException; /** - * @group php82 + * @group php83 */ class AcceptanceCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/Developer82Cest.php b/src/Test/Functional/Acceptance/Developer82Cest.php new file mode 100644 index 00000000..1bfdaaa7 --- /dev/null +++ b/src/Test/Functional/Acceptance/Developer82Cest.php @@ -0,0 +1,40 @@ +generateDockerCompose('--mode=developer'); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + + $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); + $I->seeInOutput('=> On'); + + $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); + $I->seeInOutput('=> On'); + } +} diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 3ca2efce..459126ab 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -10,14 +10,14 @@ use CliTester; /** - * @group php82 + * @group php83 */ class DeveloperCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * Tests that php settings contains configuration from php.dev.ini diff --git a/src/Test/Functional/Acceptance/Elasticsearch82Cest.php b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php new file mode 100644 index 00000000..c750784c --- /dev/null +++ b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php @@ -0,0 +1,96 @@ +generateDockerCompose($this->buildCommand($data)); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + if (!empty($data['plugins'])) { + $I->runDockerComposeCommand('logs elasticsearch'); + foreach ($data['plugins'] as $plugin) { + $I->seeInOutput($plugin); + } + } + $I->runDockerComposeCommand('exec -T elasticsearch ps aux | grep elasticsearch'); + $I->seeInOutput('-Xms' . $data['xms']); + $I->seeInOutput('-Xmx' . $data['xmx']); + + if (!empty($data['param'])) { + $I->runDockerComposeCommand('exec -T elasticsearch curl http://localhost:9200/_nodes/settings'); + $I->seeInOutput($data['param']['needle']); + } + } + + /** + * Builds build:compose command from given test data + * + * @param Example $data + * @return string + */ + private function buildCommand(Example $data): string + { + $command = sprintf( + '--mode=production --es=%s --es-env-var="ES_JAVA_OPTS=-Xms%s -Xmx%s" --no-os', + $data['version'], + $data['xms'], + $data['xmx'] + ); + + if (!empty($data['param'])) { + $command .= " --es-env-var={$data['param']['key']}={$data['param']['value']}"; + } + if (!empty($data['plugins'])) { + $command .= sprintf(' --es-env-var="ES_PLUGINS=%s"', implode(' ', $data['plugins'])); + } + + return $command; + } + + /** + * @return array + */ + protected function dataProvider(): array + { + return [ + [ + 'version' => '7.10', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/ElasticsearchCest.php b/src/Test/Functional/Acceptance/ElasticsearchCest.php index 7ecdb78b..5bc6c438 100644 --- a/src/Test/Functional/Acceptance/ElasticsearchCest.php +++ b/src/Test/Functional/Acceptance/ElasticsearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php82 + * @group php83 */ class ElasticsearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param CliTester $I diff --git a/src/Test/Functional/Acceptance/MailHog82Cest.php b/src/Test/Functional/Acceptance/MailHog82Cest.php new file mode 100644 index 00000000..9efe72e9 --- /dev/null +++ b/src/Test/Functional/Acceptance/MailHog82Cest.php @@ -0,0 +1,70 @@ +updateBaseUrl('http://magento2.docker:8025/'); + $I->assertTrue( + $I->generateDockerCompose(), + 'Command build:compose failed' + ); + $this->runAndAssert($I); + } + + /** + * @param \CliTester $I + * @throws \Exception + */ + public function testCustomPorts(\CliTester $I): void + { + $I->updateBaseUrl('http://magento2.docker:8026/'); + $I->assertTrue( + $I->generateDockerCompose('--mailhog-http-port=8026 --mailhog-smtp-port=1026'), + 'Command build:compose failed' + ); + $this->runAndAssert($I); + } + + /** + * @param \CliTester $I + * @throws \Exception + */ + private function runAndAssert(\CliTester $I): void + { + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + $I->amOnPage('/'); + $I->see('MailHog'); + + $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); + $I->seeResponseIsJson(); + $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); + + $I->assertTrue( + $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') + ); + $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); + $I->seeResponseIsJson(); + $I->assertSame([1], $I->grabDataFromResponseByJsonPath('$.total')); + } +} diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 0ef9461e..8530a083 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -8,14 +8,14 @@ namespace Magento\CloudDocker\Test\Functional\Acceptance; /** - * @group php82 + * @group php83 */ class MailHogCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/Opensearch82Cest.php b/src/Test/Functional/Acceptance/Opensearch82Cest.php new file mode 100644 index 00000000..0c5c6549 --- /dev/null +++ b/src/Test/Functional/Acceptance/Opensearch82Cest.php @@ -0,0 +1,107 @@ +generateDockerCompose($this->buildCommand($data)); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + if (!empty($data['plugins'])) { + $I->runDockerComposeCommand('logs opensearch'); + foreach ($data['plugins'] as $plugin) { + $I->seeInOutput($plugin); + } + } + $I->runDockerComposeCommand('exec -T opensearch curl localhost:9200/_nodes'); + $I->seeInOutput('-Xms' . $data['xms']); + $I->seeInOutput('-Xmx' . $data['xmx']); + + if (!empty($data['param'])) { + $I->runDockerComposeCommand('exec -T opensearch curl http://localhost:9200/_nodes/settings'); + $I->seeInOutput($data['param']['needle']); + } + } + + /** + * Builds build:compose command from given test data + * + * @param Example $data + * @return string + */ + private function buildCommand(Example $data): string + { + $command = sprintf( + '--mode=production --os=%s --os-env-var="OPENSEARCH_JAVA_OPTS=-Xms%s -Xmx%s"', + $data['version'], + $data['xms'], + $data['xmx'] + ); + + if (!empty($data['param'])) { + $command .= " --os-env-var={$data['param']['key']}={$data['param']['value']}"; + } + if (!empty($data['plugins'])) { + $command .= sprintf(' --os-env-var="OS_PLUGINS=%s"', implode(' ', $data['plugins'])); + } + + return $command; + } + + /** + * @return array + */ + protected function dataProvider(): array + { + return [ + [ + 'version' => '2.3', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + [ + 'version' => '2.4', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/OpensearchCest.php b/src/Test/Functional/Acceptance/OpensearchCest.php index 74271ada..f4aa3b91 100644 --- a/src/Test/Functional/Acceptance/OpensearchCest.php +++ b/src/Test/Functional/Acceptance/OpensearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php82 + * @group php83 */ class OpensearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param CliTester $I From 432265393d0a8f7c6b3d9d3f6dabd9a136bc1ca4 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 11 Mar 2024 14:49:31 -0400 Subject: [PATCH 036/113] php8.2 tests optimization --- .../Acceptance/Acceptance82Cest.php | 40 --------- .../Functional/Acceptance/Developer82Cest.php | 19 ----- .../Acceptance/Elasticsearch82Cest.php | 73 ---------------- .../Functional/Acceptance/MailHog82Cest.php | 51 ------------ .../Acceptance/Opensearch82Cest.php | 83 ------------------- 5 files changed, 266 deletions(-) diff --git a/src/Test/Functional/Acceptance/Acceptance82Cest.php b/src/Test/Functional/Acceptance/Acceptance82Cest.php index 5738615c..b0ac70ff 100644 --- a/src/Test/Functional/Acceptance/Acceptance82Cest.php +++ b/src/Test/Functional/Acceptance/Acceptance82Cest.php @@ -18,44 +18,4 @@ class Acceptance82Cest extends AcceptanceCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * @param \CliTester $I - * @throws TaskException - */ - public function testProductionMode(\CliTester $I): void - { - $I->assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - $I->runDockerComposeCommand('run build cloud-build'); - $I->runDockerComposeCommand('run deploy cloud-deploy'); - $I->runDockerComposeCommand('run deploy cloud-post-deploy'); - $I->amOnPage('/'); - $I->see('Home page'); - $I->see('CMS homepage content goes here.'); - } - - /** - * @param \CliTester $I - * @throws TaskException - * @throws \Codeception\Exception\ModuleConfigException - * @throws \Codeception\Exception\ModuleException - */ - public function testCustomHost(\CliTester $I): void - { - $I->updateBaseUrl('http://magento2.test/'); - $I->assertTrue( - $I->generateDockerCompose('--mode=production --host=magento2.test'), - 'Command build:compose failed' - ); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); - $I->amOnPage('/'); - $I->see('Home page'); - $I->see('CMS homepage content goes here.'); - } } diff --git a/src/Test/Functional/Acceptance/Developer82Cest.php b/src/Test/Functional/Acceptance/Developer82Cest.php index 1bfdaaa7..36277d20 100644 --- a/src/Test/Functional/Acceptance/Developer82Cest.php +++ b/src/Test/Functional/Acceptance/Developer82Cest.php @@ -18,23 +18,4 @@ class Developer82Cest extends DeveloperCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * Tests that php settings contains configuration from php.dev.ini - * - * @param CliTester $I - * @throws \Robo\Exception\TaskException - */ - public function testDevPhpIni(CliTester $I) - { - $I->generateDockerCompose('--mode=developer'); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - - $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); - $I->seeInOutput('=> On'); - - $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); - $I->seeInOutput('=> On'); - } } diff --git a/src/Test/Functional/Acceptance/Elasticsearch82Cest.php b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php index c750784c..681dc973 100644 --- a/src/Test/Functional/Acceptance/Elasticsearch82Cest.php +++ b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php @@ -20,77 +20,4 @@ class Elasticsearch82Cest extends ElasticsearchCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * @param CliTester $I - * @param Example $data - * @dataProvider dataProvider - * @return void - * @throws TaskException - */ - public function testElasticsearch(CliTester $I, Example $data) - { - $I->generateDockerCompose($this->buildCommand($data)); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - if (!empty($data['plugins'])) { - $I->runDockerComposeCommand('logs elasticsearch'); - foreach ($data['plugins'] as $plugin) { - $I->seeInOutput($plugin); - } - } - $I->runDockerComposeCommand('exec -T elasticsearch ps aux | grep elasticsearch'); - $I->seeInOutput('-Xms' . $data['xms']); - $I->seeInOutput('-Xmx' . $data['xmx']); - - if (!empty($data['param'])) { - $I->runDockerComposeCommand('exec -T elasticsearch curl http://localhost:9200/_nodes/settings'); - $I->seeInOutput($data['param']['needle']); - } - } - - /** - * Builds build:compose command from given test data - * - * @param Example $data - * @return string - */ - private function buildCommand(Example $data): string - { - $command = sprintf( - '--mode=production --es=%s --es-env-var="ES_JAVA_OPTS=-Xms%s -Xmx%s" --no-os', - $data['version'], - $data['xms'], - $data['xmx'] - ); - - if (!empty($data['param'])) { - $command .= " --es-env-var={$data['param']['key']}={$data['param']['value']}"; - } - if (!empty($data['plugins'])) { - $command .= sprintf(' --es-env-var="ES_PLUGINS=%s"', implode(' ', $data['plugins'])); - } - - return $command; - } - - /** - * @return array - */ - protected function dataProvider(): array - { - return [ - [ - 'version' => '7.10', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - ]; - } } diff --git a/src/Test/Functional/Acceptance/MailHog82Cest.php b/src/Test/Functional/Acceptance/MailHog82Cest.php index 9efe72e9..52e0f255 100644 --- a/src/Test/Functional/Acceptance/MailHog82Cest.php +++ b/src/Test/Functional/Acceptance/MailHog82Cest.php @@ -16,55 +16,4 @@ class MailHog82Cest extends MailHogCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * @param \CliTester $I - * @throws \Exception - */ - public function testDefaultPorts(\CliTester $I): void - { - $I->updateBaseUrl('http://magento2.docker:8025/'); - $I->assertTrue( - $I->generateDockerCompose(), - 'Command build:compose failed' - ); - $this->runAndAssert($I); - } - - /** - * @param \CliTester $I - * @throws \Exception - */ - public function testCustomPorts(\CliTester $I): void - { - $I->updateBaseUrl('http://magento2.docker:8026/'); - $I->assertTrue( - $I->generateDockerCompose('--mailhog-http-port=8026 --mailhog-smtp-port=1026'), - 'Command build:compose failed' - ); - $this->runAndAssert($I); - } - - /** - * @param \CliTester $I - * @throws \Exception - */ - private function runAndAssert(\CliTester $I): void - { - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - $I->amOnPage('/'); - $I->see('MailHog'); - - $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); - $I->seeResponseIsJson(); - $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); - - $I->assertTrue( - $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') - ); - $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); - $I->seeResponseIsJson(); - $I->assertSame([1], $I->grabDataFromResponseByJsonPath('$.total')); - } } diff --git a/src/Test/Functional/Acceptance/Opensearch82Cest.php b/src/Test/Functional/Acceptance/Opensearch82Cest.php index 0c5c6549..ea4344f6 100644 --- a/src/Test/Functional/Acceptance/Opensearch82Cest.php +++ b/src/Test/Functional/Acceptance/Opensearch82Cest.php @@ -21,87 +21,4 @@ class Opensearch82Cest extends OpensearchCest */ protected const TEMPLATE_VERSION = '2.4.6'; - /** - * @param CliTester $I - * @param Example $data - * @dataProvider dataProvider - * @return void - * @throws TaskException - */ - public function testOpensearch(CliTester $I, Example $data) - { - $I->generateDockerCompose($this->buildCommand($data)); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - if (!empty($data['plugins'])) { - $I->runDockerComposeCommand('logs opensearch'); - foreach ($data['plugins'] as $plugin) { - $I->seeInOutput($plugin); - } - } - $I->runDockerComposeCommand('exec -T opensearch curl localhost:9200/_nodes'); - $I->seeInOutput('-Xms' . $data['xms']); - $I->seeInOutput('-Xmx' . $data['xmx']); - - if (!empty($data['param'])) { - $I->runDockerComposeCommand('exec -T opensearch curl http://localhost:9200/_nodes/settings'); - $I->seeInOutput($data['param']['needle']); - } - } - - /** - * Builds build:compose command from given test data - * - * @param Example $data - * @return string - */ - private function buildCommand(Example $data): string - { - $command = sprintf( - '--mode=production --os=%s --os-env-var="OPENSEARCH_JAVA_OPTS=-Xms%s -Xmx%s"', - $data['version'], - $data['xms'], - $data['xmx'] - ); - - if (!empty($data['param'])) { - $command .= " --os-env-var={$data['param']['key']}={$data['param']['value']}"; - } - if (!empty($data['plugins'])) { - $command .= sprintf(' --os-env-var="OS_PLUGINS=%s"', implode(' ', $data['plugins'])); - } - - return $command; - } - - /** - * @return array - */ - protected function dataProvider(): array - { - return [ - [ - 'version' => '2.3', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - [ - 'version' => '2.4', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - ]; - } } From 8d902ac7424c2579519c85039146346115139985 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Mon, 18 Mar 2024 15:14:44 -0500 Subject: [PATCH 037/113] Use Composer 2.7.0 for PHP 8.3 --- images/php/8.3-cli/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index e518ef16..21b4957e 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.7.0 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From 65b7b5c22e4b08702d590b010c5d2d29b3e8edc6 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Fri, 22 Mar 2024 12:54:46 -0500 Subject: [PATCH 038/113] update alias --- config/services.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/services.xml b/config/services.xml index d7ca845f..9dc5ae85 100644 --- a/config/services.xml +++ b/config/services.xml @@ -9,7 +9,7 @@ - + From 6dd2feb29c178bf1eec38363410c91a1d3dc3a00 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 26 Mar 2024 12:21:38 -0500 Subject: [PATCH 039/113] MCLOUD-11870: Composer Vulnerability (CVE-2024-24821) (#122) --- images/php/8.0-cli/Dockerfile | 2 +- images/php/8.1-cli/Dockerfile | 2 +- images/php/8.2-cli/Dockerfile | 2 +- images/php/8.3-cli/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 45dd71d1..03ddcad2 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 99010a5f..d810cd61 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index dbafd471..1427b2fd 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 2f3dd059..21b4957e 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.7.0 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From a195268f62d809d50299deaf742ecc7e06851476 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 26 Mar 2024 13:12:20 -0500 Subject: [PATCH 040/113] Revert "MCLOUD-11870: Composer Vulnerability (CVE-2024-24821) (#122)" (#123) This reverts commit 6dd2feb29c178bf1eec38363410c91a1d3dc3a00. --- images/php/8.0-cli/Dockerfile | 2 +- images/php/8.1-cli/Dockerfile | 2 +- images/php/8.2-cli/Dockerfile | 2 +- images/php/8.3-cli/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 03ddcad2..45dd71d1 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.1.14 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index d810cd61..99010a5f 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.1.14 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index 1427b2fd..dbafd471 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.2.18 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 21b4957e..2f3dd059 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.7.0 +ARG COMPOSER_VERSION=2.2.18 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From 5d4b6978266ea6ce8079c05660ebdcd1bd0a3027 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 28 Mar 2024 10:43:14 -0500 Subject: [PATCH 041/113] Add images for OpenSearch 1.3 and 2.12 --- images/opensearch/1.3/Dockerfile | 21 ++++++++++++++++++++ images/opensearch/1.3/docker-entrypoint.sh | 12 +++++++++++ images/opensearch/1.3/docker-healthcheck.sh | 12 +++++++++++ images/opensearch/2.12/Dockerfile | 21 ++++++++++++++++++++ images/opensearch/2.12/docker-entrypoint.sh | 12 +++++++++++ images/opensearch/2.12/docker-healthcheck.sh | 12 +++++++++++ src/Command/Image/GenerateOs.php | 6 ++++++ 7 files changed, 96 insertions(+) create mode 100644 images/opensearch/1.3/Dockerfile create mode 100755 images/opensearch/1.3/docker-entrypoint.sh create mode 100644 images/opensearch/1.3/docker-healthcheck.sh create mode 100644 images/opensearch/2.12/Dockerfile create mode 100755 images/opensearch/2.12/docker-entrypoint.sh create mode 100644 images/opensearch/2.12/docker-healthcheck.sh diff --git a/images/opensearch/1.3/Dockerfile b/images/opensearch/1.3/Dockerfile new file mode 100644 index 00000000..ee27282e --- /dev/null +++ b/images/opensearch/1.3/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:1.3.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/1.3/docker-entrypoint.sh b/images/opensearch/1.3/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/1.3/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/1.3/docker-healthcheck.sh b/images/opensearch/1.3/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/1.3/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/opensearch/2.12/Dockerfile b/images/opensearch/2.12/Dockerfile new file mode 100644 index 00000000..976c19fd --- /dev/null +++ b/images/opensearch/2.12/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.12.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/2.12/docker-entrypoint.sh b/images/opensearch/2.12/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.12/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/2.12/docker-healthcheck.sh b/images/opensearch/2.12/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.12/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index 2b71aabe..623c05b1 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -34,6 +34,9 @@ class GenerateOs extends Command '1.2' => [ 'real-version' => '1.2.1', ], + '1.3' => [ + 'real-version' => '1.3.0', + ], '2.3' => [ 'real-version' => '2.3.0' ], @@ -42,6 +45,9 @@ class GenerateOs extends Command ], '2.5' => [ 'real-version' => '2.5.0' + ], + '2.12' => [ + 'real-version' => '2.12.0' ] ]; From 4ba9b3287053c520352190036d757142634a2c24 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 28 Mar 2024 10:57:16 -0500 Subject: [PATCH 042/113] Codesniffer fix --- src/Test/Functional/Acceptance/Opensearch82Cest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/Opensearch82Cest.php b/src/Test/Functional/Acceptance/Opensearch82Cest.php index ea4344f6..8bfcd7de 100644 --- a/src/Test/Functional/Acceptance/Opensearch82Cest.php +++ b/src/Test/Functional/Acceptance/Opensearch82Cest.php @@ -20,5 +20,4 @@ class Opensearch82Cest extends OpensearchCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - } From d0f5bceaae5683c52fa0f49e6fb266863951c554 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 3 Apr 2024 11:34:27 -0500 Subject: [PATCH 043/113] Bump to version 1.3.7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index aeeebcc5..fde460ba 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.6", + "version": "1.3.7", "license": [ "OSL-3.0", "AFL-3.0" From 6de135944a1e1e7ab50d2a6e7967d0cc5c71fced Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 17 Apr 2024 14:40:26 -0500 Subject: [PATCH 044/113] Fix bin/ece-docker image:generate:php command composer versions --- src/Command/Image/GeneratePhp.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 044a5ba0..d002afc5 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -342,8 +342,10 @@ private function getComposerVersion(string $phpVersion) : string { if ($this->semver::satisfies($phpVersion, '<8.0')) { return '1.10.22'; + } else if ($this->semver::satisfies($phpVersion, '<=8.2')) { + return '2.2.23'; + } else { + return '2.7.0'; } - - return $this->semver::satisfies($phpVersion, '<8.2') ? '2.1.14' : '2.2.18'; } } From 41b05b41cb87f16c6e78b93ea7e96a66adf28d3d Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Mon, 15 Jul 2024 20:04:43 +0530 Subject: [PATCH 045/113] Refactoring of code. --- composer.json | 16 +- images/php/7.2-cli/Dockerfile | 238 ------------------ images/php/7.2-cli/bin/cloud-build | 44 ---- images/php/7.2-cli/bin/cloud-deploy | 37 --- images/php/7.2-cli/bin/cloud-post-deploy | 11 - images/php/7.2-cli/bin/ece-command | 7 - images/php/7.2-cli/bin/magento-command | 7 - images/php/7.2-cli/bin/magento-installer | 11 - images/php/7.2-cli/bin/mftf-command | 7 - images/php/7.2-cli/bin/run-cron | 3 - images/php/7.2-cli/bin/run-hooks | 61 ----- images/php/7.2-cli/docker-entrypoint.sh | 35 --- images/php/7.2-cli/etc/mail.ini | 2 - images/php/7.2-cli/etc/php-cli.ini | 10 - images/php/7.2-cli/etc/php-gnupg.ini | 1 - images/php/7.2-cli/etc/php-pcov.ini | 2 - images/php/7.2-cli/etc/php-xdebug.ini | 8 - images/php/7.2-fpm/Dockerfile | 196 --------------- images/php/7.2-fpm/docker-entrypoint.sh | 24 -- images/php/7.2-fpm/etc/mail.ini | 2 - images/php/7.2-fpm/etc/php-fpm.conf | 25 -- images/php/7.2-fpm/etc/php-fpm.ini | 4 - images/php/7.2-fpm/etc/php-gnupg.ini | 1 - images/php/7.2-fpm/etc/php-pcov.ini | 2 - images/php/7.2-fpm/etc/php-xdebug.ini | 8 - images/php/7.3-cli/Dockerfile | 235 ----------------- images/php/7.3-cli/bin/cloud-build | 44 ---- images/php/7.3-cli/bin/cloud-deploy | 37 --- images/php/7.3-cli/bin/cloud-post-deploy | 11 - images/php/7.3-cli/bin/ece-command | 7 - images/php/7.3-cli/bin/magento-command | 7 - images/php/7.3-cli/bin/magento-installer | 11 - images/php/7.3-cli/bin/mftf-command | 7 - images/php/7.3-cli/bin/run-cron | 3 - images/php/7.3-cli/bin/run-hooks | 61 ----- images/php/7.3-cli/docker-entrypoint.sh | 35 --- images/php/7.3-cli/etc/mail.ini | 2 - images/php/7.3-cli/etc/php-cli.ini | 10 - images/php/7.3-cli/etc/php-gnupg.ini | 1 - images/php/7.3-cli/etc/php-pcov.ini | 2 - images/php/7.3-cli/etc/php-xdebug.ini | 8 - images/php/7.3-fpm/Dockerfile | 193 -------------- images/php/7.3-fpm/docker-entrypoint.sh | 24 -- images/php/7.3-fpm/etc/mail.ini | 2 - images/php/7.3-fpm/etc/php-fpm.conf | 25 -- images/php/7.3-fpm/etc/php-fpm.ini | 4 - images/php/7.3-fpm/etc/php-gnupg.ini | 1 - images/php/7.3-fpm/etc/php-pcov.ini | 2 - images/php/7.3-fpm/etc/php-xdebug.ini | 8 - src/Command/Image/GeneratePhp.php | 4 +- src/Compose/Php/ConfigFilesResolver.php | 22 +- src/Compose/Php/ExtensionResolver.php | 4 +- .../Functional/Acceptance/ServicesCest.php | 16 +- .../Integration/BuildCustomComposeTest.php | 10 +- 54 files changed, 35 insertions(+), 1523 deletions(-) delete mode 100644 images/php/7.2-cli/Dockerfile delete mode 100644 images/php/7.2-cli/bin/cloud-build delete mode 100644 images/php/7.2-cli/bin/cloud-deploy delete mode 100644 images/php/7.2-cli/bin/cloud-post-deploy delete mode 100644 images/php/7.2-cli/bin/ece-command delete mode 100644 images/php/7.2-cli/bin/magento-command delete mode 100644 images/php/7.2-cli/bin/magento-installer delete mode 100644 images/php/7.2-cli/bin/mftf-command delete mode 100644 images/php/7.2-cli/bin/run-cron delete mode 100644 images/php/7.2-cli/bin/run-hooks delete mode 100644 images/php/7.2-cli/docker-entrypoint.sh delete mode 100644 images/php/7.2-cli/etc/mail.ini delete mode 100644 images/php/7.2-cli/etc/php-cli.ini delete mode 100644 images/php/7.2-cli/etc/php-gnupg.ini delete mode 100644 images/php/7.2-cli/etc/php-pcov.ini delete mode 100644 images/php/7.2-cli/etc/php-xdebug.ini delete mode 100644 images/php/7.2-fpm/Dockerfile delete mode 100644 images/php/7.2-fpm/docker-entrypoint.sh delete mode 100644 images/php/7.2-fpm/etc/mail.ini delete mode 100644 images/php/7.2-fpm/etc/php-fpm.conf delete mode 100644 images/php/7.2-fpm/etc/php-fpm.ini delete mode 100644 images/php/7.2-fpm/etc/php-gnupg.ini delete mode 100644 images/php/7.2-fpm/etc/php-pcov.ini delete mode 100644 images/php/7.2-fpm/etc/php-xdebug.ini delete mode 100644 images/php/7.3-cli/Dockerfile delete mode 100644 images/php/7.3-cli/bin/cloud-build delete mode 100644 images/php/7.3-cli/bin/cloud-deploy delete mode 100644 images/php/7.3-cli/bin/cloud-post-deploy delete mode 100644 images/php/7.3-cli/bin/ece-command delete mode 100644 images/php/7.3-cli/bin/magento-command delete mode 100644 images/php/7.3-cli/bin/magento-installer delete mode 100644 images/php/7.3-cli/bin/mftf-command delete mode 100644 images/php/7.3-cli/bin/run-cron delete mode 100644 images/php/7.3-cli/bin/run-hooks delete mode 100644 images/php/7.3-cli/docker-entrypoint.sh delete mode 100644 images/php/7.3-cli/etc/mail.ini delete mode 100644 images/php/7.3-cli/etc/php-cli.ini delete mode 100644 images/php/7.3-cli/etc/php-gnupg.ini delete mode 100644 images/php/7.3-cli/etc/php-pcov.ini delete mode 100644 images/php/7.3-cli/etc/php-xdebug.ini delete mode 100644 images/php/7.3-fpm/Dockerfile delete mode 100644 images/php/7.3-fpm/docker-entrypoint.sh delete mode 100644 images/php/7.3-fpm/etc/mail.ini delete mode 100644 images/php/7.3-fpm/etc/php-fpm.conf delete mode 100644 images/php/7.3-fpm/etc/php-fpm.ini delete mode 100644 images/php/7.3-fpm/etc/php-gnupg.ini delete mode 100644 images/php/7.3-fpm/etc/php-pcov.ini delete mode 100644 images/php/7.3-fpm/etc/php-xdebug.ini diff --git a/composer.json b/composer.json index fde460ba..5093f6c7 100644 --- a/composer.json +++ b/composer.json @@ -8,15 +8,15 @@ "AFL-3.0" ], "require": { - "php": "^7.2 || ^8.0", + "php": "^8.0", "ext-json": "*", - "composer/composer": "^1.4 || ^2.0", + "composer/composer": "^1.9 || ^2.0", "composer/semver": "@stable", "illuminate/config": "^5.5||^8.77", "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", - "symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4", - "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1|| ^5.4 || ^6.4", - "symfony/yaml": "^3.3 || ^4.0 || ^5.1 || ^5.4|| ^6.4" + "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4", + "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4", + "symfony/yaml": "^4.4 || ^5.1 || ^5.4|| ^6.4" }, "require-dev": { "codeception/codeception": "^4.1", @@ -24,11 +24,11 @@ "codeception/module-db": "^1.0", "codeception/module-phpbrowser": "^1.0", "codeception/module-rest": "^1.2", - "consolidation/robo": "^1.2 || ^2.0", + "consolidation/robo": "^2.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.8", - "phpunit/phpunit": "^8.5 || ^9.5", - "squizlabs/php_codesniffer": "^3.0" + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.6" }, "bin": [ "bin/ece-docker" diff --git a/images/php/7.2-cli/Dockerfile b/images/php/7.2-cli/Dockerfile deleted file mode 100644 index 712c1f95..00000000 --- a/images/php/7.2-cli/Dockerfile +++ /dev/null @@ -1,238 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.2-cli - -ARG COMPOSER_VERSION=1.10.22 -ARG MAGENTO_ROOT=/app -ARG COMPOSER_ALLOW_SUPERUSER=1 -ARG COMPOSER_HOME=/composer -ARG CRONTAB="" - -ENV COMPOSER_MEMORY_LIMIT -1 -ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} -ENV COMPOSER_HOME ${COMPOSER_HOME} -ENV COMPOSER_CLEAR_CACHE false -ENV PHP_MEMORY_LIMIT -1 -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Configure Node.js version -RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - cron \ - git \ - mariadb-client \ - nano \ - nodejs \ - python3 \ - python3-pip \ - redis-tools \ - sendmail-bin \ - sendmail \ - sudo \ - unzip \ - vim \ - openssh-client \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libc-client-dev \ - libkrb5-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - librecode0 \ - librecode-dev \ - libssh2-1 \ - libssh2-1-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml - -# Install Grunt -RUN npm install -g grunt-cli - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ -RUN docker-php-ext-configure \ - imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - opcache --enable-opcache -RUN docker-php-ext-configure \ - zip --with-libzip - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - imap \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - recode \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse-3.1.3 \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - ssh2-1.1.2 \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini -ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -# Get composer installed to /usr/local/bin/composer -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer - -ADD bin/* /usr/local/bin/ - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -ADD docker-entrypoint.sh /docker-entrypoint.sh - -RUN ["chmod", "+x", \ - "/docker-entrypoint.sh", \ - "/usr/local/bin/magento-installer", \ - "/usr/local/bin/magento-command", \ - "/usr/local/bin/mftf-command", \ - "/usr/local/bin/ece-command", \ - "/usr/local/bin/cloud-build", \ - "/usr/local/bin/cloud-deploy", \ - "/usr/local/bin/cloud-post-deploy", \ - "/usr/local/bin/run-cron", \ - "/usr/local/bin/run-hooks" \ -] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["bash"] diff --git a/images/php/7.2-cli/bin/cloud-build b/images/php/7.2-cli/bin/cloud-build deleted file mode 100644 index bbd584c9..00000000 --- a/images/php/7.2-cli/bin/cloud-build +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -RUN_HOOKS="run-hooks" - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Cleaning directories:" - - if [ "$INSTALLATION_TYPE" == "composer" ]; then - echo "Cleaning setup directory." - rm -rf $MAGENTO_ROOT/setup/* - fi - - echo "Cleaning vendor directory." - rm -rf $MAGENTO_ROOT/vendor/* - - echo "Cleaning generated directory." - rm -rf $MAGENTO_ROOT/generated/* - - echo "Removing app/etc/env.php file" - rm -f $MAGENTO_ROOT/app/etc/env.php -fi - -echo "Installing dependencies." - -composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist - -echo "Running \"build\" hook." - -$RUN_HOOKS build - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Setting file permissions." - - chown -R www:www $MAGENTO_ROOT - - find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; - find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; -fi - -echo "Building complete." diff --git a/images/php/7.2-cli/bin/cloud-deploy b/images/php/7.2-cli/bin/cloud-deploy deleted file mode 100644 index f6b891bf..00000000 --- a/images/php/7.2-cli/bin/cloud-deploy +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"deploy\" hook." - -run-hooks deploy - -# check that Varnish exists -if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then - minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") - if [[ "$minor_magento_version" != "2.1" ]]; then - output=$(magento-command config:set system/full_page_cache/caching_application 2) - # as config:set does not return error code, we check output text to continue set varnish settings - if [[ $output == *"Value was saved"* ]]; then - echo "Setting Varnish for Magento FPC." - magento-command setup:config:set --http-cache-hosts=varnish -n - else - echo $output - fi - fi -fi - -# set developer mode if it is configured in $MAGENTO_RUN_MODE -if [ "$MAGENTO_RUN_MODE" == "developer" ]; then - output=$(magento-command deploy:mode:set developer) - if [[ $output == *"Enabled developer mode."* ]]; then - echo "Enabled developer mode." - else - echo $output - fi -fi - - -echo "Deployment finished." diff --git a/images/php/7.2-cli/bin/cloud-post-deploy b/images/php/7.2-cli/bin/cloud-post-deploy deleted file mode 100644 index f5bb3956..00000000 --- a/images/php/7.2-cli/bin/cloud-post-deploy +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"post-deploy\" hook." - -run-hooks post_deploy - -echo "Post deployment finished." diff --git a/images/php/7.2-cli/bin/ece-command b/images/php/7.2-cli/bin/ece-command deleted file mode 100644 index 36d896c5..00000000 --- a/images/php/7.2-cli/bin/ece-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" - -exec $ECE_COMMAND "$@" diff --git a/images/php/7.2-cli/bin/magento-command b/images/php/7.2-cli/bin/magento-command deleted file mode 100644 index 8d439f7d..00000000 --- a/images/php/7.2-cli/bin/magento-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" - -exec $MAGENTO_COMMAND "$@" diff --git a/images/php/7.2-cli/bin/magento-installer b/images/php/7.2-cli/bin/magento-installer deleted file mode 100644 index 73645ab7..00000000 --- a/images/php/7.2-cli/bin/magento-installer +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -BUILD_COMMAND="cloud-build" -DEPLOY_COMMAND="cloud-deploy" - -$BUILD_COMMAND -$DEPLOY_COMMAND diff --git a/images/php/7.2-cli/bin/mftf-command b/images/php/7.2-cli/bin/mftf-command deleted file mode 100644 index 88eaa1df..00000000 --- a/images/php/7.2-cli/bin/mftf-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" - -exec $MFTF_COMMAND "$@" diff --git a/images/php/7.2-cli/bin/run-cron b/images/php/7.2-cli/bin/run-cron deleted file mode 100644 index f6554a5c..00000000 --- a/images/php/7.2-cli/bin/run-cron +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/7.2-cli/bin/run-hooks b/images/php/7.2-cli/bin/run-hooks deleted file mode 100644 index 8ac215c9..00000000 --- a/images/php/7.2-cli/bin/run-hooks +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import json -import base64 - -# Disable output buffering. -os.environ['PYTHONUNBUFFERED'] = "1" - -# The list of available hooks. -available_hooks = ["build", "deploy", "post_deploy"] - - -# Prints a message and returns an exit code. -def error_exit(msg, code=1): - print(msg) - sys.exit(code) - - -# Gets Magento root path. -def get_magento_root(): - try: - return str(os.environ['MAGENTO_ROOT']) - except KeyError: - error_exit('Environment variable MAGENTO_ROOT is not available') - - -# Gets set hooks by hook name. -def get_hooks(hook_name): - try: - application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) - content = json.loads(base64.b64decode(application).decode("utf-8")) - - return content['hooks'][hook_name] - except Exception as exc: - error_exit("Cannot decode string: " + str(exc)) - - -# Main function. -def main(): - if len(sys.argv) != 2: - error_exit("Usage: run-hooks ") - - hook_name = str(sys.argv[1]) - if hook_name not in available_hooks: - error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) - - try: - subprocess.check_call( - get_hooks(hook_name), - shell=True, - cwd=get_magento_root() - ) - except subprocess.CalledProcessError as exc: - error_exit("returned non-zero exit status " + str(exc.returncode)) - - -if __name__ == '__main__': - main() diff --git a/images/php/7.2-cli/docker-entrypoint.sh b/images/php/7.2-cli/docker-entrypoint.sh deleted file mode 100644 index ee380b80..00000000 --- a/images/php/7.2-cli/docker-entrypoint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -if [ ! -z "${CRONTAB}" ]; then - echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log -fi - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Clear composer cache if needed -[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ - composer clearcache - -# Configure composer -[ ! -z "${COMPOSER_VERSION}" ] && \ - composer self-update $COMPOSER_VERSION - -[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ - composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN - -[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ - composer config --global http-basic.repo.magento.com \ - $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD - -exec "$@" diff --git a/images/php/7.2-cli/etc/mail.ini b/images/php/7.2-cli/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/7.2-cli/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/7.2-cli/etc/php-cli.ini b/images/php/7.2-cli/etc/php-cli.ini deleted file mode 100644 index dfaf04e4..00000000 --- a/images/php/7.2-cli/etc/php-cli.ini +++ /dev/null @@ -1,10 +0,0 @@ -; php.ini -memory_limit = ${PHP_MEMORY_LIMIT} -zlib.output_compression = on -realpath_cache_size = 32k -realpath_cache_ttl = 7200 -always_populate_raw_post_data = -1 -max_input_vars = 10000 -session.gc_probability = 1 -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/7.2-cli/etc/php-gnupg.ini b/images/php/7.2-cli/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/7.2-cli/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/7.2-cli/etc/php-pcov.ini b/images/php/7.2-cli/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/7.2-cli/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/7.2-cli/etc/php-xdebug.ini b/images/php/7.2-cli/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/7.2-cli/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/7.2-fpm/Dockerfile b/images/php/7.2-fpm/Dockerfile deleted file mode 100644 index e0ee3cbd..00000000 --- a/images/php/7.2-fpm/Dockerfile +++ /dev/null @@ -1,196 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.2-fpm - -ARG MAGENTO_ROOT=/app - -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV UPLOAD_MAX_FILESIZE 64M -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - sendmail-bin \ - sendmail \ - sudo \ - iproute2 \ - git \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libc-client-dev \ - libkrb5-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - librecode0 \ - librecode-dev \ - libssh2-1 \ - libssh2-1-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ -RUN docker-php-ext-configure \ - imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - opcache --enable-opcache -RUN docker-php-ext-configure \ - zip --with-libzip - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - imap \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - recode \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse-3.1.3 \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - ssh2-1.1.2 \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini -COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -COPY etc/php-fpm.conf /usr/local/etc/ -COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN ["chmod", "+x", "/docker-entrypoint.sh"] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["php-fpm", "-R"] diff --git a/images/php/7.2-fpm/docker-entrypoint.sh b/images/php/7.2-fpm/docker-entrypoint.sh deleted file mode 100644 index 0c8c5c9c..00000000 --- a/images/php/7.2-fpm/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Set host.docker.internal if not available -HOST_NAME="host.docker.internal" -HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") -if [[ "$HOST_IP" == "$HOST_NAME" ]]; then - HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') - printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts -fi - -exec "$@" diff --git a/images/php/7.2-fpm/etc/mail.ini b/images/php/7.2-fpm/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/7.2-fpm/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/7.2-fpm/etc/php-fpm.conf b/images/php/7.2-fpm/etc/php-fpm.conf deleted file mode 100644 index d988b314..00000000 --- a/images/php/7.2-fpm/etc/php-fpm.conf +++ /dev/null @@ -1,25 +0,0 @@ -[global] - -error_log = /proc/self/fd/2 -daemonize = no - -[www] - -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 - -listen = [::]:9000 - -pm = dynamic -pm.max_children = 10 -pm.start_servers = 4 -pm.min_spare_servers = 2 -pm.max_spare_servers = 6 -pm.status_path = /status - -clear_env = no - -env[MAGE_MODE] = $MAGENTO_RUN_MODE - -; Ensure worker stdout and stderr are sent to the main error log. -catch_workers_output = yes diff --git a/images/php/7.2-fpm/etc/php-fpm.ini b/images/php/7.2-fpm/etc/php-fpm.ini deleted file mode 100644 index 387c8aeb..00000000 --- a/images/php/7.2-fpm/etc/php-fpm.ini +++ /dev/null @@ -1,4 +0,0 @@ -memory_limit = ${PHP_MEMORY_LIMIT} -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} -user_ini.filename = diff --git a/images/php/7.2-fpm/etc/php-gnupg.ini b/images/php/7.2-fpm/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/7.2-fpm/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/7.2-fpm/etc/php-pcov.ini b/images/php/7.2-fpm/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/7.2-fpm/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/7.2-fpm/etc/php-xdebug.ini b/images/php/7.2-fpm/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/7.2-fpm/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/7.3-cli/Dockerfile b/images/php/7.3-cli/Dockerfile deleted file mode 100644 index 0cc15df7..00000000 --- a/images/php/7.3-cli/Dockerfile +++ /dev/null @@ -1,235 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.3-cli - -ARG COMPOSER_VERSION=1.10.22 -ARG MAGENTO_ROOT=/app -ARG COMPOSER_ALLOW_SUPERUSER=1 -ARG COMPOSER_HOME=/composer -ARG CRONTAB="" - -ENV COMPOSER_MEMORY_LIMIT -1 -ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} -ENV COMPOSER_HOME ${COMPOSER_HOME} -ENV COMPOSER_CLEAR_CACHE false -ENV PHP_MEMORY_LIMIT -1 -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Configure Node.js version -RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - cron \ - git \ - mariadb-client \ - nano \ - nodejs \ - python3 \ - python3-pip \ - redis-tools \ - sendmail-bin \ - sendmail \ - sudo \ - unzip \ - vim \ - openssh-client \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libc-client-dev \ - libkrb5-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - librecode0 \ - librecode-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml - -# Install Grunt -RUN npm install -g grunt-cli - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ -RUN docker-php-ext-configure \ - imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - opcache --enable-opcache -RUN docker-php-ext-configure \ - zip --with-libzip - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - imap \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - recode \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini -ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -# Get composer installed to /usr/local/bin/composer -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer - -ADD bin/* /usr/local/bin/ - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -ADD docker-entrypoint.sh /docker-entrypoint.sh - -RUN ["chmod", "+x", \ - "/docker-entrypoint.sh", \ - "/usr/local/bin/magento-installer", \ - "/usr/local/bin/magento-command", \ - "/usr/local/bin/mftf-command", \ - "/usr/local/bin/ece-command", \ - "/usr/local/bin/cloud-build", \ - "/usr/local/bin/cloud-deploy", \ - "/usr/local/bin/cloud-post-deploy", \ - "/usr/local/bin/run-cron", \ - "/usr/local/bin/run-hooks" \ -] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["bash"] diff --git a/images/php/7.3-cli/bin/cloud-build b/images/php/7.3-cli/bin/cloud-build deleted file mode 100644 index bbd584c9..00000000 --- a/images/php/7.3-cli/bin/cloud-build +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -RUN_HOOKS="run-hooks" - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Cleaning directories:" - - if [ "$INSTALLATION_TYPE" == "composer" ]; then - echo "Cleaning setup directory." - rm -rf $MAGENTO_ROOT/setup/* - fi - - echo "Cleaning vendor directory." - rm -rf $MAGENTO_ROOT/vendor/* - - echo "Cleaning generated directory." - rm -rf $MAGENTO_ROOT/generated/* - - echo "Removing app/etc/env.php file" - rm -f $MAGENTO_ROOT/app/etc/env.php -fi - -echo "Installing dependencies." - -composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist - -echo "Running \"build\" hook." - -$RUN_HOOKS build - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Setting file permissions." - - chown -R www:www $MAGENTO_ROOT - - find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; - find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; -fi - -echo "Building complete." diff --git a/images/php/7.3-cli/bin/cloud-deploy b/images/php/7.3-cli/bin/cloud-deploy deleted file mode 100644 index f6b891bf..00000000 --- a/images/php/7.3-cli/bin/cloud-deploy +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"deploy\" hook." - -run-hooks deploy - -# check that Varnish exists -if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then - minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") - if [[ "$minor_magento_version" != "2.1" ]]; then - output=$(magento-command config:set system/full_page_cache/caching_application 2) - # as config:set does not return error code, we check output text to continue set varnish settings - if [[ $output == *"Value was saved"* ]]; then - echo "Setting Varnish for Magento FPC." - magento-command setup:config:set --http-cache-hosts=varnish -n - else - echo $output - fi - fi -fi - -# set developer mode if it is configured in $MAGENTO_RUN_MODE -if [ "$MAGENTO_RUN_MODE" == "developer" ]; then - output=$(magento-command deploy:mode:set developer) - if [[ $output == *"Enabled developer mode."* ]]; then - echo "Enabled developer mode." - else - echo $output - fi -fi - - -echo "Deployment finished." diff --git a/images/php/7.3-cli/bin/cloud-post-deploy b/images/php/7.3-cli/bin/cloud-post-deploy deleted file mode 100644 index f5bb3956..00000000 --- a/images/php/7.3-cli/bin/cloud-post-deploy +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"post-deploy\" hook." - -run-hooks post_deploy - -echo "Post deployment finished." diff --git a/images/php/7.3-cli/bin/ece-command b/images/php/7.3-cli/bin/ece-command deleted file mode 100644 index 36d896c5..00000000 --- a/images/php/7.3-cli/bin/ece-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" - -exec $ECE_COMMAND "$@" diff --git a/images/php/7.3-cli/bin/magento-command b/images/php/7.3-cli/bin/magento-command deleted file mode 100644 index 8d439f7d..00000000 --- a/images/php/7.3-cli/bin/magento-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" - -exec $MAGENTO_COMMAND "$@" diff --git a/images/php/7.3-cli/bin/magento-installer b/images/php/7.3-cli/bin/magento-installer deleted file mode 100644 index 73645ab7..00000000 --- a/images/php/7.3-cli/bin/magento-installer +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -BUILD_COMMAND="cloud-build" -DEPLOY_COMMAND="cloud-deploy" - -$BUILD_COMMAND -$DEPLOY_COMMAND diff --git a/images/php/7.3-cli/bin/mftf-command b/images/php/7.3-cli/bin/mftf-command deleted file mode 100644 index 88eaa1df..00000000 --- a/images/php/7.3-cli/bin/mftf-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" - -exec $MFTF_COMMAND "$@" diff --git a/images/php/7.3-cli/bin/run-cron b/images/php/7.3-cli/bin/run-cron deleted file mode 100644 index f6554a5c..00000000 --- a/images/php/7.3-cli/bin/run-cron +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/7.3-cli/bin/run-hooks b/images/php/7.3-cli/bin/run-hooks deleted file mode 100644 index 8ac215c9..00000000 --- a/images/php/7.3-cli/bin/run-hooks +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import json -import base64 - -# Disable output buffering. -os.environ['PYTHONUNBUFFERED'] = "1" - -# The list of available hooks. -available_hooks = ["build", "deploy", "post_deploy"] - - -# Prints a message and returns an exit code. -def error_exit(msg, code=1): - print(msg) - sys.exit(code) - - -# Gets Magento root path. -def get_magento_root(): - try: - return str(os.environ['MAGENTO_ROOT']) - except KeyError: - error_exit('Environment variable MAGENTO_ROOT is not available') - - -# Gets set hooks by hook name. -def get_hooks(hook_name): - try: - application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) - content = json.loads(base64.b64decode(application).decode("utf-8")) - - return content['hooks'][hook_name] - except Exception as exc: - error_exit("Cannot decode string: " + str(exc)) - - -# Main function. -def main(): - if len(sys.argv) != 2: - error_exit("Usage: run-hooks ") - - hook_name = str(sys.argv[1]) - if hook_name not in available_hooks: - error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) - - try: - subprocess.check_call( - get_hooks(hook_name), - shell=True, - cwd=get_magento_root() - ) - except subprocess.CalledProcessError as exc: - error_exit("returned non-zero exit status " + str(exc.returncode)) - - -if __name__ == '__main__': - main() diff --git a/images/php/7.3-cli/docker-entrypoint.sh b/images/php/7.3-cli/docker-entrypoint.sh deleted file mode 100644 index ee380b80..00000000 --- a/images/php/7.3-cli/docker-entrypoint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -if [ ! -z "${CRONTAB}" ]; then - echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log -fi - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Clear composer cache if needed -[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ - composer clearcache - -# Configure composer -[ ! -z "${COMPOSER_VERSION}" ] && \ - composer self-update $COMPOSER_VERSION - -[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ - composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN - -[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ - composer config --global http-basic.repo.magento.com \ - $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD - -exec "$@" diff --git a/images/php/7.3-cli/etc/mail.ini b/images/php/7.3-cli/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/7.3-cli/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/7.3-cli/etc/php-cli.ini b/images/php/7.3-cli/etc/php-cli.ini deleted file mode 100644 index dfaf04e4..00000000 --- a/images/php/7.3-cli/etc/php-cli.ini +++ /dev/null @@ -1,10 +0,0 @@ -; php.ini -memory_limit = ${PHP_MEMORY_LIMIT} -zlib.output_compression = on -realpath_cache_size = 32k -realpath_cache_ttl = 7200 -always_populate_raw_post_data = -1 -max_input_vars = 10000 -session.gc_probability = 1 -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/7.3-cli/etc/php-gnupg.ini b/images/php/7.3-cli/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/7.3-cli/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/7.3-cli/etc/php-pcov.ini b/images/php/7.3-cli/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/7.3-cli/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/7.3-cli/etc/php-xdebug.ini b/images/php/7.3-cli/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/7.3-cli/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/7.3-fpm/Dockerfile b/images/php/7.3-fpm/Dockerfile deleted file mode 100644 index 39e6c977..00000000 --- a/images/php/7.3-fpm/Dockerfile +++ /dev/null @@ -1,193 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.3-fpm - -ARG MAGENTO_ROOT=/app - -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV UPLOAD_MAX_FILESIZE 64M -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - sendmail-bin \ - sendmail \ - sudo \ - iproute2 \ - git \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libc-client-dev \ - libkrb5-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - librecode0 \ - librecode-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ -RUN docker-php-ext-configure \ - imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - opcache --enable-opcache -RUN docker-php-ext-configure \ - zip --with-libzip - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - imap \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - recode \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini -COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -COPY etc/php-fpm.conf /usr/local/etc/ -COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN ["chmod", "+x", "/docker-entrypoint.sh"] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["php-fpm", "-R"] diff --git a/images/php/7.3-fpm/docker-entrypoint.sh b/images/php/7.3-fpm/docker-entrypoint.sh deleted file mode 100644 index 0c8c5c9c..00000000 --- a/images/php/7.3-fpm/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Set host.docker.internal if not available -HOST_NAME="host.docker.internal" -HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") -if [[ "$HOST_IP" == "$HOST_NAME" ]]; then - HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') - printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts -fi - -exec "$@" diff --git a/images/php/7.3-fpm/etc/mail.ini b/images/php/7.3-fpm/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/7.3-fpm/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/7.3-fpm/etc/php-fpm.conf b/images/php/7.3-fpm/etc/php-fpm.conf deleted file mode 100644 index d988b314..00000000 --- a/images/php/7.3-fpm/etc/php-fpm.conf +++ /dev/null @@ -1,25 +0,0 @@ -[global] - -error_log = /proc/self/fd/2 -daemonize = no - -[www] - -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 - -listen = [::]:9000 - -pm = dynamic -pm.max_children = 10 -pm.start_servers = 4 -pm.min_spare_servers = 2 -pm.max_spare_servers = 6 -pm.status_path = /status - -clear_env = no - -env[MAGE_MODE] = $MAGENTO_RUN_MODE - -; Ensure worker stdout and stderr are sent to the main error log. -catch_workers_output = yes diff --git a/images/php/7.3-fpm/etc/php-fpm.ini b/images/php/7.3-fpm/etc/php-fpm.ini deleted file mode 100644 index 387c8aeb..00000000 --- a/images/php/7.3-fpm/etc/php-fpm.ini +++ /dev/null @@ -1,4 +0,0 @@ -memory_limit = ${PHP_MEMORY_LIMIT} -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} -user_ini.filename = diff --git a/images/php/7.3-fpm/etc/php-gnupg.ini b/images/php/7.3-fpm/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/7.3-fpm/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/7.3-fpm/etc/php-pcov.ini b/images/php/7.3-fpm/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/7.3-fpm/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/7.3-fpm/etc/php-xdebug.ini b/images/php/7.3-fpm/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/7.3-fpm/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index d002afc5..5cea131b 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,11 +26,9 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']; + private const SUPPORTED_VERSIONS = ['7.4', '8.0', '8.1', '8.2', '8.3']; private const VERSION_MAP = [ - '7.2' => '7.2', - '7.3' => '7.3', '7.4' => '7.4', '8.0' => '8.0.14', '8.1' => '8.1.1', diff --git a/src/Compose/Php/ConfigFilesResolver.php b/src/Compose/Php/ConfigFilesResolver.php index a40f0fee..fab1badf 100644 --- a/src/Compose/Php/ConfigFilesResolver.php +++ b/src/Compose/Php/ConfigFilesResolver.php @@ -29,31 +29,31 @@ class ConfigFilesResolver private const CONFIG_FILES = [ 'cli' => [ 'cli' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-cli.ini', self::TO_PATH => 'etc/php-cli.ini', ], ], 'xdebug' => [ - '>=7.2' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-xdebug-3.ini', self::TO_PATH => 'etc/php-xdebug.ini', ], ], 'pcov' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-pcov.ini', self::TO_PATH => 'etc/php-pcov.ini', ], ], 'mail' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/mail.ini', self::TO_PATH => 'etc/mail.ini', ], ], 'gnupg' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-gnupg.ini', self::TO_PATH => 'etc/php-gnupg.ini', ], @@ -61,37 +61,37 @@ class ConfigFilesResolver ], 'fpm' => [ 'fpm' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-fpm.ini', self::TO_PATH => 'etc/php-fpm.ini', ], ], 'xdebug' => [ - '>=7.2' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-xdebug-3.ini', self::TO_PATH => 'etc/php-xdebug.ini', ], ], 'pcov' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-pcov.ini', self::TO_PATH => 'etc/php-pcov.ini', ], ], 'mail' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/mail.ini', self::TO_PATH => 'etc/mail.ini', ], ], 'fpm.conf' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-fpm.conf', self::TO_PATH => 'etc/php-fpm.conf', ], ], 'gnupg' => [ - '>=7.0' => [ + '>=8.0' => [ self::FROM_PATH => 'etc/php-gnupg.ini', self::TO_PATH => 'etc/php-gnupg.ini', ], diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 97db7a5b..f7f172d6 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -340,7 +340,7 @@ public static function getConfig(): array '>=7.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], ], 'zookeeper' => [ - '>=7.2 <8.2' => [ + '>=8.0 <8.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, // phpcs:disable self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH @@ -423,7 +423,7 @@ public static function getConfig(): array ], ], 'xdebug' => [ - '>=7.2 <8.2' => [ + '>=8.0 <8.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.1.2', ], diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index 669cf39d..76c832b2 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -8,14 +8,14 @@ namespace Magento\CloudDocker\Test\Functional\Acceptance; /** - * @group php73 + * @group php83 */ class ServicesCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.3.4'; + protected const TEMPLATE_VERSION = '2.4.7'; public function _before(\CliTester $I): void { @@ -99,26 +99,26 @@ protected function servicesDataProvider(): array ], 'notExpectedResult' => ['rabbitmq', 'selenium/standalone-chrome:latest', 'cron'], ], - 'Redis 3.2, MariaDB 10.1, php 7.2, rmq 3.5' => [ - 'options' => '--redis=3.2 --db=10.1 --php=7.2 --rmq=3.5', + 'Redis 3.2, MariaDB 10.1, php 8.3, rmq 3.5' => [ + 'options' => '--redis=3.2 --db=10.1 --php=8.3 --rmq=3.5', 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.2-fpm-1.3', + 'magento/magento-cloud-docker-php:8.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', 'rabbitmq:3.5' ], 'notExpectedResult' => ['selenium', 'cron'], ], - 'Redis 4.0, MariaDB 10.2, php 7.4, rmq 3.6' => [ + 'Redis 4.0, MariaDB 10.2, php 8.0, rmq 3.6' => [ 'options' => '--redis=4.0 --db=10.2 --php=7.4 --rmq=3.6', 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.4-fpm-1.3', + 'magento/magento-cloud-docker-php:8.0-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', 'rabbitmq:3.6' @@ -131,7 +131,7 @@ protected function servicesDataProvider(): array 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.3-fpm-1.3', + 'magento/magento-cloud-docker-php:8.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', 'cron', diff --git a/src/Test/Integration/BuildCustomComposeTest.php b/src/Test/Integration/BuildCustomComposeTest.php index de1600c7..235dfc7f 100644 --- a/src/Test/Integration/BuildCustomComposeTest.php +++ b/src/Test/Integration/BuildCustomComposeTest.php @@ -94,7 +94,7 @@ public function buildDataProvider(): array ], 'services' => [ 'php' => [ - 'version' => '7.2', + 'version' => '8.0', 'enabled' => true, 'extensions' => [ 'enabled' => ['xsl'] @@ -149,7 +149,7 @@ public function buildDataProvider(): array ], 'services' => [ 'php' => [ - 'version' => '7.2', + 'version' => '8.0', 'enabled' => true, 'extensions' => [ 'enabled' => ['xsl'] @@ -290,7 +290,7 @@ public function buildDataProvider(): array 'services' => [ 'php' => [ 'enabled' => true, - 'version' => '7.2', + 'version' => '8.0', ], 'mysql' => [ 'enabled' => true, @@ -313,7 +313,7 @@ public function buildDataProvider(): array 'services' => [ 'php' => [ 'enabled' => true, - 'version' => '7.2', + 'version' => '8.0', ], 'mysql' => [ 'enabled' => true, @@ -336,7 +336,7 @@ public function buildDataProvider(): array 'services' => [ 'php' => [ 'enabled' => true, - 'version' => '7.2', + 'version' => '8.0', ], 'mysql' => [ 'enabled' => true, From 09c80c7902c2a0ff8c76d360cd75325f5dda1146 Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Mon, 15 Jul 2024 20:52:55 +0530 Subject: [PATCH 046/113] Refactoring of code. --- src/Test/Functional/Acceptance/ServicesCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index 76c832b2..023d66b8 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -113,7 +113,7 @@ protected function servicesDataProvider(): array 'notExpectedResult' => ['selenium', 'cron'], ], 'Redis 4.0, MariaDB 10.2, php 8.0, rmq 3.6' => [ - 'options' => '--redis=4.0 --db=10.2 --php=7.4 --rmq=3.6', + 'options' => '--redis=4.0 --db=10.2 --php=8.0 --rmq=3.6', 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', From 9a0f2f305ef245d8c886c811830a591109c82078 Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Thu, 18 Jul 2024 12:19:09 +0530 Subject: [PATCH 047/113] Update code with comments. --- src/Command/Image/GeneratePhp.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 5cea131b..db55ba51 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,10 +26,9 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.4', '8.0', '8.1', '8.2', '8.3']; + private const SUPPORTED_VERSIONS = ['8.0', '8.1', '8.2', '8.3']; private const VERSION_MAP = [ - '7.4' => '7.4', '8.0' => '8.0.14', '8.1' => '8.1.1', '8.2' => '8.2', From a46c8fbf39c56b2cb711d13c2d593394ebc49f4e Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Thu, 18 Jul 2024 19:42:51 +0530 Subject: [PATCH 048/113] Refactoring and remove files. --- .../Acceptance/Acceptance72Cest.php | 19 ----- .../Acceptance/Acceptance73Cest.php | 19 ----- .../Acceptance/Acceptance74Cest.php | 19 ----- .../Acceptance/Elasticsearch72Cest.php | 38 --------- .../Acceptance/Elasticsearch73Cest.php | 52 ------------ .../Acceptance/Elasticsearch74Cest.php | 53 ------------ .../Functional/Acceptance/Services72Cest.php | 80 ------------------- 7 files changed, 280 deletions(-) delete mode 100644 src/Test/Functional/Acceptance/Acceptance72Cest.php delete mode 100644 src/Test/Functional/Acceptance/Acceptance73Cest.php delete mode 100644 src/Test/Functional/Acceptance/Acceptance74Cest.php delete mode 100644 src/Test/Functional/Acceptance/Elasticsearch72Cest.php delete mode 100644 src/Test/Functional/Acceptance/Elasticsearch73Cest.php delete mode 100644 src/Test/Functional/Acceptance/Elasticsearch74Cest.php delete mode 100644 src/Test/Functional/Acceptance/Services72Cest.php diff --git a/src/Test/Functional/Acceptance/Acceptance72Cest.php b/src/Test/Functional/Acceptance/Acceptance72Cest.php deleted file mode 100644 index b435d2d9..00000000 --- a/src/Test/Functional/Acceptance/Acceptance72Cest.php +++ /dev/null @@ -1,19 +0,0 @@ - '6.5', - 'xms' => '516m', - 'xmx' => '516m', - 'param' => [ - 'key' => 'index.store.type', - 'value' => 'fs', - 'needle' => '"index":{"store":{"type":"fs"}}', - ] - ], - ]; - } -} diff --git a/src/Test/Functional/Acceptance/Elasticsearch73Cest.php b/src/Test/Functional/Acceptance/Elasticsearch73Cest.php deleted file mode 100644 index c74097fd..00000000 --- a/src/Test/Functional/Acceptance/Elasticsearch73Cest.php +++ /dev/null @@ -1,52 +0,0 @@ - '6.5', - 'xms' => '518m', - 'xmx' => '518m', - 'param' => [ - 'key' => 'node.store.allow_mmapfs', - 'value' => 'false', - 'needle' => '"store":{"allow_mmapfs":"false"}', - ] - ], - [ - 'version' => '7.5', - 'xms' => '520m', - 'xmx' => '520m', - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - ]; - } -} diff --git a/src/Test/Functional/Acceptance/Elasticsearch74Cest.php b/src/Test/Functional/Acceptance/Elasticsearch74Cest.php deleted file mode 100644 index 18f4d7d0..00000000 --- a/src/Test/Functional/Acceptance/Elasticsearch74Cest.php +++ /dev/null @@ -1,53 +0,0 @@ - '6.5', - 'xms' => '518m', - 'xmx' => '518m', - 'param' => [ - 'key' => 'node.store.allow_mmapfs', - 'value' => 'false', - 'needle' => '"store":{"allow_mmapfs":"false"}', - ] - ], - [ - 'version' => '7.5', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - ]; - } -} diff --git a/src/Test/Functional/Acceptance/Services72Cest.php b/src/Test/Functional/Acceptance/Services72Cest.php deleted file mode 100644 index 65e71849..00000000 --- a/src/Test/Functional/Acceptance/Services72Cest.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - 'options' => '', - 'expectedResult' => [ - 'redis:5.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.2-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.2' - ], - 'notExpectedResult' => ['rabbitmq', 'selenium/standalone-chrome:latest', 'cron'], - ], - 'Redis 3.2, MariaDB 10.1, php 7.4, rmq 3.5' => [ - 'options' => '--redis=3.2 --db=10.1 --php=7.4 --rmq=3.5', - 'expectedResult' => [ - 'redis:3.2', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.4-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.1', - 'rabbitmq:3.5' - ], - 'notExpectedResult' => ['selenium', 'cron'], - ], - 'Redis 4.0, MariaDB 10.2, php 7.2, rmq 3.6' => [ - 'options' => '--redis=4.0 --db=10.2 --php=7.2 --rmq=3.6', - 'expectedResult' => [ - 'redis:4.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.2-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.2', - 'rabbitmq:3.6' - ], - 'notExpectedResult' => ['selenium', 'cron'], - ], - 'With cron and selenium' => [ - 'options' => '--with-cron --with-selenium', - 'expectedResult' => [ - 'redis:5.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.2-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.2', - 'cron', - 'selenium/standalone-chrome:latest' - ], - 'notExpectedResult' => ['rabbitmq'], - ], - ]; - } -} From 3fd55665b96a75544d4655bf572030a719aed7bb Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Wed, 24 Jul 2024 14:54:24 +0530 Subject: [PATCH 049/113] Refactoring code as asuggested. --- .../Functional/Acceptance/ServicesCest.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index 023d66b8..3b9f6416 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -90,50 +90,50 @@ protected function servicesDataProvider(): array 'Default' => [ 'options' => '', 'expectedResult' => [ - 'redis:5.0', + 'redis:7.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.2' + 'mariadb:10.4' ], 'notExpectedResult' => ['rabbitmq', 'selenium/standalone-chrome:latest', 'cron'], ], - 'Redis 3.2, MariaDB 10.1, php 8.3, rmq 3.5' => [ - 'options' => '--redis=3.2 --db=10.1 --php=8.3 --rmq=3.5', + 'Redis 6.0, MariaDB 10.4, php 8.3, rmq 3.8' => [ + 'options' => '--redis=6.0 --db=10.4 --php=8.3 --rmq=3.8', 'expectedResult' => [ - 'redis:3.2', + 'redis:6.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:8.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.1', - 'rabbitmq:3.5' + 'mariadb:10.4', + 'rabbitmq:3.8' ], 'notExpectedResult' => ['selenium', 'cron'], ], - 'Redis 4.0, MariaDB 10.2, php 8.0, rmq 3.6' => [ - 'options' => '--redis=4.0 --db=10.2 --php=8.0 --rmq=3.6', + 'Redis 7.0, MariaDB 10.4, php 8.0, rmq 3.8' => [ + 'options' => '--redis=7.0 --db=10.4 --php=8.0 --rmq=3.8', 'expectedResult' => [ - 'redis:4.0', + 'redis:7.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:8.0-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', - 'rabbitmq:3.6' + 'rabbitmq:3.8' ], 'notExpectedResult' => ['selenium', 'cron'], ], 'With cron and selenium' => [ 'options' => '--with-cron --with-selenium', 'expectedResult' => [ - 'redis:5.0', + 'redis:7.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:8.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.2', + 'mariadb:10.4', 'cron', 'selenium/standalone-chrome:latest' ], From 8af90f15795ada6213bd0f806f30bc96e0dfcd9f Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Fri, 26 Jul 2024 16:39:17 +0530 Subject: [PATCH 050/113] Refactoring code as asuggested. --- .../Functional/Acceptance/ServicesCest.php | 144 ------------------ 1 file changed, 144 deletions(-) delete mode 100644 src/Test/Functional/Acceptance/ServicesCest.php diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php deleted file mode 100644 index 3b9f6416..00000000 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ /dev/null @@ -1,144 +0,0 @@ -assertTrue($I->generateDockerCompose('--mode=production ' . $data['options'])); - $I->assertTrue($I->replaceImagesWithCurrentDockerVersion()); - $I->assertTrue($I->startEnvironment()); - $I->assertTrue($I->runBashCommand('docker ps')); - $I->seeInOutput($data['expectedResult']); - $I->stopEnvironment(); - if (isset($data['notExpectedResult'])) { - $I->doNotSeeInOutput($data['notExpectedResult']); - } - } catch (\Exception $exception) { - parent::_after($I); - self::$beforeShouldRun = true; - throw $exception; - } - - if (self::$counter === $this->getVariantsCount()) { - parent::_after($I); - } - } - - /** - * @return int - */ - protected function getVariantsCount(): int - { - return sizeof($this->servicesDataProvider()); - } - - /** - * @return array - */ - protected function servicesDataProvider(): array - { - return [ - 'Default' => [ - 'options' => '', - 'expectedResult' => [ - 'redis:7.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:7.3-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.4' - ], - 'notExpectedResult' => ['rabbitmq', 'selenium/standalone-chrome:latest', 'cron'], - ], - 'Redis 6.0, MariaDB 10.4, php 8.3, rmq 3.8' => [ - 'options' => '--redis=6.0 --db=10.4 --php=8.3 --rmq=3.8', - 'expectedResult' => [ - 'redis:6.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:8.3-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.4', - 'rabbitmq:3.8' - ], - 'notExpectedResult' => ['selenium', 'cron'], - ], - 'Redis 7.0, MariaDB 10.4, php 8.0, rmq 3.8' => [ - 'options' => '--redis=7.0 --db=10.4 --php=8.0 --rmq=3.8', - 'expectedResult' => [ - 'redis:7.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:8.0-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.2', - 'rabbitmq:3.8' - ], - 'notExpectedResult' => ['selenium', 'cron'], - ], - 'With cron and selenium' => [ - 'options' => '--with-cron --with-selenium', - 'expectedResult' => [ - 'redis:7.0', - 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.24-1.3', - 'magento/magento-cloud-docker-php:8.3-fpm-1.3', - 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', - 'mariadb:10.4', - 'cron', - 'selenium/standalone-chrome:latest' - ], - 'notExpectedResult' => ['rabbitmq'], - ], - ]; - } -} From 52d98580e7caf4ef5cb5af2599b1e032aa2e5e6e Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Wed, 14 Aug 2024 16:49:54 +0530 Subject: [PATCH 051/113] Replaced 7.0 and 7.3 to 8.0 --- .../_files/cloud_base/.magento.app.yaml | 2 +- .../_files/cloud_base/docker-compose.exp.yml | 8 ++++---- .../_files/cloud_base_developer/.magento.app.yaml | 2 +- .../cloud_base_developer/docker-compose.exp.yml | 8 ++++---- .../cloud_base_developer_manual/.magento.app.yaml | 2 +- .../docker-compose.exp.yml | 8 ++++---- .../_files/cloud_base_mftf/.magento.app.yaml | 2 +- .../_files/cloud_base_mftf/docker-compose.exp.yml | 14 +++++++------- .../_files/cloud_base_os_2.3_cli/.magento.app.yaml | 2 +- .../cloud_base_os_2.3_cli/docker-compose.exp.yml | 8 ++++---- .../_files/cloud_base_os_2_cli/.magento.app.yaml | 2 +- .../cloud_base_os_2_cli/docker-compose.exp.yml | 8 ++++---- .../_files/cloud_base_test/.magento.app.yaml | 2 +- .../_files/cloud_base_test/docker-compose.exp.yml | 14 +++++++------- .../.magento.app.yaml | 2 +- .../docker-compose.exp.yml | 8 ++++---- .../.magento.app.yaml | 2 +- .../docker-compose.exp.yml | 8 ++++---- .../.magento.app.yaml | 2 +- .../docker-compose.exp.yml | 8 ++++---- .../_files/cloud_no_tls_service/.magento.app.yaml | 2 +- .../cloud_no_tls_service/docker-compose.exp.yml | 8 ++++---- .../.magento.app.yaml | 2 +- .../docker-compose.exp.yml | 8 ++++---- .../cloud_no_varnish_service/.magento.app.yaml | 2 +- .../docker-compose.exp.yml | 8 ++++---- .../custom_cloud_base/docker-compose.exp.yml | 8 ++++---- .../docker-compose.exp.yml | 8 ++++---- .../docker-compose.exp.yml | 8 ++++---- .../docker-compose.exp.yml | 8 ++++---- .../docker-compose.exp.yml | 8 ++++---- .../_files/custom_registry/.magento.app.yaml | 2 +- .../_files/custom_registry/docker-compose.exp.yml | 8 ++++---- 33 files changed, 96 insertions(+), 96 deletions(-) diff --git a/src/Test/Integration/_files/cloud_base/.magento.app.yaml b/src/Test/Integration/_files/cloud_base/.magento.app.yaml index 03f4f7b2..2c4f919c 100644 --- a/src/Test/Integration/_files/cloud_base/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index b30d706b..74dfdd7f 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: - opensearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -156,14 +156,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -185,7 +185,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_base_developer/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_developer/.magento.app.yaml index 03f4f7b2..2c4f919c 100644 --- a/src/Test/Integration/_files/cloud_base_developer/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_developer/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index 9efb15b4..74a84bf7 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: - opensearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:delegated' @@ -142,7 +142,7 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - MAGENTO_RUN_MODE=developer @@ -150,7 +150,7 @@ services: - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:delegated' @@ -169,7 +169,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:delegated' diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_developer_manual/.magento.app.yaml index 0fae6f4b..0dac5bfe 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index 974390b4..54c717fd 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -63,7 +63,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - 'magento-app:/app' @@ -122,7 +122,7 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - MAGENTO_RUN_MODE=developer @@ -130,7 +130,7 @@ services: - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - 'magento-app:/app' @@ -147,7 +147,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - 'magento-app:/app' diff --git a/src/Test/Integration/_files/cloud_base_mftf/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_mftf/.magento.app.yaml index 03f4f7b2..2c4f919c 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_mftf/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index f42e86ff..e25a911e 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -51,7 +51,7 @@ services: - redis.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - './magento2ce:/app:ro,delegated' @@ -140,7 +140,7 @@ services: condition: service_started test: hostname: test.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - './magento2ce:/app:rw,delegated' @@ -164,7 +164,7 @@ services: condition: service_healthy fpm_xdebug: hostname: fpm_xdebug.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - './magento2ce:/app:ro,delegated' @@ -187,13 +187,13 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - './magento2ce:/app:rw,delegated' @@ -211,7 +211,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - './magento2ce:/app:ro,delegated' @@ -234,7 +234,7 @@ services: condition: service_healthy cron: hostname: cron.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic command: run-cron environment: diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml index 03f4f7b2..2c4f919c 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml index 7487f54f..d3cf9d96 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: - opensearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -156,14 +156,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -185,7 +185,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml index 03f4f7b2..2c4f919c 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml index 044e3738..8b774054 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: - opensearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -156,14 +156,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -185,7 +185,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_base_test/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_test/.magento.app.yaml index 13ccc132..003f041a 100644 --- a/src/Test/Integration/_files/cloud_base_test/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_test/.magento.app.yaml @@ -1,6 +1,6 @@ name: mymagento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index ca55c534..93cc628a 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -51,7 +51,7 @@ services: - redis.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -126,7 +126,7 @@ services: condition: service_started test: hostname: test.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -150,7 +150,7 @@ services: condition: service_healthy fpm_xdebug: hostname: fpm_xdebug.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -173,13 +173,13 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium zookeeper' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -197,7 +197,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -220,7 +220,7 @@ services: condition: service_healthy cron: hostname: cron.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic command: run-cron environment: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.magento.app.yaml index aeaadbd0..b9e57185 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.magento.app.yaml @@ -1,6 +1,6 @@ name: mymagento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index ee750e4a..79de8db1 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -62,7 +62,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -135,14 +135,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium zookeeper' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -162,7 +162,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.magento.app.yaml index aeaadbd0..b9e57185 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.magento.app.yaml @@ -1,6 +1,6 @@ name: mymagento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index e0a50c5a..8c3eacb0 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -62,7 +62,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -135,14 +135,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium zookeeper' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -162,7 +162,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.magento.app.yaml index aeaadbd0..b9e57185 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.magento.app.yaml @@ -1,6 +1,6 @@ name: mymagento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index ec1bd183..54f88c2d 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -62,7 +62,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -135,14 +135,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium zookeeper' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -162,7 +162,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_tls_service/.magento.app.yaml b/src/Test/Integration/_files/cloud_no_tls_service/.magento.app.yaml index 0fae6f4b..0dac5bfe 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_no_tls_service/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index 72b7c93f..6c22ca4f 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -63,7 +63,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,14 +119,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -146,7 +146,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.magento.app.yaml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.magento.app.yaml index 0fae6f4b..0dac5bfe 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index cfb3e7da..945b3ed5 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -63,7 +63,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -109,14 +109,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -136,7 +136,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/.magento.app.yaml b/src/Test/Integration/_files/cloud_no_varnish_service/.magento.app.yaml index 0fae6f4b..0dac5bfe 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/.magento.app.yaml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index 819e0e80..427a05e9 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -63,7 +63,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -126,14 +126,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -153,7 +153,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index bab4b358..f281d22e 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -26,7 +26,7 @@ services: - db.magento2.test fpm: hostname: fpm.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -99,14 +99,14 @@ services: condition: service_started generic: hostname: generic.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -122,7 +122,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index bab4b358..f281d22e 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -26,7 +26,7 @@ services: - db.magento2.test fpm: hostname: fpm.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -99,14 +99,14 @@ services: condition: service_started generic: hostname: generic.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -122,7 +122,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.test - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index 33166249..a4075782 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -25,7 +25,7 @@ services: - db.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -73,13 +73,13 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -95,7 +95,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml index 876f2b95..04141e68 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml @@ -25,7 +25,7 @@ services: - db.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -63,13 +63,13 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -85,7 +85,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml index 152351e0..0b086bc0 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml @@ -25,7 +25,7 @@ services: - db.magento2.docker fpm: hostname: fpm.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-fpm-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,13 +80,13 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium' build: hostname: build.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -102,7 +102,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: 'magento/magento-cloud-docker-php:7.2-cli-1.2.0' + image: 'magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_registry/.magento.app.yaml b/src/Test/Integration/_files/custom_registry/.magento.app.yaml index 0fae6f4b..0dac5bfe 100644 --- a/src/Test/Integration/_files/custom_registry/.magento.app.yaml +++ b/src/Test/Integration/_files/custom_registry/.magento.app.yaml @@ -1,6 +1,6 @@ name: magento -type: php:7.3 +type: php:8.0 build: flavor: composer diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index d7bf7488..6fa9e929 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -65,7 +65,7 @@ services: - elasticsearch.magento2.docker fpm: hostname: fpm.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-php:8.0-fpm-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -138,14 +138,14 @@ services: condition: service_started generic: hostname: generic.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-php:8.0-cli-1.2.0' env_file: ./.docker/config.env environment: - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:rw,delegated' @@ -165,7 +165,7 @@ services: condition: service_healthy deploy: hostname: deploy.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-php:7.3-cli-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-php:8.0-cli-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' From 7c817ec1509b5598a70ee5a7440b35d438cd7969 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Fri, 23 Aug 2024 16:12:49 -0500 Subject: [PATCH 052/113] Use previous style docker cp --- tests/functional/Robo/Tasks/CopyFromDocker.php | 2 +- tests/functional/Robo/Tasks/CopyToDocker.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Robo/Tasks/CopyFromDocker.php b/tests/functional/Robo/Tasks/CopyFromDocker.php index 1a071542..2dd862d4 100644 --- a/tests/functional/Robo/Tasks/CopyFromDocker.php +++ b/tests/functional/Robo/Tasks/CopyFromDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker-compose cp %s:%s %s', + 'docker cp "$(docker-compose ps -q %s)":%s %s', $this->container, $this->source, $this->destination diff --git a/tests/functional/Robo/Tasks/CopyToDocker.php b/tests/functional/Robo/Tasks/CopyToDocker.php index 22cecf6e..a1d6d8b3 100644 --- a/tests/functional/Robo/Tasks/CopyToDocker.php +++ b/tests/functional/Robo/Tasks/CopyToDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker-compose cp %s %s:%s', + 'docker cp "$(docker-compose ps -q %s)":%s %s', $this->source, $this->container, $this->destination From 600986066055eb1083d9be7260bcf4b5f4a99602 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 3 Sep 2024 17:47:48 -0400 Subject: [PATCH 053/113] Remove old images --- images/elasticsearch/6.5/Dockerfile | 21 --- images/elasticsearch/6.5/docker-entrypoint.sh | 12 -- .../elasticsearch/6.5/docker-healthcheck.sh | 12 -- images/elasticsearch/6.8/Dockerfile | 21 --- images/elasticsearch/6.8/docker-entrypoint.sh | 12 -- .../elasticsearch/6.8/docker-healthcheck.sh | 12 -- images/elasticsearch/7.5/Dockerfile | 21 --- images/elasticsearch/7.5/docker-entrypoint.sh | 12 -- .../elasticsearch/7.5/docker-healthcheck.sh | 12 -- images/elasticsearch/7.6/Dockerfile | 21 --- images/elasticsearch/7.6/docker-entrypoint.sh | 12 -- .../elasticsearch/7.6/docker-healthcheck.sh | 12 -- images/elasticsearch/7.7/Dockerfile | 21 --- images/elasticsearch/7.7/docker-entrypoint.sh | 12 -- .../elasticsearch/7.7/docker-healthcheck.sh | 12 -- images/elasticsearch/7.9/Dockerfile | 21 --- images/elasticsearch/7.9/docker-entrypoint.sh | 12 -- .../elasticsearch/7.9/docker-healthcheck.sh | 12 -- images/varnish/4.0/Dockerfile | 22 --- images/varnish/4.0/entrypoint.sh | 6 - images/varnish/4.0/etc/varnish.vcl | 177 ------------------ 21 files changed, 475 deletions(-) delete mode 100644 images/elasticsearch/6.5/Dockerfile delete mode 100755 images/elasticsearch/6.5/docker-entrypoint.sh delete mode 100644 images/elasticsearch/6.5/docker-healthcheck.sh delete mode 100644 images/elasticsearch/6.8/Dockerfile delete mode 100755 images/elasticsearch/6.8/docker-entrypoint.sh delete mode 100644 images/elasticsearch/6.8/docker-healthcheck.sh delete mode 100644 images/elasticsearch/7.5/Dockerfile delete mode 100755 images/elasticsearch/7.5/docker-entrypoint.sh delete mode 100644 images/elasticsearch/7.5/docker-healthcheck.sh delete mode 100644 images/elasticsearch/7.6/Dockerfile delete mode 100755 images/elasticsearch/7.6/docker-entrypoint.sh delete mode 100644 images/elasticsearch/7.6/docker-healthcheck.sh delete mode 100644 images/elasticsearch/7.7/Dockerfile delete mode 100755 images/elasticsearch/7.7/docker-entrypoint.sh delete mode 100644 images/elasticsearch/7.7/docker-healthcheck.sh delete mode 100644 images/elasticsearch/7.9/Dockerfile delete mode 100755 images/elasticsearch/7.9/docker-entrypoint.sh delete mode 100644 images/elasticsearch/7.9/docker-healthcheck.sh delete mode 100755 images/varnish/4.0/Dockerfile delete mode 100644 images/varnish/4.0/entrypoint.sh delete mode 100644 images/varnish/4.0/etc/varnish.vcl diff --git a/images/elasticsearch/6.5/Dockerfile b/images/elasticsearch/6.5/Dockerfile deleted file mode 100644 index 26b9f815..00000000 --- a/images/elasticsearch/6.5/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:6.5.4 - -RUN yum -y install zip && \ - zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache - -RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml - -RUN bin/elasticsearch-plugin install -b analysis-icu && \ - bin/elasticsearch-plugin install -b analysis-phonetic - -ADD docker-healthcheck.sh /docker-healthcheck.sh -ADD docker-entrypoint.sh /docker-entrypoint.sh - -HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9200 9300 diff --git a/images/elasticsearch/6.5/docker-entrypoint.sh b/images/elasticsearch/6.5/docker-entrypoint.sh deleted file mode 100755 index e2c63c4c..00000000 --- a/images/elasticsearch/6.5/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if [[ -n "$ES_PLUGINS" ]]; then - echo "Installing plugins: $ES_PLUGNS" - for PLUGIN in $ES_PLUGINS - do - ./bin/elasticsearch-plugin install -b "$PLUGIN" - done -fi - -/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/6.5/docker-healthcheck.sh b/images/elasticsearch/6.5/docker-healthcheck.sh deleted file mode 100644 index a6d853cf..00000000 --- a/images/elasticsearch/6.5/docker-healthcheck.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then - exit 0 - fi - echo >&2 "Unexpected health status: $health" -fi - -exit 1 diff --git a/images/elasticsearch/6.8/Dockerfile b/images/elasticsearch/6.8/Dockerfile deleted file mode 100644 index 64f973a6..00000000 --- a/images/elasticsearch/6.8/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:6.8.15 - -RUN yum -y install zip && \ - zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache - -RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN bin/elasticsearch-plugin install -b analysis-icu && \ - bin/elasticsearch-plugin install -b analysis-phonetic - -ADD docker-healthcheck.sh /docker-healthcheck.sh -ADD docker-entrypoint.sh /docker-entrypoint.sh - -HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9200 9300 diff --git a/images/elasticsearch/6.8/docker-entrypoint.sh b/images/elasticsearch/6.8/docker-entrypoint.sh deleted file mode 100755 index e2c63c4c..00000000 --- a/images/elasticsearch/6.8/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if [[ -n "$ES_PLUGINS" ]]; then - echo "Installing plugins: $ES_PLUGNS" - for PLUGIN in $ES_PLUGINS - do - ./bin/elasticsearch-plugin install -b "$PLUGIN" - done -fi - -/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/6.8/docker-healthcheck.sh b/images/elasticsearch/6.8/docker-healthcheck.sh deleted file mode 100644 index a6d853cf..00000000 --- a/images/elasticsearch/6.8/docker-healthcheck.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then - exit 0 - fi - echo >&2 "Unexpected health status: $health" -fi - -exit 1 diff --git a/images/elasticsearch/7.5/Dockerfile b/images/elasticsearch/7.5/Dockerfile deleted file mode 100644 index a4d9a188..00000000 --- a/images/elasticsearch/7.5/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.5.2 - -RUN yum -y install zip && \ - zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache - -RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN bin/elasticsearch-plugin install -b analysis-icu && \ - bin/elasticsearch-plugin install -b analysis-phonetic - -ADD docker-healthcheck.sh /docker-healthcheck.sh -ADD docker-entrypoint.sh /docker-entrypoint.sh - -HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.5/docker-entrypoint.sh b/images/elasticsearch/7.5/docker-entrypoint.sh deleted file mode 100755 index e2c63c4c..00000000 --- a/images/elasticsearch/7.5/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if [[ -n "$ES_PLUGINS" ]]; then - echo "Installing plugins: $ES_PLUGNS" - for PLUGIN in $ES_PLUGINS - do - ./bin/elasticsearch-plugin install -b "$PLUGIN" - done -fi - -/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.5/docker-healthcheck.sh b/images/elasticsearch/7.5/docker-healthcheck.sh deleted file mode 100644 index a6d853cf..00000000 --- a/images/elasticsearch/7.5/docker-healthcheck.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then - exit 0 - fi - echo >&2 "Unexpected health status: $health" -fi - -exit 1 diff --git a/images/elasticsearch/7.6/Dockerfile b/images/elasticsearch/7.6/Dockerfile deleted file mode 100644 index 1f009db6..00000000 --- a/images/elasticsearch/7.6/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.6.2 - -RUN yum -y install zip && \ - zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache - -RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN bin/elasticsearch-plugin install -b analysis-icu && \ - bin/elasticsearch-plugin install -b analysis-phonetic - -ADD docker-healthcheck.sh /docker-healthcheck.sh -ADD docker-entrypoint.sh /docker-entrypoint.sh - -HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.6/docker-entrypoint.sh b/images/elasticsearch/7.6/docker-entrypoint.sh deleted file mode 100755 index e2c63c4c..00000000 --- a/images/elasticsearch/7.6/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if [[ -n "$ES_PLUGINS" ]]; then - echo "Installing plugins: $ES_PLUGNS" - for PLUGIN in $ES_PLUGINS - do - ./bin/elasticsearch-plugin install -b "$PLUGIN" - done -fi - -/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.6/docker-healthcheck.sh b/images/elasticsearch/7.6/docker-healthcheck.sh deleted file mode 100644 index a6d853cf..00000000 --- a/images/elasticsearch/7.6/docker-healthcheck.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then - exit 0 - fi - echo >&2 "Unexpected health status: $health" -fi - -exit 1 diff --git a/images/elasticsearch/7.7/Dockerfile b/images/elasticsearch/7.7/Dockerfile deleted file mode 100644 index 4a848b83..00000000 --- a/images/elasticsearch/7.7/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.7.1 - -RUN yum -y install zip && \ - zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache - -RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN bin/elasticsearch-plugin install -b analysis-icu && \ - bin/elasticsearch-plugin install -b analysis-phonetic - -ADD docker-healthcheck.sh /docker-healthcheck.sh -ADD docker-entrypoint.sh /docker-entrypoint.sh - -HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.7/docker-entrypoint.sh b/images/elasticsearch/7.7/docker-entrypoint.sh deleted file mode 100755 index e2c63c4c..00000000 --- a/images/elasticsearch/7.7/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if [[ -n "$ES_PLUGINS" ]]; then - echo "Installing plugins: $ES_PLUGNS" - for PLUGIN in $ES_PLUGINS - do - ./bin/elasticsearch-plugin install -b "$PLUGIN" - done -fi - -/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.7/docker-healthcheck.sh b/images/elasticsearch/7.7/docker-healthcheck.sh deleted file mode 100644 index a6d853cf..00000000 --- a/images/elasticsearch/7.7/docker-healthcheck.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then - exit 0 - fi - echo >&2 "Unexpected health status: $health" -fi - -exit 1 diff --git a/images/elasticsearch/7.9/Dockerfile b/images/elasticsearch/7.9/Dockerfile deleted file mode 100644 index ffbc60b0..00000000 --- a/images/elasticsearch/7.9/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.9.3 - -RUN yum -y install zip && \ - zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache - -RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml -RUN bin/elasticsearch-plugin install -b analysis-icu && \ - bin/elasticsearch-plugin install -b analysis-phonetic - -ADD docker-healthcheck.sh /docker-healthcheck.sh -ADD docker-entrypoint.sh /docker-entrypoint.sh - -HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.9/docker-entrypoint.sh b/images/elasticsearch/7.9/docker-entrypoint.sh deleted file mode 100755 index e2c63c4c..00000000 --- a/images/elasticsearch/7.9/docker-entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if [[ -n "$ES_PLUGINS" ]]; then - echo "Installing plugins: $ES_PLUGNS" - for PLUGIN in $ES_PLUGINS - do - ./bin/elasticsearch-plugin install -b "$PLUGIN" - done -fi - -/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.9/docker-healthcheck.sh b/images/elasticsearch/7.9/docker-healthcheck.sh deleted file mode 100644 index a6d853cf..00000000 --- a/images/elasticsearch/7.9/docker-healthcheck.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eo pipefail - -if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then - exit 0 - fi - echo >&2 "Unexpected health status: $health" -fi - -exit 1 diff --git a/images/varnish/4.0/Dockerfile b/images/varnish/4.0/Dockerfile deleted file mode 100755 index e6a86a23..00000000 --- a/images/varnish/4.0/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM centos:centos7 - -RUN yum update -y && \ - yum install -y epel-release && \ - yum install -y varnish && \ - yum install -y libmhash-devel && \ - yum clean all - -EXPOSE 80 - -ADD entrypoint.sh /entrypoint.sh - -ENV VCL_CONFIG /data/varnish.vcl -ENV CACHE_SIZE 64m -ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 -p feature=+esi_ignore_https -p feature=+esi_disable_xml_check - -COPY etc/varnish.vcl /data/varnish.vcl - -RUN ["chmod", "644", "/data/varnish.vcl"] -RUN ["chmod", "+x", "/entrypoint.sh"] - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/images/varnish/4.0/entrypoint.sh b/images/varnish/4.0/entrypoint.sh deleted file mode 100644 index 5ebfaf16..00000000 --- a/images/varnish/4.0/entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -e - -exec bash -c \ - "exec varnishd -F -u varnish -f $VCL_CONFIG -s malloc,$CACHE_SIZE $VARNISHD_PARAMS" diff --git a/images/varnish/4.0/etc/varnish.vcl b/images/varnish/4.0/etc/varnish.vcl deleted file mode 100644 index d9a17a55..00000000 --- a/images/varnish/4.0/etc/varnish.vcl +++ /dev/null @@ -1,177 +0,0 @@ -vcl 4.0; - -import std; - -# The minimal Varnish version is 4.0 -# For SSL offloading, pass the following header in your proxy server or load balancer: 'SSL-OFFLOADED: https' - -backend default { - .host = "web"; - .port = "8080"; - .first_byte_timeout = 300s; - .between_bytes_timeout = 300s; -} - -sub vcl_recv { - # Ensure the true IP is sent onwards. - # This was an issue getting xdebug working through varnish - # whilst having a proxy infront of varnish (for local docker dev) - if (req.http.X-Real-Ip) { - set req.http.X-Forwarded-For = req.http.X-Real-Ip; - } - - if (req.method == "PURGE") { - if (!req.http.X-Magento-Tags-Pattern) { - return (synth(400, "X-Magento-Tags-Pattern header required")); - } - ban("obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern); - return (synth(200, "Purged")); - } - - # Bypass debug session - if (req.http.Cookie ~ "(^|;\s*)(XDEBUG_SESSION=.*)(;|$)") { - return (pass); - } - - if (req.method != "GET" && - req.method != "HEAD" && - req.method != "PUT" && - req.method != "POST" && - req.method != "TRACE" && - req.method != "OPTIONS" && - req.method != "DELETE") { - /* Non-RFC2616 or CONNECT which is weird. */ - return (pipe); - } - - # We only deal with GET and HEAD by default - if (req.method != "GET" && req.method != "HEAD") { - return (pass); - } - - # Bypass shopping cart, checkout and search requests - if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { - return (pass); - } - - # normalize url in case of leading HTTP scheme and domain - set req.url = regsub(req.url, "^http[s]?://", ""); - - # collect all cookies - std.collect(req.http.Cookie); - - # Compression filter. See https://www.varnish-cache.org/trac/wiki/FAQ/Compression - if (req.http.Accept-Encoding) { - if (req.url ~ "\.(jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf|flv)$") { - # No point in compressing these - unset req.http.Accept-Encoding; - } elsif (req.http.Accept-Encoding ~ "gzip") { - set req.http.Accept-Encoding = "gzip"; - } elsif (req.http.Accept-Encoding ~ "deflate" && req.http.user-agent !~ "MSIE") { - set req.http.Accept-Encoding = "deflate"; - } else { - # unkown algorithm - unset req.http.Accept-Encoding; - } - } - - # Remove Google gclid parameters to minimize the cache objects - set req.url = regsuball(req.url,"\?gclid=[^&]+$",""); # strips when QS = "?gclid=AAA" - set req.url = regsuball(req.url,"\?gclid=[^&]+&","?"); # strips when QS = "?gclid=AAA&foo=bar" - set req.url = regsuball(req.url,"&gclid=[^&]+",""); # strips when QS = "?foo=bar&gclid=AAA" or QS = "?foo=bar&gclid=AAA&bar=baz" - - # static files are always cacheable. remove SSL flag and cookie - if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") { - unset req.http.Https; - unset req.http.SSL-OFFLOADED; - unset req.http.Cookie; - } - - return (hash); -} - -sub vcl_hash { - if (req.http.cookie ~ "X-Magento-Vary=") { - hash_data(regsub(req.http.cookie, "^.*?X-Magento-Vary=([^;]+);*.*$", "\1")); - } - - # For multi site configurations to not cache each other's content - if (req.http.host) { - hash_data(req.http.host); - } else { - hash_data(server.ip); - } - - # To make sure http users don't see ssl warning - if (req.http.SSL-OFFLOADED) { - hash_data(req.http.SSL-OFFLOADED); - } - - # Cache https seperately - if (req.http.X-Forwarded-Proto) { - hash_data(req.http.X-Forwarded-Proto); - } -} - -sub vcl_backend_response { - if (beresp.http.content-type ~ "text") { - set beresp.do_esi = true; - } - - if (bereq.url ~ "\.js$" || beresp.http.content-type ~ "text") { - set beresp.do_gzip = true; - } - - # cache only successfully responses and 404s - if (beresp.status != 200 && beresp.status != 404) { - set beresp.ttl = 0s; - set beresp.uncacheable = true; - return (deliver); - } elsif (beresp.http.Cache-Control ~ "private") { - set beresp.uncacheable = true; - set beresp.ttl = 86400s; - return (deliver); - } - - if (beresp.http.X-Magento-Debug) { - set beresp.http.X-Magento-Cache-Control = beresp.http.Cache-Control; - } - - # validate if we need to cache it and prevent from setting cookie - # images, css and js are cacheable by default so we have to remove cookie also - if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) { - unset beresp.http.set-cookie; - if (bereq.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") { - set beresp.http.Pragma = "no-cache"; - set beresp.http.Expires = "-1"; - set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0"; - set beresp.grace = 1m; - } - } - - # If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass - if (beresp.ttl <= 0s || - beresp.http.Surrogate-control ~ "no-store" || - (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { - # Mark as Hit-For-Pass for the next 2 minutes - set beresp.ttl = 120s; - set beresp.uncacheable = true; - } - return (deliver); -} - -sub vcl_deliver { - if (resp.http.x-varnish ~ " ") { - set resp.http.X-Magento-Cache-Debug = "HIT"; - } else { - set resp.http.X-Magento-Cache-Debug = "MISS"; - } - - unset resp.http.X-Magento-Debug; - unset resp.http.X-Magento-Tags; - unset resp.http.X-Powered-By; - unset resp.http.Server; - unset resp.http.X-Varnish; - unset resp.http.Via; - unset resp.http.Link; -} From 22d2a48d2116015046fb7392a366775b2d738282 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 4 Sep 2024 16:16:22 -0400 Subject: [PATCH 054/113] Bump codeception version --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 5093f6c7..68d4dbb1 100644 --- a/composer.json +++ b/composer.json @@ -19,12 +19,12 @@ "symfony/yaml": "^4.4 || ^5.1 || ^5.4|| ^6.4" }, "require-dev": { - "codeception/codeception": "^4.1", - "codeception/module-asserts": "^1.2", - "codeception/module-db": "^1.0", - "codeception/module-phpbrowser": "^1.0", - "codeception/module-rest": "^1.2", - "consolidation/robo": "^2.0", + "codeception/codeception": "^4.1 || ^5.1", + "codeception/module-asserts": "^1.2 || ^3.0", + "codeception/module-db": "^1.0 || ^3.0", + "codeception/module-phpbrowser": "^1.0 || ^3.0", + "codeception/module-rest": "^1.2 || ^3.0", + "consolidation/robo": "^2.0 || ^3.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^9.5", From 547270379daecc067a9aa92eb82335697d56e1b8 Mon Sep 17 00:00:00 2001 From: Ankit Koranne Date: Fri, 4 Oct 2024 12:48:08 +0530 Subject: [PATCH 055/113] MCLOUD-12901: Prepare release branch for cloud tools. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 68d4dbb1..ee83ae0e 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.7", + "version": "1.4.0", "license": [ "OSL-3.0", "AFL-3.0" From 4e0870930d1a35d17fb0efbb4b46c5b4dc8e4db0 Mon Sep 17 00:00:00 2001 From: glo42671 Date: Wed, 13 Nov 2024 14:59:05 +0530 Subject: [PATCH 056/113] MCLOUD-13087:Stabilize functional tests for cloud-docker for php 8.3 --- .../Functional/Acceptance/AbstractCest.php | 25 ++++++++++++++++--- .../Functional/Acceptance/AcceptanceCest.php | 2 +- .../Functional/Acceptance/DeveloperCest.php | 2 +- .../Acceptance/ElasticsearchCest.php | 2 +- .../Functional/Acceptance/MailHogCest.php | 2 +- .../Functional/Acceptance/OpensearchCest.php | 2 +- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index 14f5e603..612c1b33 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -12,6 +12,16 @@ */ abstract class AbstractCest { + /** + * @var boolean + */ + protected $removeEs = true; + + /** + * @var boolean + */ + protected $runComposerUpdate = true; + /** * Template version for testing */ @@ -42,24 +52,31 @@ public function _before(\CliTester $I): void 'magento/ece-tools', $I->getDependencyVersion('magento/ece-tools') ?: 'dev-develop as 2002.1.99' ); - + if ($mccVersion = $I->getDependencyVersion('magento/magento-cloud-components')) { $I->addCloudComponentsGitRepoToComposer(); + echo "=======mccVersion==========".$mccVersion; $I->addDependencyToComposer('magento/magento-cloud-components', $mccVersion); } if ($mcpVersion = $I->getDependencyVersion('magento/magento-cloud-patches')) { $I->addCloudPatchesGitRepoToComposer(); + echo "=======mcpVersion==========".$mcpVersion; $I->addDependencyToComposer('magento/magento-cloud-patches', $mcpVersion); } if ($mqpVersion = $I->getDependencyVersion('magento/quality-patches')) { $I->addQualityPatchesGitRepoToComposer(); + echo "=======mqpVersion==========".$mqpVersion; $I->addDependencyToComposer('magento/quality-patches', $mqpVersion); } - - $I->assertTrue($I->composerUpdate(), 'Composer update failed'); - $I->cacheWorkDir(static::TEMPLATE_VERSION); + + if ($this->runComposerUpdate) { + $I->assertTrue($I->composerUpdate(), 'Composer update failed'); + $I->cacheWorkDir(static::TEMPLATE_VERSION); + } + + $this->removeESIfExists($I, static::TEMPLATE_VERSION); } /** diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index bda150fb..fa2439a6 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -17,7 +17,7 @@ class AcceptanceCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.7-beta-test'; + protected const TEMPLATE_VERSION = '2.4.7'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 459126ab..a9eca9e9 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -17,7 +17,7 @@ class DeveloperCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.7-beta-test'; + protected const TEMPLATE_VERSION = '2.4.7'; /** * Tests that php settings contains configuration from php.dev.ini diff --git a/src/Test/Functional/Acceptance/ElasticsearchCest.php b/src/Test/Functional/Acceptance/ElasticsearchCest.php index 5bc6c438..5c3bb296 100644 --- a/src/Test/Functional/Acceptance/ElasticsearchCest.php +++ b/src/Test/Functional/Acceptance/ElasticsearchCest.php @@ -19,7 +19,7 @@ class ElasticsearchCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.7-beta-test'; + protected const TEMPLATE_VERSION = '2.4.7'; /** * @param CliTester $I diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 8530a083..d7c71c66 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -15,7 +15,7 @@ class MailHogCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.7-beta-test'; + protected const TEMPLATE_VERSION = '2.4.7'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/OpensearchCest.php b/src/Test/Functional/Acceptance/OpensearchCest.php index f4aa3b91..43d32027 100644 --- a/src/Test/Functional/Acceptance/OpensearchCest.php +++ b/src/Test/Functional/Acceptance/OpensearchCest.php @@ -19,7 +19,7 @@ class OpensearchCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.7-beta-test'; + protected const TEMPLATE_VERSION = '2.4.7'; /** * @param CliTester $I From 4c44d031321ab7f8b22e6fbd5a943ad6e1eec5ef Mon Sep 17 00:00:00 2001 From: glo42671 Date: Wed, 13 Nov 2024 15:03:40 +0530 Subject: [PATCH 057/113] MCLOUD-13087:Stabilize functional tests for cloud-docker for php 8.3 --- .../Functional/Acceptance/AbstractCest.php | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index 612c1b33..14f5e603 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -12,16 +12,6 @@ */ abstract class AbstractCest { - /** - * @var boolean - */ - protected $removeEs = true; - - /** - * @var boolean - */ - protected $runComposerUpdate = true; - /** * Template version for testing */ @@ -52,31 +42,24 @@ public function _before(\CliTester $I): void 'magento/ece-tools', $I->getDependencyVersion('magento/ece-tools') ?: 'dev-develop as 2002.1.99' ); - + if ($mccVersion = $I->getDependencyVersion('magento/magento-cloud-components')) { $I->addCloudComponentsGitRepoToComposer(); - echo "=======mccVersion==========".$mccVersion; $I->addDependencyToComposer('magento/magento-cloud-components', $mccVersion); } if ($mcpVersion = $I->getDependencyVersion('magento/magento-cloud-patches')) { $I->addCloudPatchesGitRepoToComposer(); - echo "=======mcpVersion==========".$mcpVersion; $I->addDependencyToComposer('magento/magento-cloud-patches', $mcpVersion); } if ($mqpVersion = $I->getDependencyVersion('magento/quality-patches')) { $I->addQualityPatchesGitRepoToComposer(); - echo "=======mqpVersion==========".$mqpVersion; $I->addDependencyToComposer('magento/quality-patches', $mqpVersion); } - - if ($this->runComposerUpdate) { - $I->assertTrue($I->composerUpdate(), 'Composer update failed'); - $I->cacheWorkDir(static::TEMPLATE_VERSION); - } - - $this->removeESIfExists($I, static::TEMPLATE_VERSION); + + $I->assertTrue($I->composerUpdate(), 'Composer update failed'); + $I->cacheWorkDir(static::TEMPLATE_VERSION); } /** From a111c8954b9223ad77951e962ec3b9f27f1a9a17 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 19 Dec 2024 16:49:24 -0600 Subject: [PATCH 058/113] upgrade illuminate/config --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ee83ae0e..7a227db1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "ext-json": "*", "composer/composer": "^1.9 || ^2.0", "composer/semver": "@stable", - "illuminate/config": "^5.5||^8.77", + "illuminate/config": "^10.0 || ^11.0", "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4", "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4", From 10512ba1a7995c30b6682c3ce43f5513bb928906 Mon Sep 17 00:00:00 2001 From: glo42671 Date: Mon, 6 Jan 2025 09:37:59 +0530 Subject: [PATCH 059/113] PHP 8.2.15 removed FTP extension --- images/php/8.2-cli/Dockerfile | 7 ++++--- images/php/8.2-fpm/Dockerfile | 7 ++++--- images/php/8.3-cli/Dockerfile | 7 ++++--- images/php/8.3-fpm/Dockerfile | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index 1427b2fd..54e8f1a6 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -29,7 +29,7 @@ ENV MAGENTO_RUN_MODE production ENV SENDMAIL_PATH /dev/null ENV PHPRC ${MAGENTO_ROOT}/php.ini -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl ftp # Configure Node.js version RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash @@ -114,7 +114,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ @@ -190,4 +191,4 @@ WORKDIR ${MAGENTO_ROOT} USER root -CMD ["bash"] +CMD ["bash"] \ No newline at end of file diff --git a/images/php/8.2-fpm/Dockerfile b/images/php/8.2-fpm/Dockerfile index de75c9a5..9a3a83da 100644 --- a/images/php/8.2-fpm/Dockerfile +++ b/images/php/8.2-fpm/Dockerfile @@ -22,7 +22,7 @@ ENV UPLOAD_MAX_FILESIZE 64M ENV SENDMAIL_PATH /dev/null ENV PHPRC ${MAGENTO_ROOT}/php.ini -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl ftp # Install dependencies RUN apt-get update \ @@ -89,7 +89,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ @@ -148,4 +149,4 @@ WORKDIR ${MAGENTO_ROOT} USER root -CMD ["php-fpm", "-R"] +CMD ["php-fpm", "-R"] \ No newline at end of file diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 21b4957e..d4154a5f 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -29,7 +29,7 @@ ENV MAGENTO_RUN_MODE production ENV SENDMAIL_PATH /dev/null ENV PHPRC ${MAGENTO_ROOT}/php.ini -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl ftp # Configure Node.js version RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash @@ -114,7 +114,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ @@ -190,4 +191,4 @@ WORKDIR ${MAGENTO_ROOT} USER root -CMD ["bash"] +CMD ["bash"] \ No newline at end of file diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile index 039114c4..d1342ab1 100644 --- a/images/php/8.3-fpm/Dockerfile +++ b/images/php/8.3-fpm/Dockerfile @@ -22,7 +22,7 @@ ENV UPLOAD_MAX_FILESIZE 64M ENV SENDMAIL_PATH /dev/null ENV PHPRC ${MAGENTO_ROOT}/php.ini -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl ftp # Install dependencies RUN apt-get update \ @@ -89,7 +89,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ @@ -148,4 +149,4 @@ WORKDIR ${MAGENTO_ROOT} USER root -CMD ["php-fpm", "-R"] +CMD ["php-fpm", "-R"] \ No newline at end of file From d9b8d6d3eb3a189b9415d8c4b177ea6a7c7fde9f Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Fri, 10 Jan 2025 20:31:44 +0530 Subject: [PATCH 060/113] MCLOUD-13147: Added support for PHP8.4 --- src/App/GenericException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/GenericException.php b/src/App/GenericException.php index ca01ea28..76a60efb 100644 --- a/src/App/GenericException.php +++ b/src/App/GenericException.php @@ -17,7 +17,7 @@ class GenericException extends \Exception /** * @inheritDoc */ - public function __construct(string $message, int $code = 0, Throwable $previous = null) + public function __construct(string $message, int $code = 0, ?Throwable $previous = null) { parent::__construct($message, $code, $previous); } From 798b99c93d25308868aa81c8de3ee43f8cb79102 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Sat, 11 Jan 2025 01:32:06 +0530 Subject: [PATCH 061/113] MCLOUD-13147: Added PHP8.4 fixation with PHPUnit, PHPStan & PHPMD compatibility --- composer.json | 13 ++-- src/Application.php | 2 +- src/Command/BuildCompose.php | 4 +- src/Command/BuildCustomCompose.php | 2 +- src/Command/Image/GeneratePhp.php | 6 +- src/Compose/DeveloperBuilder.php | 2 +- src/Compose/Php/ExtensionResolver.php | 2 +- src/Compose/ProductionBuilder.php | 6 +- src/Config/Source/CliSource.php | 6 +- src/Service/ServiceFactory.php | 8 +-- src/Test/Unit/Config/Dist/GeneratorTest.php | 31 +++++--- src/Test/Unit/Config/RelationshipTest.php | 80 +++++++++++++++------ tests/functional/_support/CliTester.php | 2 + tests/functional/_support/FailedInfo.php | 2 +- tests/unit/phpunit.xml.dist | 2 +- 15 files changed, 111 insertions(+), 57 deletions(-) diff --git a/composer.json b/composer.json index 7a227db1..4955dfba 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,10 @@ "codeception/module-rest": "^1.2 || ^3.0", "consolidation/robo": "^2.0 || ^3.0", "phpmd/phpmd": "@stable", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.6" + "phpstan/phpstan": "^1.8 || ^2.0", + "phpunit/php-code-coverage": "^10.1", + "phpunit/phpunit": "^9.5 || ^10.5", + "squizlabs/php_codesniffer": "^3.7" }, "bin": [ "bin/ece-docker" @@ -37,7 +38,8 @@ "psr-4": { "Magento\\CloudDocker\\": "src/", "Magento\\CloudDocker\\Test\\Integration\\": "tests/integration", - "Magento\\CloudDocker\\Test\\Functional\\": "tests/functional/" + "Magento\\CloudDocker\\Test\\Functional\\": "tests/functional/", + "Magento\\CloudDocker\\Test\\Functional\\Support\\": "tests/functional/_support/" } }, "scripts": { @@ -55,7 +57,8 @@ "test:integration": "phpunit --configuration tests/integration" }, "config": { - "sort-packages": true + "sort-packages": true, + "optimize-autoloader": true }, "prefer-stable": true, "extra": { diff --git a/src/Application.php b/src/Application.php index a6403b9e..b84d81c5 100644 --- a/src/Application.php +++ b/src/Application.php @@ -13,7 +13,7 @@ /** * @inheritdoc * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class Application extends \Symfony\Component\Console\Application { diff --git a/src/Command/BuildCompose.php b/src/Command/BuildCompose.php index bbb6f2e9..0059dcda 100644 --- a/src/Command/BuildCompose.php +++ b/src/Command/BuildCompose.php @@ -25,7 +25,7 @@ /** * Builds Docker configuration for Magento project. * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class BuildCompose extends Command { @@ -82,7 +82,7 @@ public function __construct( /** * {@inheritdoc} * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ protected function configure(): void { diff --git a/src/Command/BuildCustomCompose.php b/src/Command/BuildCustomCompose.php index b292eba3..f00ce92c 100644 --- a/src/Command/BuildCustomCompose.php +++ b/src/Command/BuildCustomCompose.php @@ -27,7 +27,7 @@ /** * Build configuration from custom-provided source. * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class BuildCustomCompose extends Command { diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index db55ba51..75523b66 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -218,9 +218,9 @@ private function build(string $version, string $edition): void * @throws ConfigurationMismatchException * @throws FileNotFoundException * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings("PHPMD.CyclomaticComplexity") + * @SuppressWarnings("PHPMD.NPathComplexity") + * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ private function buildDockerfile(string $dockerfile, string $phpVersion, string $edition): string { diff --git a/src/Compose/DeveloperBuilder.php b/src/Compose/DeveloperBuilder.php index 8e2f9874..9ea4d3ce 100644 --- a/src/Compose/DeveloperBuilder.php +++ b/src/Compose/DeveloperBuilder.php @@ -84,7 +84,7 @@ public function __construct( /** * {@inheritDoc} * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings("PHPMD.CyclomaticComplexity") */ public function build(Config $config): Manager { diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index f7f172d6..a5971adf 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -158,7 +158,7 @@ public function get(Config $config): array /** * @return array * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ public static function getConfig(): array { diff --git a/src/Compose/ProductionBuilder.php b/src/Compose/ProductionBuilder.php index 7e73daf7..007cdb4e 100644 --- a/src/Compose/ProductionBuilder.php +++ b/src/Compose/ProductionBuilder.php @@ -83,9 +83,9 @@ public function __construct( /** * {@inheritdoc} * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings("PHPMD.ExcessiveMethodLength") + * @SuppressWarnings("PHPMD.CyclomaticComplexity") + * @SuppressWarnings("PHPMD.NPathComplexity") */ public function build(Config $config): Manager { diff --git a/src/Config/Source/CliSource.php b/src/Config/Source/CliSource.php index e57db64c..9cd66345 100644 --- a/src/Config/Source/CliSource.php +++ b/src/Config/Source/CliSource.php @@ -166,9 +166,9 @@ public function __construct(InputInterface $input) /** * {@inheritDoc} * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings("PHPMD.NPathComplexity") + * @SuppressWarnings("PHPMD.CyclomaticComplexity") + * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ public function read(): Repository { diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index c52206a5..d45d94b8 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -191,7 +191,7 @@ public function __construct(FileList $fileList) * @param string $name * @param string $version * @param array $config - * @param string $image + * @param string|null $image * @param string|null $customRegistry * @param string|null $imagePattern * @return array @@ -201,9 +201,9 @@ public function create( string $name, string $version, array $config = [], - string $image = null, - string $customRegistry = null, - string $imagePattern = null + ?string $image = null, + ?string $customRegistry = null, + ?string $imagePattern = null ): array { if (!array_key_exists($name, self::$config)) { throw new ConfigurationMismatchException(sprintf( diff --git a/src/Test/Unit/Config/Dist/GeneratorTest.php b/src/Test/Unit/Config/Dist/GeneratorTest.php index 32b5df70..fa3f4d53 100644 --- a/src/Test/Unit/Config/Dist/GeneratorTest.php +++ b/src/Test/Unit/Config/Dist/GeneratorTest.php @@ -190,25 +190,36 @@ public function testGenerate(): void 'exported_application_value', ] ]); + $this->filesystemMock->expects($this->exactly(2)) ->method('put') - ->withConsecutive( - [$rootDir . '/config.php.dist', $this->getConfigForUpdate()], - [ - $rootDir . '/config.env', - 'MAGENTO_CLOUD_RELATIONSHIPS=base64_relationship_value' . PHP_EOL - . 'MAGENTO_CLOUD_ROUTES=base64_routes_value' . PHP_EOL - . 'MAGENTO_CLOUD_VARIABLES=base64_variables_value' . PHP_EOL - . 'MAGENTO_CLOUD_APPLICATION=base64_application_value' . PHP_EOL + ->willReturnCallback(function ($file, $content) use ($rootDir) { + static $expectedCalls = [ + [ + $rootDir . '/config.php.dist', + $this->getConfigForUpdate(), + ], + [ + $rootDir . '/config.env', + 'MAGENTO_CLOUD_RELATIONSHIPS=base64_relationship_value' . PHP_EOL + . 'MAGENTO_CLOUD_ROUTES=base64_routes_value' . PHP_EOL + . 'MAGENTO_CLOUD_VARIABLES=base64_variables_value' . PHP_EOL + . 'MAGENTO_CLOUD_APPLICATION=base64_application_value' . PHP_EOL, + ], + ]; - ] - ); + $expectedCall = array_shift($expectedCalls); + + $this->assertSame($expectedCall[0], $file); + $this->assertSame($expectedCall[1], $content); + }); $this->distGenerator->generate($config); } /** * @return string + * @SuppressWarnings("PHPMD.UnusedPrivateMethod") */ private function getConfigForUpdate(): string { diff --git a/src/Test/Unit/Config/RelationshipTest.php b/src/Test/Unit/Config/RelationshipTest.php index 9c359d98..a32cec03 100644 --- a/src/Test/Unit/Config/RelationshipTest.php +++ b/src/Test/Unit/Config/RelationshipTest.php @@ -104,35 +104,73 @@ public function testGet() $this->configMock->expects($this->exactly(8)) ->method('hasServiceEnabled') - ->withConsecutive( - [ServiceInterface::SERVICE_DB], - [ServiceInterface::SERVICE_DB_QUOTE], - [ServiceInterface::SERVICE_DB_SALES], - ['redis'], - ['elasticsearch'], - ['opensearch'], - ['rabbitmq'], - ['zookeeper'] - ) - ->willReturnOnConsecutiveCalls(true, false, false, true, true, true, true, true); + ->willReturnCallback(function ($service) { + static $services = [ + ServiceInterface::SERVICE_DB, + ServiceInterface::SERVICE_DB_QUOTE, + ServiceInterface::SERVICE_DB_SALES, + 'redis', + 'elasticsearch', + 'opensearch', + 'rabbitmq', + 'zookeeper' + ]; + + static $responses = [ + true, + false, + false, + true, + true, + true, + true, + true + ]; + + $expectedService = array_shift($services); + $expectedResponse = array_shift($responses); + + $this->assertSame($expectedService, $service); + + return $expectedResponse; + }); + $this->configMock->expects($this->exactly(6)) ->method('getServiceVersion') - ->withConsecutive( - [ServiceInterface::SERVICE_DB], - ['redis'], - ['elasticsearch'], - ['opensearch'], - ['rabbitmq'], - ['zookeeper'] - ) - ->willReturnOnConsecutiveCalls( + ->willReturnCallback(function ($service) use ( $mysqlVersion, $redisVersion, $esVersion, $osVersion, $rmqVersion, $zookeeperVersion - ); + ) { + static $services = [ + ServiceInterface::SERVICE_DB, + 'redis', + 'elasticsearch', + 'opensearch', + 'rabbitmq', + 'zookeeper' + ]; + + static $versions = [ + $mysqlVersion, + $redisVersion, + $esVersion, + $osVersion, + $rmqVersion, + $zookeeperVersion + ]; + + $expectedService = array_shift($services); + $expectedVersion = array_shift($versions); + + // Assert that the service passed is the expected one + $this->assertSame($expectedService, $service); + + return $expectedVersion; + }); $this->assertEquals($configWithType, $this->relationship->get($this->configMock)); } diff --git a/tests/functional/_support/CliTester.php b/tests/functional/_support/CliTester.php index 40dc407d..255f1912 100644 --- a/tests/functional/_support/CliTester.php +++ b/tests/functional/_support/CliTester.php @@ -5,6 +5,8 @@ */ declare(strict_types=1); +namespace Magento\CloudDocker\Test\Functional\Support; + /** * @inheritdoc */ diff --git a/tests/functional/_support/FailedInfo.php b/tests/functional/_support/FailedInfo.php index 243c414c..d8d68e6b 100644 --- a/tests/functional/_support/FailedInfo.php +++ b/tests/functional/_support/FailedInfo.php @@ -5,7 +5,7 @@ */ declare(strict_types=1); -namespace Codeception\Extension; +namespace Magento\CloudDocker\Test\Functional\Support; use Codeception\Events; use Codeception\Extension; diff --git a/tests/unit/phpunit.xml.dist b/tests/unit/phpunit.xml.dist index de58085e..ba8cb437 100644 --- a/tests/unit/phpunit.xml.dist +++ b/tests/unit/phpunit.xml.dist @@ -4,7 +4,7 @@ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd" colors="true" columns="max" - bootstrap="../../autoload.php" + bootstrap="../../bootstrap.php" beStrictAboutTestsThatDoNotTestAnything="false" > From f052c9c1b0a1a4b1a18a94eabb3b47b38ef87f9f Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Wed, 15 Jan 2025 20:54:22 +0530 Subject: [PATCH 062/113] MCLOUD-13147: Cosmetic updates --- composer.json | 1 - tests/unit/phpunit.xml.dist | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4955dfba..fd597248 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "consolidation/robo": "^2.0 || ^3.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.8 || ^2.0", - "phpunit/php-code-coverage": "^10.1", "phpunit/phpunit": "^9.5 || ^10.5", "squizlabs/php_codesniffer": "^3.7" }, diff --git a/tests/unit/phpunit.xml.dist b/tests/unit/phpunit.xml.dist index ba8cb437..de58085e 100644 --- a/tests/unit/phpunit.xml.dist +++ b/tests/unit/phpunit.xml.dist @@ -4,7 +4,7 @@ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd" colors="true" columns="max" - bootstrap="../../bootstrap.php" + bootstrap="../../autoload.php" beStrictAboutTestsThatDoNotTestAnything="false" > From 50ede2998200ad596d39618197ed4dcc4358bd4f Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Thu, 16 Jan 2025 21:46:05 +0530 Subject: [PATCH 063/113] MCLOUD-13147: Upgraded the noNamespaceSchemaLocation for PHPUnit config files --- tests/integration/phpunit.xml.dist | 2 +- tests/unit/phpunit.xml.dist | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/phpunit.xml.dist b/tests/integration/phpunit.xml.dist index 36126fde..9a217f08 100644 --- a/tests/integration/phpunit.xml.dist +++ b/tests/integration/phpunit.xml.dist @@ -1,7 +1,7 @@ From 3bf9045939e3cba6154498669fb0fa10e6fc8ba9 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Thu, 16 Jan 2025 22:50:49 +0530 Subject: [PATCH 064/113] MCLOUD-13147: Upgraded the PHPUnit config files --- tests/unit/phpunit.xml.dist | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/unit/phpunit.xml.dist b/tests/unit/phpunit.xml.dist index ce521c3e..d5ba19cd 100644 --- a/tests/unit/phpunit.xml.dist +++ b/tests/unit/phpunit.xml.dist @@ -12,14 +12,11 @@ ../../src/Test/Unit - - - ../../src - - ../../src/Test - - - + + + ../../src + + From eedbfcc0d49355572e004ddfc2fa989f5499e79f Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Tue, 21 Jan 2025 20:22:59 +0530 Subject: [PATCH 065/113] MCLOUD-13147: Updated cloud docker version in composer.json file for PHP8.4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fd597248..ecda0381 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.4.0", + "version": "1.5.0", "license": [ "OSL-3.0", "AFL-3.0" From 022e7d0f2e0967f59c757181057dcb52bb685203 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 27 Jan 2025 18:33:12 +0530 Subject: [PATCH 066/113] MCLOUD-13147: Added PHP8.4 deprecation fixes for test --- src/Test/Integration/BuildComposeTest.php | 2 +- src/Test/Integration/BuildCustomComposeTest.php | 2 +- tests/integration/Container.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Test/Integration/BuildComposeTest.php b/src/Test/Integration/BuildComposeTest.php index 288f5635..1d07abab 100644 --- a/src/Test/Integration/BuildComposeTest.php +++ b/src/Test/Integration/BuildComposeTest.php @@ -71,7 +71,7 @@ public function testBuild(string $directory, array $options): void * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function buildDataProvider(): array + public static function buildDataProvider(): array { return [ 'cloud-base' => [ diff --git a/src/Test/Integration/BuildCustomComposeTest.php b/src/Test/Integration/BuildCustomComposeTest.php index 235dfc7f..ff1f723b 100644 --- a/src/Test/Integration/BuildCustomComposeTest.php +++ b/src/Test/Integration/BuildCustomComposeTest.php @@ -69,7 +69,7 @@ public function testBuild(string $directory, array $arguments): void * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function buildDataProvider(): array + public static function buildDataProvider(): array { return [ 'cloud-base' => [ diff --git a/tests/integration/Container.php b/tests/integration/Container.php index 8052c2b2..001c10b2 100644 --- a/tests/integration/Container.php +++ b/tests/integration/Container.php @@ -29,7 +29,7 @@ class Container extends \Magento\CloudDocker\App\Container public static function getInstance( string $root, string $magentoBasePath, - string $toolsBasePath = null + ?string $toolsBasePath = null ): self { $key = crc32($root . $magentoBasePath . $toolsBasePath); From da0b17ae822dad7614322b7290a56d9020bd2708 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 27 Jan 2025 18:49:39 +0530 Subject: [PATCH 067/113] MCLOUD-13147: Added fixation for PHP8.1&8.2 unit test failures --- src/Test/Unit/Config/Dist/GeneratorTest.php | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Test/Unit/Config/Dist/GeneratorTest.php b/src/Test/Unit/Config/Dist/GeneratorTest.php index fa3f4d53..8af337d2 100644 --- a/src/Test/Unit/Config/Dist/GeneratorTest.php +++ b/src/Test/Unit/Config/Dist/GeneratorTest.php @@ -190,24 +190,24 @@ public function testGenerate(): void 'exported_application_value', ] ]); + + $expectedCalls = [ + [ + $rootDir . '/config.php.dist', + $this->getConfigForUpdate(), + ], + [ + $rootDir . '/config.env', + 'MAGENTO_CLOUD_RELATIONSHIPS=base64_relationship_value' . PHP_EOL + . 'MAGENTO_CLOUD_ROUTES=base64_routes_value' . PHP_EOL + . 'MAGENTO_CLOUD_VARIABLES=base64_variables_value' . PHP_EOL + . 'MAGENTO_CLOUD_APPLICATION=base64_application_value' . PHP_EOL, + ], + ]; $this->filesystemMock->expects($this->exactly(2)) ->method('put') - ->willReturnCallback(function ($file, $content) use ($rootDir) { - static $expectedCalls = [ - [ - $rootDir . '/config.php.dist', - $this->getConfigForUpdate(), - ], - [ - $rootDir . '/config.env', - 'MAGENTO_CLOUD_RELATIONSHIPS=base64_relationship_value' . PHP_EOL - . 'MAGENTO_CLOUD_ROUTES=base64_routes_value' . PHP_EOL - . 'MAGENTO_CLOUD_VARIABLES=base64_variables_value' . PHP_EOL - . 'MAGENTO_CLOUD_APPLICATION=base64_application_value' . PHP_EOL, - ], - ]; - + ->willReturnCallback(function ($file, $content) use (&$expectedCalls) { $expectedCall = array_shift($expectedCalls); $this->assertSame($expectedCall[0], $file); From 0a066d65b501bd018f12f426f9f055fd7cc6aa82 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 27 Jan 2025 19:01:51 +0530 Subject: [PATCH 068/113] MCLOUD-13147: Added fixation for PHP8.1&8.2 unit test failures --- src/Test/Unit/Config/RelationshipTest.php | 49 ++++++++++------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/src/Test/Unit/Config/RelationshipTest.php b/src/Test/Unit/Config/RelationshipTest.php index a32cec03..e4a18f2a 100644 --- a/src/Test/Unit/Config/RelationshipTest.php +++ b/src/Test/Unit/Config/RelationshipTest.php @@ -135,40 +135,35 @@ public function testGet() return $expectedResponse; }); + $services = [ + ServiceInterface::SERVICE_DB, + 'redis', + 'elasticsearch', + 'opensearch', + 'rabbitmq', + 'zookeeper' + ]; + + $versions = [ + $mysqlVersion, + $redisVersion, + $esVersion, + $osVersion, + $rmqVersion, + $zookeeperVersion + ]; + $this->configMock->expects($this->exactly(6)) ->method('getServiceVersion') ->willReturnCallback(function ($service) use ( - $mysqlVersion, - $redisVersion, - $esVersion, - $osVersion, - $rmqVersion, - $zookeeperVersion + &$services, + &$versions ) { - static $services = [ - ServiceInterface::SERVICE_DB, - 'redis', - 'elasticsearch', - 'opensearch', - 'rabbitmq', - 'zookeeper' - ]; - - static $versions = [ - $mysqlVersion, - $redisVersion, - $esVersion, - $osVersion, - $rmqVersion, - $zookeeperVersion - ]; - $expectedService = array_shift($services); $expectedVersion = array_shift($versions); - - // Assert that the service passed is the expected one + $this->assertSame($expectedService, $service); - + return $expectedVersion; }); From 520d92ed846a7b64c85042d726129243138fc56c Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Tue, 28 Jan 2025 12:10:00 -0600 Subject: [PATCH 069/113] Add dockerfile for php 8.4 --- images/php/8.4-cli/Dockerfile | 214 +++++++++++++++++++++++ images/php/8.4-cli/bin/cloud-build | 44 +++++ images/php/8.4-cli/bin/cloud-deploy | 37 ++++ images/php/8.4-cli/bin/cloud-post-deploy | 11 ++ images/php/8.4-cli/bin/ece-command | 7 + images/php/8.4-cli/bin/magento-command | 7 + images/php/8.4-cli/bin/magento-installer | 11 ++ images/php/8.4-cli/bin/mftf-command | 7 + images/php/8.4-cli/bin/run-cron | 3 + images/php/8.4-cli/bin/run-hooks | 61 +++++++ images/php/8.4-cli/docker-entrypoint.sh | 35 ++++ images/php/8.4-cli/etc/mail.ini | 2 + images/php/8.4-cli/etc/php-cli.ini | 10 ++ images/php/8.4-cli/etc/php-gnupg.ini | 1 + images/php/8.4-cli/etc/php-pcov.ini | 2 + images/php/8.4-cli/etc/php-xdebug.ini | 8 + images/php/8.4-fpm/Dockerfile | 171 ++++++++++++++++++ images/php/8.4-fpm/docker-entrypoint.sh | 24 +++ images/php/8.4-fpm/etc/mail.ini | 2 + images/php/8.4-fpm/etc/php-fpm.conf | 25 +++ images/php/8.4-fpm/etc/php-fpm.ini | 4 + images/php/8.4-fpm/etc/php-gnupg.ini | 1 + images/php/8.4-fpm/etc/php-pcov.ini | 2 + images/php/8.4-fpm/etc/php-xdebug.ini | 8 + src/Command/Image/GeneratePhp.php | 5 +- src/Compose/Php/ExtensionResolver.php | 4 + 26 files changed, 704 insertions(+), 2 deletions(-) create mode 100644 images/php/8.4-cli/Dockerfile create mode 100644 images/php/8.4-cli/bin/cloud-build create mode 100644 images/php/8.4-cli/bin/cloud-deploy create mode 100644 images/php/8.4-cli/bin/cloud-post-deploy create mode 100644 images/php/8.4-cli/bin/ece-command create mode 100644 images/php/8.4-cli/bin/magento-command create mode 100644 images/php/8.4-cli/bin/magento-installer create mode 100644 images/php/8.4-cli/bin/mftf-command create mode 100644 images/php/8.4-cli/bin/run-cron create mode 100644 images/php/8.4-cli/bin/run-hooks create mode 100644 images/php/8.4-cli/docker-entrypoint.sh create mode 100644 images/php/8.4-cli/etc/mail.ini create mode 100644 images/php/8.4-cli/etc/php-cli.ini create mode 100644 images/php/8.4-cli/etc/php-gnupg.ini create mode 100644 images/php/8.4-cli/etc/php-pcov.ini create mode 100644 images/php/8.4-cli/etc/php-xdebug.ini create mode 100644 images/php/8.4-fpm/Dockerfile create mode 100644 images/php/8.4-fpm/docker-entrypoint.sh create mode 100644 images/php/8.4-fpm/etc/mail.ini create mode 100644 images/php/8.4-fpm/etc/php-fpm.conf create mode 100644 images/php/8.4-fpm/etc/php-fpm.ini create mode 100644 images/php/8.4-fpm/etc/php-gnupg.ini create mode 100644 images/php/8.4-fpm/etc/php-pcov.ini create mode 100644 images/php/8.4-fpm/etc/php-xdebug.ini diff --git a/images/php/8.4-cli/Dockerfile b/images/php/8.4-cli/Dockerfile new file mode 100644 index 00000000..66e41977 --- /dev/null +++ b/images/php/8.4-cli/Dockerfile @@ -0,0 +1,214 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.4-cli + +ARG COMPOSER_VERSION=2.8.4 +ARG MAGENTO_ROOT=/app +ARG COMPOSER_ALLOW_SUPERUSER=1 +ARG COMPOSER_HOME=/composer +ARG CRONTAB="" + +ENV COMPOSER_MEMORY_LIMIT=-1 +ENV COMPOSER_ALLOW_SUPERUSER=${COMPOSER_ALLOW_SUPERUSER} +ENV COMPOSER_HOME=${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE=false +ENV PHP_MEMORY_LIMIT=-1 +ENV PHP_VALIDATE_TIMESTAMPS=1 +ENV DEBUG=false +ENV MAGENTO_RUN_MODE=production +ENV SENDMAIL_PATH=/dev/null +ENV PHPRC=${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS="\ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + intl \ + mysqli \ + opcache \ + pdo_\ + mysql \ + redis \ + soap \ + sockets \ + sodium \ + sysvmsg \ + sysvsem \ + sysvshm \ + xsl \ + zip \ + pcntl" + +# Configure Node.js version +RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + cron \ + git \ + mariadb-client \ + nano \ + nodejs \ + python3 \ + python3-pip \ + redis-tools \ + sendmail-bin \ + sendmail \ + sudo \ + unzip \ + vim \ + openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install Python packages + + +# Install Grunt +RUN npm install -g grunt-cli + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.4.0 \ + xmlrpc-1.0.0RC3 \ + yaml \ + pspell + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini +ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +# Get composer installed to /usr/local/bin/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer + +ADD bin/* /usr/local/bin/ + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +ADD docker-entrypoint.sh /docker-entrypoint.sh + +RUN ["chmod", "+x", \ + "/docker-entrypoint.sh", \ + "/usr/local/bin/magento-installer", \ + "/usr/local/bin/magento-command", \ + "/usr/local/bin/mftf-command", \ + "/usr/local/bin/ece-command", \ + "/usr/local/bin/cloud-build", \ + "/usr/local/bin/cloud-deploy", \ + "/usr/local/bin/cloud-post-deploy", \ + "/usr/local/bin/run-cron", \ + "/usr/local/bin/run-hooks" \ +] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["bash"] diff --git a/images/php/8.4-cli/bin/cloud-build b/images/php/8.4-cli/bin/cloud-build new file mode 100644 index 00000000..bbd584c9 --- /dev/null +++ b/images/php/8.4-cli/bin/cloud-build @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +RUN_HOOKS="run-hooks" + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Cleaning directories:" + + if [ "$INSTALLATION_TYPE" == "composer" ]; then + echo "Cleaning setup directory." + rm -rf $MAGENTO_ROOT/setup/* + fi + + echo "Cleaning vendor directory." + rm -rf $MAGENTO_ROOT/vendor/* + + echo "Cleaning generated directory." + rm -rf $MAGENTO_ROOT/generated/* + + echo "Removing app/etc/env.php file" + rm -f $MAGENTO_ROOT/app/etc/env.php +fi + +echo "Installing dependencies." + +composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist + +echo "Running \"build\" hook." + +$RUN_HOOKS build + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Setting file permissions." + + chown -R www:www $MAGENTO_ROOT + + find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; + find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; +fi + +echo "Building complete." diff --git a/images/php/8.4-cli/bin/cloud-deploy b/images/php/8.4-cli/bin/cloud-deploy new file mode 100644 index 00000000..f6b891bf --- /dev/null +++ b/images/php/8.4-cli/bin/cloud-deploy @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"deploy\" hook." + +run-hooks deploy + +# check that Varnish exists +if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then + minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") + if [[ "$minor_magento_version" != "2.1" ]]; then + output=$(magento-command config:set system/full_page_cache/caching_application 2) + # as config:set does not return error code, we check output text to continue set varnish settings + if [[ $output == *"Value was saved"* ]]; then + echo "Setting Varnish for Magento FPC." + magento-command setup:config:set --http-cache-hosts=varnish -n + else + echo $output + fi + fi +fi + +# set developer mode if it is configured in $MAGENTO_RUN_MODE +if [ "$MAGENTO_RUN_MODE" == "developer" ]; then + output=$(magento-command deploy:mode:set developer) + if [[ $output == *"Enabled developer mode."* ]]; then + echo "Enabled developer mode." + else + echo $output + fi +fi + + +echo "Deployment finished." diff --git a/images/php/8.4-cli/bin/cloud-post-deploy b/images/php/8.4-cli/bin/cloud-post-deploy new file mode 100644 index 00000000..f5bb3956 --- /dev/null +++ b/images/php/8.4-cli/bin/cloud-post-deploy @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"post-deploy\" hook." + +run-hooks post_deploy + +echo "Post deployment finished." diff --git a/images/php/8.4-cli/bin/ece-command b/images/php/8.4-cli/bin/ece-command new file mode 100644 index 00000000..36d896c5 --- /dev/null +++ b/images/php/8.4-cli/bin/ece-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" + +exec $ECE_COMMAND "$@" diff --git a/images/php/8.4-cli/bin/magento-command b/images/php/8.4-cli/bin/magento-command new file mode 100644 index 00000000..8d439f7d --- /dev/null +++ b/images/php/8.4-cli/bin/magento-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" + +exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.4-cli/bin/magento-installer b/images/php/8.4-cli/bin/magento-installer new file mode 100644 index 00000000..73645ab7 --- /dev/null +++ b/images/php/8.4-cli/bin/magento-installer @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +BUILD_COMMAND="cloud-build" +DEPLOY_COMMAND="cloud-deploy" + +$BUILD_COMMAND +$DEPLOY_COMMAND diff --git a/images/php/8.4-cli/bin/mftf-command b/images/php/8.4-cli/bin/mftf-command new file mode 100644 index 00000000..88eaa1df --- /dev/null +++ b/images/php/8.4-cli/bin/mftf-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" + +exec $MFTF_COMMAND "$@" diff --git a/images/php/8.4-cli/bin/run-cron b/images/php/8.4-cli/bin/run-cron new file mode 100644 index 00000000..f6554a5c --- /dev/null +++ b/images/php/8.4-cli/bin/run-cron @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.4-cli/bin/run-hooks b/images/php/8.4-cli/bin/run-hooks new file mode 100644 index 00000000..8ac215c9 --- /dev/null +++ b/images/php/8.4-cli/bin/run-hooks @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import os +import sys +import subprocess +import json +import base64 + +# Disable output buffering. +os.environ['PYTHONUNBUFFERED'] = "1" + +# The list of available hooks. +available_hooks = ["build", "deploy", "post_deploy"] + + +# Prints a message and returns an exit code. +def error_exit(msg, code=1): + print(msg) + sys.exit(code) + + +# Gets Magento root path. +def get_magento_root(): + try: + return str(os.environ['MAGENTO_ROOT']) + except KeyError: + error_exit('Environment variable MAGENTO_ROOT is not available') + + +# Gets set hooks by hook name. +def get_hooks(hook_name): + try: + application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) + content = json.loads(base64.b64decode(application).decode("utf-8")) + + return content['hooks'][hook_name] + except Exception as exc: + error_exit("Cannot decode string: " + str(exc)) + + +# Main function. +def main(): + if len(sys.argv) != 2: + error_exit("Usage: run-hooks ") + + hook_name = str(sys.argv[1]) + if hook_name not in available_hooks: + error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) + + try: + subprocess.check_call( + get_hooks(hook_name), + shell=True, + cwd=get_magento_root() + ) + except subprocess.CalledProcessError as exc: + error_exit("returned non-zero exit status " + str(exc.returncode)) + + +if __name__ == '__main__': + main() diff --git a/images/php/8.4-cli/docker-entrypoint.sh b/images/php/8.4-cli/docker-entrypoint.sh new file mode 100644 index 00000000..ee380b80 --- /dev/null +++ b/images/php/8.4-cli/docker-entrypoint.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +if [ ! -z "${CRONTAB}" ]; then + echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log +fi + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + +# Configure composer +[ ! -z "${COMPOSER_VERSION}" ] && \ + composer self-update $COMPOSER_VERSION + +[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ + composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN + +[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ + composer config --global http-basic.repo.magento.com \ + $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD + +exec "$@" diff --git a/images/php/8.4-cli/etc/mail.ini b/images/php/8.4-cli/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.4-cli/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.4-cli/etc/php-cli.ini b/images/php/8.4-cli/etc/php-cli.ini new file mode 100644 index 00000000..dfaf04e4 --- /dev/null +++ b/images/php/8.4-cli/etc/php-cli.ini @@ -0,0 +1,10 @@ +; php.ini +memory_limit = ${PHP_MEMORY_LIMIT} +zlib.output_compression = on +realpath_cache_size = 32k +realpath_cache_ttl = 7200 +always_populate_raw_post_data = -1 +max_input_vars = 10000 +session.gc_probability = 1 +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/8.4-cli/etc/php-gnupg.ini b/images/php/8.4-cli/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.4-cli/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.4-cli/etc/php-pcov.ini b/images/php/8.4-cli/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.4-cli/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.4-cli/etc/php-xdebug.ini b/images/php/8.4-cli/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.4-cli/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM diff --git a/images/php/8.4-fpm/Dockerfile b/images/php/8.4-fpm/Dockerfile new file mode 100644 index 00000000..a09107f1 --- /dev/null +++ b/images/php/8.4-fpm/Dockerfile @@ -0,0 +1,171 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.4-fpm + +ARG MAGENTO_ROOT=/app + +ENV PHP_MEMORY_LIMIT=2G +ENV PHP_VALIDATE_TIMESTAMPS=1 +ENV DEBUG=false +ENV MAGENTO_RUN_MODE=production +ENV UPLOAD_MAX_FILESIZE=64M +ENV SENDMAIL_PATH=/dev/null +ENV PHPRC=${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS="\ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + redis \ + soap \ + sockets \ + sodium \ + sysvmsg \ + sysvsem \ + sysvshm \ + xsl \ + zip \ + pcntl" + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + sendmail-bin \ + sendmail \ + sudo \ + iproute2 \ + git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.4.0 \ + xmlrpc-1.0.0RC3 \ + yaml \ + pspell + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini +COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +COPY etc/php-fpm.conf /usr/local/etc/ +COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN ["chmod", "+x", "/docker-entrypoint.sh"] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["php-fpm", "-R"] diff --git a/images/php/8.4-fpm/docker-entrypoint.sh b/images/php/8.4-fpm/docker-entrypoint.sh new file mode 100644 index 00000000..0c8c5c9c --- /dev/null +++ b/images/php/8.4-fpm/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Set host.docker.internal if not available +HOST_NAME="host.docker.internal" +HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") +if [[ "$HOST_IP" == "$HOST_NAME" ]]; then + HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') + printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts +fi + +exec "$@" diff --git a/images/php/8.4-fpm/etc/mail.ini b/images/php/8.4-fpm/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.4-fpm/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.4-fpm/etc/php-fpm.conf b/images/php/8.4-fpm/etc/php-fpm.conf new file mode 100644 index 00000000..d988b314 --- /dev/null +++ b/images/php/8.4-fpm/etc/php-fpm.conf @@ -0,0 +1,25 @@ +[global] + +error_log = /proc/self/fd/2 +daemonize = no + +[www] + +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + +listen = [::]:9000 + +pm = dynamic +pm.max_children = 10 +pm.start_servers = 4 +pm.min_spare_servers = 2 +pm.max_spare_servers = 6 +pm.status_path = /status + +clear_env = no + +env[MAGE_MODE] = $MAGENTO_RUN_MODE + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes diff --git a/images/php/8.4-fpm/etc/php-fpm.ini b/images/php/8.4-fpm/etc/php-fpm.ini new file mode 100644 index 00000000..387c8aeb --- /dev/null +++ b/images/php/8.4-fpm/etc/php-fpm.ini @@ -0,0 +1,4 @@ +memory_limit = ${PHP_MEMORY_LIMIT} +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} +user_ini.filename = diff --git a/images/php/8.4-fpm/etc/php-gnupg.ini b/images/php/8.4-fpm/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.4-fpm/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.4-fpm/etc/php-pcov.ini b/images/php/8.4-fpm/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.4-fpm/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.4-fpm/etc/php-xdebug.ini b/images/php/8.4-fpm/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.4-fpm/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index db55ba51..6e106caa 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,13 +26,14 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['8.0', '8.1', '8.2', '8.3']; + private const SUPPORTED_VERSIONS = ['8.0', '8.1', '8.2', '8.3', '8.4']; private const VERSION_MAP = [ '8.0' => '8.0.14', '8.1' => '8.1.1', '8.2' => '8.2', - '8.3' => '8.3' + '8.3' => '8.3', + '8.4' => '8.4' ]; private const EDITION_CLI = 'cli'; diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index f7f172d6..b4510318 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -435,6 +435,10 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', ], + '>=8.4' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.4.0', + ], ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], From baadc09dd60f0b660a38a1236d0fd8db39f67a6d Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Fri, 31 Jan 2025 19:25:52 +0530 Subject: [PATCH 070/113] MCLOUD-13147: Fixed functional test for PHP8 --- composer.json | 6 +++--- tests/functional/_support/CliTester.php | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index ecda0381..04b7879d 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.5.0", + "version": "1.4.0", "license": [ "OSL-3.0", "AFL-3.0" @@ -10,7 +10,7 @@ "require": { "php": "^8.0", "ext-json": "*", - "composer/composer": "^1.9 || ^2.0", + "composer/composer": "^1.9 || ^2.8 || !=2.2.16", "composer/semver": "@stable", "illuminate/config": "^10.0 || ^11.0", "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", @@ -27,7 +27,7 @@ "consolidation/robo": "^2.0 || ^3.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.8 || ^2.0", - "phpunit/phpunit": "^9.5 || ^10.5", + "phpunit/phpunit": "^10.0", "squizlabs/php_codesniffer": "^3.7" }, "bin": [ diff --git a/tests/functional/_support/CliTester.php b/tests/functional/_support/CliTester.php index 255f1912..40dc407d 100644 --- a/tests/functional/_support/CliTester.php +++ b/tests/functional/_support/CliTester.php @@ -5,8 +5,6 @@ */ declare(strict_types=1); -namespace Magento\CloudDocker\Test\Functional\Support; - /** * @inheritdoc */ From a7b4802684b65c959dfeaf1357d2719f29b59f7e Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 3 Feb 2025 17:30:52 +0530 Subject: [PATCH 071/113] MCLOUD-13147: Removed the warning fix for FailedInfo test file which appear on composer update --- codeception.dist.yml | 16 ++++++++-------- composer.json | 3 +-- tests/functional/_support/FailedInfo.php | 2 -- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/codeception.dist.yml b/codeception.dist.yml index 5bbc62f5..60096792 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -17,14 +17,14 @@ modules: config: Magento\CloudDocker\Test\Functional\Codeception\TestInfrastructure: template_repo: "https://github.com/magento/magento-cloud.git" - mcd_repo: "https://github.com/magento/magento-cloud-docker.git" - mcc_repo: "https://github.com/magento/magento-cloud-components.git" - mcp_repo: "https://github.com/magento/magento-cloud-patches.git" - mqp_repo: "https://github.com/magento/quality-patches.git" - ece_tools_repo: "https://github.com/magento/ece-tools.git" - composer_magento_username: "%REPO_USERNAME%" - composer_magento_password: "%REPO_PASSWORD%" - composer_github_token: "%GITHUB_TOKEN%" + mcd_repo: "https://github.com/magento-commerce/magento-cloud-docker.git" + mcc_repo: "https://github.com/magento-commerce/magento-cloud-components.git" + mcp_repo: "https://github.com/magento-commerce/magento-cloud-patches.git" + mqp_repo: "https://github.com/magento-commerce/quality-patches.git" + ece_tools_repo: "https://github.com/magento-commerce/ece-tools.git" + composer_magento_username: "ef3b7137d50aee1c330db65fefeb1848" + composer_magento_password: "1916340bb6189552d73ead2d3966e188" + composer_github_token: "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" use_custom_images: false custom_images_namespace: "cloudft" version_custom_images: "%TRAVIS_BUILD_NUMBER%" diff --git a/composer.json b/composer.json index 04b7879d..87d22c5f 100644 --- a/composer.json +++ b/composer.json @@ -37,8 +37,7 @@ "psr-4": { "Magento\\CloudDocker\\": "src/", "Magento\\CloudDocker\\Test\\Integration\\": "tests/integration", - "Magento\\CloudDocker\\Test\\Functional\\": "tests/functional/", - "Magento\\CloudDocker\\Test\\Functional\\Support\\": "tests/functional/_support/" + "Magento\\CloudDocker\\Test\\Functional\\": "tests/functional/" } }, "scripts": { diff --git a/tests/functional/_support/FailedInfo.php b/tests/functional/_support/FailedInfo.php index d8d68e6b..e4dabeba 100644 --- a/tests/functional/_support/FailedInfo.php +++ b/tests/functional/_support/FailedInfo.php @@ -5,8 +5,6 @@ */ declare(strict_types=1); -namespace Magento\CloudDocker\Test\Functional\Support; - use Codeception\Events; use Codeception\Extension; use Codeception\Event\FailEvent; From c88dedd516328d1d33aa181d5164412d29bcbfa8 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 3 Feb 2025 18:35:24 +0530 Subject: [PATCH 072/113] MCLOUD-13147: Reverted the codeception.dist.yml to original --- codeception.dist.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/codeception.dist.yml b/codeception.dist.yml index 60096792..5bbc62f5 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -17,14 +17,14 @@ modules: config: Magento\CloudDocker\Test\Functional\Codeception\TestInfrastructure: template_repo: "https://github.com/magento/magento-cloud.git" - mcd_repo: "https://github.com/magento-commerce/magento-cloud-docker.git" - mcc_repo: "https://github.com/magento-commerce/magento-cloud-components.git" - mcp_repo: "https://github.com/magento-commerce/magento-cloud-patches.git" - mqp_repo: "https://github.com/magento-commerce/quality-patches.git" - ece_tools_repo: "https://github.com/magento-commerce/ece-tools.git" - composer_magento_username: "ef3b7137d50aee1c330db65fefeb1848" - composer_magento_password: "1916340bb6189552d73ead2d3966e188" - composer_github_token: "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" + mcd_repo: "https://github.com/magento/magento-cloud-docker.git" + mcc_repo: "https://github.com/magento/magento-cloud-components.git" + mcp_repo: "https://github.com/magento/magento-cloud-patches.git" + mqp_repo: "https://github.com/magento/quality-patches.git" + ece_tools_repo: "https://github.com/magento/ece-tools.git" + composer_magento_username: "%REPO_USERNAME%" + composer_magento_password: "%REPO_PASSWORD%" + composer_github_token: "%GITHUB_TOKEN%" use_custom_images: false custom_images_namespace: "cloudft" version_custom_images: "%TRAVIS_BUILD_NUMBER%" From 482903047caa8f63ade9ebf58955b518c0a86f47 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 3 Feb 2025 21:24:43 +0530 Subject: [PATCH 073/113] MCLOUD-13147: Cosmetic update of namespace of test class file --- tests/functional/_support/FailedInfo.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functional/_support/FailedInfo.php b/tests/functional/_support/FailedInfo.php index e4dabeba..243c414c 100644 --- a/tests/functional/_support/FailedInfo.php +++ b/tests/functional/_support/FailedInfo.php @@ -5,6 +5,8 @@ */ declare(strict_types=1); +namespace Codeception\Extension; + use Codeception\Events; use Codeception\Extension; use Codeception\Event\FailEvent; From 1e6d756ca0f78fa623562233e24f6b358b948823 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 3 Feb 2025 15:30:32 -0600 Subject: [PATCH 074/113] add version for illuminate config package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 87d22c5f..645bf80b 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "ext-json": "*", "composer/composer": "^1.9 || ^2.8 || !=2.2.16", "composer/semver": "@stable", - "illuminate/config": "^10.0 || ^11.0", + "illuminate/config": "^8.77 || ^10.0 || ^11.0", "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4", "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4", From 8a656e2de97bf777816b2305ec93bdea8fc283bb Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Wed, 5 Feb 2025 18:04:40 -0600 Subject: [PATCH 075/113] bump version to 1.4.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 645bf80b..c93df5a9 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.4.0", + "version": "1.4.1", "license": [ "OSL-3.0", "AFL-3.0" From 79353de7d2be15ed6518199763426f0c23a53570 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 6 Feb 2025 09:17:25 -0600 Subject: [PATCH 076/113] add ftp extension --- images/php/8.4-cli/Dockerfile | 9 +++++---- images/php/8.4-fpm/Dockerfile | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/images/php/8.4-cli/Dockerfile b/images/php/8.4-cli/Dockerfile index 66e41977..d04d9411 100644 --- a/images/php/8.4-cli/Dockerfile +++ b/images/php/8.4-cli/Dockerfile @@ -39,8 +39,7 @@ ENV PHP_EXTENSIONS="\ intl \ mysqli \ opcache \ - pdo_\ - mysql \ + pdo_mysql \ redis \ soap \ sockets \ @@ -50,7 +49,8 @@ ENV PHP_EXTENSIONS="\ sysvshm \ xsl \ zip \ - pcntl" + pcntl \ + ftp" # Configure Node.js version RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash @@ -134,7 +134,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ diff --git a/images/php/8.4-fpm/Dockerfile b/images/php/8.4-fpm/Dockerfile index a09107f1..1e610bef 100644 --- a/images/php/8.4-fpm/Dockerfile +++ b/images/php/8.4-fpm/Dockerfile @@ -42,7 +42,8 @@ ENV PHP_EXTENSIONS="\ sysvshm \ xsl \ zip \ - pcntl" + pcntl \ + ftp" # Install dependencies RUN apt-get update \ @@ -108,7 +109,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ From c4512e18103d8ec19c305eed5161d5a68dae81a7 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 6 Feb 2025 13:58:25 -0600 Subject: [PATCH 077/113] add extension ftp for docker compose --- src/Command/Image/GeneratePhp.php | 3 ++- src/Compose/Php/ExtensionResolver.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 3de919ab..fcaf1f6a 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -88,7 +88,8 @@ class GeneratePhp extends Command 'opcache', 'xsl', 'zip', - 'sodium' + 'sodium', + 'ftp' ]; private const DOCKERFILE = 'Dockerfile'; diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index d41f093a..0b20e270 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -50,6 +50,7 @@ class ExtensionResolver // Required for Magento 2.4.0+ 'xsl', 'sodium', + 'ftp' ]; /** @@ -494,6 +495,9 @@ public static function getConfig(): array BASH ], ], + 'ftp' => [ + '>=8.4' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], + ], ]; } } From 0762c25c5ca8c45bbc84c100f40fa4b37e864800 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Wed, 19 Feb 2025 19:54:19 +0530 Subject: [PATCH 078/113] MCLOUD-13209: Added fix in PHP extension version check condition --- src/Compose/Php/ExtensionResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 0b20e270..8e0ec04d 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -131,7 +131,7 @@ public function get(Config $config): array foreach ($phpExtensions as $phpExtName) { if (isset(self::BUILTIN_EXTENSIONS[$phpExtName]) - && $this->semver::satisfies($phpVersion, self::BUILTIN_EXTENSIONS[$phpExtName]) + && $this->semver::satisfies($phpVersion, (float) self::BUILTIN_EXTENSIONS[$phpExtName]) ) { continue; } From 32904d1888aae413b03682951215fde70ecb9d6c Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Thu, 6 Mar 2025 16:29:31 +0530 Subject: [PATCH 079/113] MCLOUD-13209: Added fix in PHP extension version check condition --- src/Compose/Php/ExtensionResolver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 8e0ec04d..43ad5d0e 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -131,7 +131,7 @@ public function get(Config $config): array foreach ($phpExtensions as $phpExtName) { if (isset(self::BUILTIN_EXTENSIONS[$phpExtName]) - && $this->semver::satisfies($phpVersion, (float) self::BUILTIN_EXTENSIONS[$phpExtName]) + && $this->semver::satisfies($phpVersion, self::BUILTIN_EXTENSIONS[$phpExtName]) ) { continue; } @@ -496,7 +496,9 @@ public static function getConfig(): array ], ], 'ftp' => [ - '>=8.4' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], + '>=8.2' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE, + ], ], ]; } From ad4b177d1b2663bc1def9984ed2328729a7a35fc Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Fri, 21 Mar 2025 21:53:02 +0530 Subject: [PATCH 080/113] MCLOUD-13209: Fixed functional test for all PHP8 versions --- src/Test/Functional/Acceptance/AbstractCest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index 14f5e603..dc491f14 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,14 +33,14 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.3.5'); + $I->createArtifactCurrentTestedCode('docker', '1.4.1'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.3.5'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.1'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( 'magento/ece-tools', - $I->getDependencyVersion('magento/ece-tools') ?: 'dev-develop as 2002.1.99' + $I->getDependencyVersion('magento/ece-tools') ?: 'dev-develop as 2002.2.99' ); if ($mccVersion = $I->getDependencyVersion('magento/magento-cloud-components')) { From aa6f9a9f35d6b79ff3e0062cb23dade5243ecafb Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 7 Apr 2025 15:39:36 +0530 Subject: [PATCH 081/113] MCLOUD-13440: Release cloud docker - 1.4.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c93df5a9..a44febb1 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.4.1", + "version": "1.4.2", "license": [ "OSL-3.0", "AFL-3.0" From 262f9cf05187adde0ac3d8d517373ba6cfd0a39c Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 14 Apr 2025 13:47:09 +0530 Subject: [PATCH 082/113] MCLOUD-13311: PHP8.4 functional test --- .../Functional/Acceptance/AbstractCest.php | 4 ++-- .../Acceptance/Acceptance83Cest.php | 21 +++++++++++++++++ .../Functional/Acceptance/AcceptanceCest.php | 4 ++-- .../Functional/Acceptance/Developer83Cest.php | 21 +++++++++++++++++ .../Functional/Acceptance/DeveloperCest.php | 4 ++-- .../Acceptance/Elasticsearch83Cest.php | 23 +++++++++++++++++++ .../Acceptance/ElasticsearchCest.php | 4 ++-- .../Functional/Acceptance/MailHog83Cest.php | 19 +++++++++++++++ .../Functional/Acceptance/MailHogCest.php | 4 ++-- .../Acceptance/Opensearch83Cest.php | 23 +++++++++++++++++++ .../Functional/Acceptance/OpensearchCest.php | 4 ++-- 11 files changed, 119 insertions(+), 12 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Acceptance83Cest.php create mode 100644 src/Test/Functional/Acceptance/Developer83Cest.php create mode 100644 src/Test/Functional/Acceptance/Elasticsearch83Cest.php create mode 100644 src/Test/Functional/Acceptance/MailHog83Cest.php create mode 100644 src/Test/Functional/Acceptance/Opensearch83Cest.php diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index dc491f14..a66f8b7c 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,9 +33,9 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.4.1'); + $I->createArtifactCurrentTestedCode('docker', '1.4.2'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.1'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.2'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( diff --git a/src/Test/Functional/Acceptance/Acceptance83Cest.php b/src/Test/Functional/Acceptance/Acceptance83Cest.php new file mode 100644 index 00000000..8176de43 --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance83Cest.php @@ -0,0 +1,21 @@ + Date: Wed, 28 May 2025 19:12:07 +0530 Subject: [PATCH 083/113] MCLOUD-13707: Included newer versions for Cloud docker package dependency --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index a44febb1..f2595b27 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ "ext-json": "*", "composer/composer": "^1.9 || ^2.8 || !=2.2.16", "composer/semver": "@stable", - "illuminate/config": "^8.77 || ^10.0 || ^11.0", - "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", - "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4", - "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4", - "symfony/yaml": "^4.4 || ^5.1 || ^5.4|| ^6.4" + "illuminate/config": "^8.77 || ^10.0 || ^11.0 || ^12.16", + "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4 || ^7.2", + "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4 || ^7.2", + "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4 || ^7.2", + "symfony/yaml": "^4.4 || ^5.1 || ^5.4|| ^6.4 || ^7.2" }, "require-dev": { "codeception/codeception": "^4.1 || ^5.1", @@ -24,7 +24,7 @@ "codeception/module-db": "^1.0 || ^3.0", "codeception/module-phpbrowser": "^1.0 || ^3.0", "codeception/module-rest": "^1.2 || ^3.0", - "consolidation/robo": "^2.0 || ^3.0", + "consolidation/robo": "^2.0 || ^3.0 || ^4.0 || ^5.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.8 || ^2.0", "phpunit/phpunit": "^10.0", From ef72abb99013c88eb933e51a842d2e4b0bb4804a Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Mon, 2 Jun 2025 17:11:09 +0530 Subject: [PATCH 084/113] Cloud release cloud-docker 1.4.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f2595b27..c8cb805a 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.4.2", + "version": "1.4.3", "license": [ "OSL-3.0", "AFL-3.0" From 04c6a238546c154922d205c9b2e64b3c38616d3a Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Wed, 4 Jun 2025 18:03:32 +0530 Subject: [PATCH 085/113] added new service valkey --- config/services.xml | 1 + src/Command/BuildCompose.php | 5 ++ src/Compose/BuilderInterface.php | 1 + src/Compose/ProductionBuilder/CliDepend.php | 3 + .../ProductionBuilder/Service/Valkey.php | 85 +++++++++++++++++++ src/Config/Relationship.php | 6 ++ src/Config/Source/CliSource.php | 4 + src/Config/Source/SourceInterface.php | 5 ++ src/Service/ServiceFactory.php | 20 +++++ src/Service/ServiceInterface.php | 1 + 10 files changed, 131 insertions(+) create mode 100644 src/Compose/ProductionBuilder/Service/Valkey.php diff --git a/config/services.xml b/config/services.xml index 9dc5ae85..319f8350 100644 --- a/config/services.xml +++ b/config/services.xml @@ -24,6 +24,7 @@ + diff --git a/src/Command/BuildCompose.php b/src/Command/BuildCompose.php index 0059dcda..e06a86a9 100644 --- a/src/Command/BuildCompose.php +++ b/src/Command/BuildCompose.php @@ -138,6 +138,11 @@ protected function configure(): void null, InputOption::VALUE_REQUIRED, 'Redis version' + )->addOption( + Source\CliSource::OPTION_VALKEY, + null, + InputOption::VALUE_REQUIRED, + 'Valkey version' )->addOption( Source\CliSource::OPTION_ES, null, diff --git a/src/Compose/BuilderInterface.php b/src/Compose/BuilderInterface.php index ecfba36e..a31a394b 100644 --- a/src/Compose/BuilderInterface.php +++ b/src/Compose/BuilderInterface.php @@ -29,6 +29,7 @@ interface BuilderInterface public const SERVICE_TLS = ServiceInterface::SERVICE_TLS; public const SERVICE_RABBITMQ = ServiceInterface::SERVICE_RABBITMQ; public const SERVICE_REDIS = ServiceInterface::SERVICE_REDIS; + public const SERVICE_VALKEY = ServiceInterface::SERVICE_VALKEY; public const SERVICE_ELASTICSEARCH = ServiceInterface::SERVICE_ELASTICSEARCH; public const SERVICE_OPENSEARCH = ServiceInterface::SERVICE_OPENSEARCH; public const SERVICE_NODE = ServiceInterface::SERVICE_NODE; diff --git a/src/Compose/ProductionBuilder/CliDepend.php b/src/Compose/ProductionBuilder/CliDepend.php index 46abe017..c79b0a26 100644 --- a/src/Compose/ProductionBuilder/CliDepend.php +++ b/src/Compose/ProductionBuilder/CliDepend.php @@ -27,6 +27,9 @@ class CliDepend BuilderInterface::SERVICE_REDIS => [ 'condition' => 'service_healthy' ], + BuilderInterface::SERVICE_VALKEY => [ + 'condition' => 'service_healthy' + ], BuilderInterface::SERVICE_ELASTICSEARCH => [ 'condition' => 'service_healthy' ], diff --git a/src/Compose/ProductionBuilder/Service/Valkey.php b/src/Compose/ProductionBuilder/Service/Valkey.php new file mode 100644 index 00000000..a9263178 --- /dev/null +++ b/src/Compose/ProductionBuilder/Service/Valkey.php @@ -0,0 +1,85 @@ +serviceFactory = $serviceFactory; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return BuilderInterface::SERVICE_VALKEY; + } + + /** + * @inheritDoc + */ + public function getServiceName(): string + { + return $this->getName(); + } + + /** + * @inheritDoc + */ + public function getConfig(Config $config): array + { + return $this->serviceFactory->create( + $this->getServiceName(), + $config->getServiceVersion($this->getServiceName()), + [ + BuilderInterface::SERVICE_HEALTHCHECK => [ + 'test' => 'valkey-cli ping || exit 1', + 'interval' => '30s', + 'timeout' => '30s', + 'retries' => 3 + ] + ], + $config->getServiceImage($this->getServiceName()), + $config->getCustomRegistry() + ); + } + + /** + * @inheritDoc + */ + public function getNetworks(): array + { + return [BuilderInterface::NETWORK_MAGENTO]; + } + + /** + * @inheritDoc + */ + public function getDependsOn(Config $config): array + { + return []; + } +} diff --git a/src/Config/Relationship.php b/src/Config/Relationship.php index c98edcf9..6464ff81 100644 --- a/src/Config/Relationship.php +++ b/src/Config/Relationship.php @@ -55,6 +55,12 @@ class Relationship 'port' => '6379' ] ], + 'valkey' => [ + [ + 'host' => 'valkey', + 'port' => '6379' + ] + ], 'elasticsearch' => [ [ 'host' => 'elasticsearch', diff --git a/src/Config/Source/CliSource.php b/src/Config/Source/CliSource.php index 9cd66345..58acfdbf 100644 --- a/src/Config/Source/CliSource.php +++ b/src/Config/Source/CliSource.php @@ -27,6 +27,7 @@ class CliSource implements SourceInterface public const OPTION_EXPOSE_DB_QUOTE_PORT = 'expose-db-quote-port'; public const OPTION_EXPOSE_DB_SALES_PORT = 'expose-db-sales-port'; public const OPTION_REDIS = 'redis'; + public const OPTION_VALKEY = 'valkey'; public const OPTION_ES = 'es'; public const OPTION_OS = 'os'; public const OPTION_RABBIT_MQ = 'rmq'; @@ -124,6 +125,9 @@ class CliSource implements SourceInterface self::OPTION_REDIS => [ self::SERVICES_REDIS => true ], + self::OPTION_VALKEY => [ + self::SERVICES_VALKEY => true + ], self::OPTION_ES => [ self::SERVICES_ES => true ], diff --git a/src/Config/Source/SourceInterface.php b/src/Config/Source/SourceInterface.php index 9456293d..292a35ce 100644 --- a/src/Config/Source/SourceInterface.php +++ b/src/Config/Source/SourceInterface.php @@ -73,6 +73,11 @@ interface SourceInterface */ public const SERVICES_REDIS = self::SERVICES . '.' . ServiceInterface::SERVICE_REDIS; + /** + * Valkey + */ + public const SERVICES_VALKEY = self::SERVICES . '.' . ServiceInterface::SERVICE_VALKEY; + /** * ES */ diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index d45d94b8..b062be0d 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -105,6 +105,26 @@ class ServiceFactory ] ], ], + ServiceInterface::SERVICE_VALKEY => [ + 'image' => 'valkey', + 'pattern' => self::PATTERN_STD, + 'config' => [ + 'volumes' => [ + '/data', + ], + 'ports' => [6379], + 'sysctls' => [ + 'net.core.somaxconn' => 1024, + ], + 'ulimits' => [ + 'nproc' => 65535, + 'nofile' => [ + 'soft' => 20000, + 'hard' => 40000 + ], + ] + ], + ], ServiceInterface::SERVICE_ELASTICSEARCH => [ 'image' => 'magento/magento-cloud-docker-elasticsearch', 'pattern' => self::PATTERN_VERSIONED, diff --git a/src/Service/ServiceInterface.php b/src/Service/ServiceInterface.php index 4ee3be2b..cd23e260 100644 --- a/src/Service/ServiceInterface.php +++ b/src/Service/ServiceInterface.php @@ -23,6 +23,7 @@ interface ServiceInterface public const SERVICE_DB_SALES = 'mysql-sales'; public const SERVICE_NGINX = 'nginx'; public const SERVICE_REDIS = 'redis'; + public const SERVICE_VALKEY = 'vakey'; public const SERVICE_ELASTICSEARCH = 'elasticsearch'; public const SERVICE_OPENSEARCH = 'opensearch'; public const SERVICE_RABBITMQ = 'rabbitmq'; From 6852b24d798f4a11422241605131e86506dea876 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Tue, 10 Jun 2025 15:47:40 +0530 Subject: [PATCH 086/113] added valkey service --- src/Config/Source/CloudSource.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Config/Source/CloudSource.php b/src/Config/Source/CloudSource.php index 2d2ddc8d..39f174c6 100644 --- a/src/Config/Source/CloudSource.php +++ b/src/Config/Source/CloudSource.php @@ -47,6 +47,7 @@ class CloudSource implements SourceInterface ServiceInterface::SERVICE_ELASTICSEARCH => ['elasticsearch', 'es'], ServiceInterface::SERVICE_OPENSEARCH => ['opensearch', 'os'], ServiceInterface::SERVICE_REDIS => ['redis'], + ServiceInterface::SERVICE_VALKEY => ['valkey'], ServiceInterface::SERVICE_RABBITMQ => ['rmq', 'rabbitmq'] ]; From 1744c7f9a99e47bc011c24f70bb11e791523492f Mon Sep 17 00:00:00 2001 From: shruthi malode Date: Tue, 10 Jun 2025 16:38:40 +0530 Subject: [PATCH 087/113] opensearch:3.0 image --- images/opensearch/3.0/Dockerfile | 21 +++++++++++++++++++++ images/opensearch/3.0/docker-entrypoint.sh | 12 ++++++++++++ images/opensearch/3.0/docker-healthcheck.sh | 12 ++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 images/opensearch/3.0/Dockerfile create mode 100755 images/opensearch/3.0/docker-entrypoint.sh create mode 100644 images/opensearch/3.0/docker-healthcheck.sh diff --git a/images/opensearch/3.0/Dockerfile b/images/opensearch/3.0/Dockerfile new file mode 100644 index 00000000..0366ad98 --- /dev/null +++ b/images/opensearch/3.0/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:3.0.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/3.0/docker-entrypoint.sh b/images/opensearch/3.0/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/3.0/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/3.0/docker-healthcheck.sh b/images/opensearch/3.0/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/3.0/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 From beea29b033705f69bc74b3c91008472077e9b6fb Mon Sep 17 00:00:00 2001 From: shruthi malode Date: Wed, 11 Jun 2025 16:19:50 +0530 Subject: [PATCH 088/113] MCLOUD-13768: Test 2.4.9 with PHP 8.4 & OpenSearch 3 --- .../Acceptance/Opensearch84Cest.php | 23 +++++++++++++++++++ .../Functional/Acceptance/OpensearchCest.php | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Opensearch84Cest.php diff --git a/src/Test/Functional/Acceptance/Opensearch84Cest.php b/src/Test/Functional/Acceptance/Opensearch84Cest.php new file mode 100644 index 00000000..155424dd --- /dev/null +++ b/src/Test/Functional/Acceptance/Opensearch84Cest.php @@ -0,0 +1,23 @@ + Date: Thu, 12 Jun 2025 14:36:11 +0530 Subject: [PATCH 089/113] MCLOUD-13768: Test 2.4.9-alpha with PHP 8.4 & OpenSearch 3 --- src/Test/Functional/Acceptance/Opensearch84Cest.php | 2 +- src/Test/Functional/Acceptance/OpensearchCest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/Functional/Acceptance/Opensearch84Cest.php b/src/Test/Functional/Acceptance/Opensearch84Cest.php index 155424dd..fc89cc29 100644 --- a/src/Test/Functional/Acceptance/Opensearch84Cest.php +++ b/src/Test/Functional/Acceptance/Opensearch84Cest.php @@ -19,5 +19,5 @@ class Opensearch84Cest extends OpensearchCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.9'; + protected const TEMPLATE_VERSION = '2.4.9-alpha'; } diff --git a/src/Test/Functional/Acceptance/OpensearchCest.php b/src/Test/Functional/Acceptance/OpensearchCest.php index 64b453b8..e4333902 100644 --- a/src/Test/Functional/Acceptance/OpensearchCest.php +++ b/src/Test/Functional/Acceptance/OpensearchCest.php @@ -19,7 +19,7 @@ class OpensearchCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.9'; + protected const TEMPLATE_VERSION = '2.4.9-alpha'; /** * @param CliTester $I From 1782816ae4b3be8c94551bfbce092e34a3d8a901 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Thu, 12 Jun 2025 16:32:22 +0530 Subject: [PATCH 090/113] typo fixed --- src/Service/ServiceInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/ServiceInterface.php b/src/Service/ServiceInterface.php index cd23e260..54936094 100644 --- a/src/Service/ServiceInterface.php +++ b/src/Service/ServiceInterface.php @@ -23,7 +23,7 @@ interface ServiceInterface public const SERVICE_DB_SALES = 'mysql-sales'; public const SERVICE_NGINX = 'nginx'; public const SERVICE_REDIS = 'redis'; - public const SERVICE_VALKEY = 'vakey'; + public const SERVICE_VALKEY = 'valkey'; public const SERVICE_ELASTICSEARCH = 'elasticsearch'; public const SERVICE_OPENSEARCH = 'opensearch'; public const SERVICE_RABBITMQ = 'rabbitmq'; From 857d1361ff75605c82dd87f824ae09e3ed1440c2 Mon Sep 17 00:00:00 2001 From: andrii_shevtsov Date: Mon, 16 Jun 2025 22:49:06 -0500 Subject: [PATCH 091/113] MCLOUD-13311:set test branch for template --- src/Test/Functional/Acceptance/AcceptanceCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index 219e7c63..f776eb4c 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -17,7 +17,7 @@ class AcceptanceCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.8'; + protected const TEMPLATE_VERSION = '2.4.8-php8.3'; /** * @param \CliTester $I From c918cbc1a0b2d76c02f2202f7586b5514207ef80 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Wed, 18 Jun 2025 19:30:00 +0530 Subject: [PATCH 092/113] MCLOUD-13311: Fixed DB unhealthy issue + updated docker version to latest in AbstractCest class --- .../ProductionBuilder/Service/Database/Db/HealthCheck.php | 2 +- src/Test/Functional/Acceptance/AbstractCest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php b/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php index f3ae6cdf..60a60a0b 100644 --- a/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php +++ b/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php @@ -20,7 +20,7 @@ class HealthCheck public function getConfig(): array { return [ - 'test' => 'mysqladmin ping -h localhost -pmagento2', + 'test' => ['CMD-SHELL', 'mariadb-admin ping -h localhost -pmagento2'], 'interval' => '30s', 'timeout' => '30s', 'retries' => 3 diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index a66f8b7c..1a446852 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,9 +33,9 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.4.2'); + $I->createArtifactCurrentTestedCode('docker', '1.4.3'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.2'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.3'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( From 0f27fdd40043b3fd1148a0ded03c54855b0fd543 Mon Sep 17 00:00:00 2001 From: andrii_shevtsov Date: Wed, 18 Jun 2025 10:43:27 -0500 Subject: [PATCH 093/113] MCLOUD-13311 switch to default 2.4.8 --- src/Test/Functional/Acceptance/AcceptanceCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index f776eb4c..219e7c63 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -17,7 +17,7 @@ class AcceptanceCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.8-php8.3'; + protected const TEMPLATE_VERSION = '2.4.8'; /** * @param \CliTester $I From c7282a32c95117d08e5fc8f0baa4aa0ea2a34bda Mon Sep 17 00:00:00 2001 From: andrii_shevtsov Date: Wed, 18 Jun 2025 11:54:08 -0500 Subject: [PATCH 094/113] MCLOUD-13311 switch to custom template branch --- src/Test/Functional/Acceptance/AcceptanceCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index 219e7c63..f776eb4c 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -17,7 +17,7 @@ class AcceptanceCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.8'; + protected const TEMPLATE_VERSION = '2.4.8-php8.3'; /** * @param \CliTester $I From 55f8374529ecead7527b5340420ef1fc3e88d28a Mon Sep 17 00:00:00 2001 From: andrii_shevtsov Date: Thu, 19 Jun 2025 15:21:13 -0500 Subject: [PATCH 095/113] 13311:Remove old images --- images/php/7.4-cli/Dockerfile | 225 ----------------------- images/php/7.4-cli/bin/cloud-build | 44 ----- images/php/7.4-cli/bin/cloud-deploy | 37 ---- images/php/7.4-cli/bin/cloud-post-deploy | 11 -- images/php/7.4-cli/bin/ece-command | 7 - images/php/7.4-cli/bin/magento-command | 7 - images/php/7.4-cli/bin/magento-installer | 11 -- images/php/7.4-cli/bin/mftf-command | 7 - images/php/7.4-cli/bin/run-cron | 3 - images/php/7.4-cli/bin/run-hooks | 61 ------ images/php/7.4-cli/docker-entrypoint.sh | 35 ---- images/php/7.4-cli/etc/mail.ini | 2 - images/php/7.4-cli/etc/php-cli.ini | 10 - images/php/7.4-cli/etc/php-gnupg.ini | 1 - images/php/7.4-cli/etc/php-pcov.ini | 2 - images/php/7.4-cli/etc/php-xdebug.ini | 8 - images/php/7.4-fpm/Dockerfile | 183 ------------------ images/php/7.4-fpm/docker-entrypoint.sh | 24 --- images/php/7.4-fpm/etc/mail.ini | 2 - images/php/7.4-fpm/etc/php-fpm.conf | 25 --- images/php/7.4-fpm/etc/php-fpm.ini | 4 - images/php/7.4-fpm/etc/php-gnupg.ini | 1 - images/php/7.4-fpm/etc/php-pcov.ini | 2 - images/php/7.4-fpm/etc/php-xdebug.ini | 8 - images/php/8.0-cli/Dockerfile | 209 --------------------- images/php/8.0-cli/bin/cloud-build | 44 ----- images/php/8.0-cli/bin/cloud-deploy | 37 ---- images/php/8.0-cli/bin/cloud-post-deploy | 11 -- images/php/8.0-cli/bin/ece-command | 7 - images/php/8.0-cli/bin/magento-command | 7 - images/php/8.0-cli/bin/magento-installer | 11 -- images/php/8.0-cli/bin/mftf-command | 7 - images/php/8.0-cli/bin/run-cron | 3 - images/php/8.0-cli/bin/run-hooks | 61 ------ images/php/8.0-cli/docker-entrypoint.sh | 35 ---- images/php/8.0-cli/etc/mail.ini | 2 - images/php/8.0-cli/etc/php-cli.ini | 10 - images/php/8.0-cli/etc/php-gnupg.ini | 1 - images/php/8.0-cli/etc/php-pcov.ini | 2 - images/php/8.0-cli/etc/php-xdebug.ini | 8 - images/php/8.0-fpm/Dockerfile | 167 ----------------- images/php/8.0-fpm/docker-entrypoint.sh | 24 --- images/php/8.0-fpm/etc/mail.ini | 2 - images/php/8.0-fpm/etc/php-fpm.conf | 25 --- images/php/8.0-fpm/etc/php-fpm.ini | 4 - images/php/8.0-fpm/etc/php-gnupg.ini | 1 - images/php/8.0-fpm/etc/php-pcov.ini | 2 - images/php/8.0-fpm/etc/php-xdebug.ini | 8 - 48 files changed, 1408 deletions(-) delete mode 100644 images/php/7.4-cli/Dockerfile delete mode 100644 images/php/7.4-cli/bin/cloud-build delete mode 100644 images/php/7.4-cli/bin/cloud-deploy delete mode 100644 images/php/7.4-cli/bin/cloud-post-deploy delete mode 100644 images/php/7.4-cli/bin/ece-command delete mode 100644 images/php/7.4-cli/bin/magento-command delete mode 100644 images/php/7.4-cli/bin/magento-installer delete mode 100644 images/php/7.4-cli/bin/mftf-command delete mode 100644 images/php/7.4-cli/bin/run-cron delete mode 100644 images/php/7.4-cli/bin/run-hooks delete mode 100644 images/php/7.4-cli/docker-entrypoint.sh delete mode 100644 images/php/7.4-cli/etc/mail.ini delete mode 100644 images/php/7.4-cli/etc/php-cli.ini delete mode 100644 images/php/7.4-cli/etc/php-gnupg.ini delete mode 100644 images/php/7.4-cli/etc/php-pcov.ini delete mode 100644 images/php/7.4-cli/etc/php-xdebug.ini delete mode 100644 images/php/7.4-fpm/Dockerfile delete mode 100644 images/php/7.4-fpm/docker-entrypoint.sh delete mode 100644 images/php/7.4-fpm/etc/mail.ini delete mode 100644 images/php/7.4-fpm/etc/php-fpm.conf delete mode 100644 images/php/7.4-fpm/etc/php-fpm.ini delete mode 100644 images/php/7.4-fpm/etc/php-gnupg.ini delete mode 100644 images/php/7.4-fpm/etc/php-pcov.ini delete mode 100644 images/php/7.4-fpm/etc/php-xdebug.ini delete mode 100644 images/php/8.0-cli/Dockerfile delete mode 100644 images/php/8.0-cli/bin/cloud-build delete mode 100644 images/php/8.0-cli/bin/cloud-deploy delete mode 100644 images/php/8.0-cli/bin/cloud-post-deploy delete mode 100644 images/php/8.0-cli/bin/ece-command delete mode 100644 images/php/8.0-cli/bin/magento-command delete mode 100644 images/php/8.0-cli/bin/magento-installer delete mode 100644 images/php/8.0-cli/bin/mftf-command delete mode 100644 images/php/8.0-cli/bin/run-cron delete mode 100644 images/php/8.0-cli/bin/run-hooks delete mode 100644 images/php/8.0-cli/docker-entrypoint.sh delete mode 100644 images/php/8.0-cli/etc/mail.ini delete mode 100644 images/php/8.0-cli/etc/php-cli.ini delete mode 100644 images/php/8.0-cli/etc/php-gnupg.ini delete mode 100644 images/php/8.0-cli/etc/php-pcov.ini delete mode 100644 images/php/8.0-cli/etc/php-xdebug.ini delete mode 100644 images/php/8.0-fpm/Dockerfile delete mode 100644 images/php/8.0-fpm/docker-entrypoint.sh delete mode 100644 images/php/8.0-fpm/etc/mail.ini delete mode 100644 images/php/8.0-fpm/etc/php-fpm.conf delete mode 100644 images/php/8.0-fpm/etc/php-fpm.ini delete mode 100644 images/php/8.0-fpm/etc/php-gnupg.ini delete mode 100644 images/php/8.0-fpm/etc/php-pcov.ini delete mode 100644 images/php/8.0-fpm/etc/php-xdebug.ini diff --git a/images/php/7.4-cli/Dockerfile b/images/php/7.4-cli/Dockerfile deleted file mode 100644 index 949519b7..00000000 --- a/images/php/7.4-cli/Dockerfile +++ /dev/null @@ -1,225 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.4-cli - -ARG COMPOSER_VERSION=1.10.22 -ARG MAGENTO_ROOT=/app -ARG COMPOSER_ALLOW_SUPERUSER=1 -ARG COMPOSER_HOME=/composer -ARG CRONTAB="" - -ENV COMPOSER_MEMORY_LIMIT -1 -ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} -ENV COMPOSER_HOME ${COMPOSER_HOME} -ENV COMPOSER_CLEAR_CACHE false -ENV PHP_MEMORY_LIMIT -1 -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Configure Node.js version -RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - cron \ - git \ - mariadb-client \ - nano \ - nodejs \ - python3 \ - python3-pip \ - redis-tools \ - sendmail-bin \ - sendmail \ - sudo \ - unzip \ - vim \ - openssh-client \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml - -# Install Grunt -RUN npm install -g grunt-cli - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - opcache --enable-opcache - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini -ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -# Get composer installed to /usr/local/bin/composer -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer - -ADD bin/* /usr/local/bin/ - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -ADD docker-entrypoint.sh /docker-entrypoint.sh - -RUN ["chmod", "+x", \ - "/docker-entrypoint.sh", \ - "/usr/local/bin/magento-installer", \ - "/usr/local/bin/magento-command", \ - "/usr/local/bin/mftf-command", \ - "/usr/local/bin/ece-command", \ - "/usr/local/bin/cloud-build", \ - "/usr/local/bin/cloud-deploy", \ - "/usr/local/bin/cloud-post-deploy", \ - "/usr/local/bin/run-cron", \ - "/usr/local/bin/run-hooks" \ -] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["bash"] diff --git a/images/php/7.4-cli/bin/cloud-build b/images/php/7.4-cli/bin/cloud-build deleted file mode 100644 index bbd584c9..00000000 --- a/images/php/7.4-cli/bin/cloud-build +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -RUN_HOOKS="run-hooks" - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Cleaning directories:" - - if [ "$INSTALLATION_TYPE" == "composer" ]; then - echo "Cleaning setup directory." - rm -rf $MAGENTO_ROOT/setup/* - fi - - echo "Cleaning vendor directory." - rm -rf $MAGENTO_ROOT/vendor/* - - echo "Cleaning generated directory." - rm -rf $MAGENTO_ROOT/generated/* - - echo "Removing app/etc/env.php file" - rm -f $MAGENTO_ROOT/app/etc/env.php -fi - -echo "Installing dependencies." - -composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist - -echo "Running \"build\" hook." - -$RUN_HOOKS build - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Setting file permissions." - - chown -R www:www $MAGENTO_ROOT - - find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; - find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; -fi - -echo "Building complete." diff --git a/images/php/7.4-cli/bin/cloud-deploy b/images/php/7.4-cli/bin/cloud-deploy deleted file mode 100644 index f6b891bf..00000000 --- a/images/php/7.4-cli/bin/cloud-deploy +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"deploy\" hook." - -run-hooks deploy - -# check that Varnish exists -if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then - minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") - if [[ "$minor_magento_version" != "2.1" ]]; then - output=$(magento-command config:set system/full_page_cache/caching_application 2) - # as config:set does not return error code, we check output text to continue set varnish settings - if [[ $output == *"Value was saved"* ]]; then - echo "Setting Varnish for Magento FPC." - magento-command setup:config:set --http-cache-hosts=varnish -n - else - echo $output - fi - fi -fi - -# set developer mode if it is configured in $MAGENTO_RUN_MODE -if [ "$MAGENTO_RUN_MODE" == "developer" ]; then - output=$(magento-command deploy:mode:set developer) - if [[ $output == *"Enabled developer mode."* ]]; then - echo "Enabled developer mode." - else - echo $output - fi -fi - - -echo "Deployment finished." diff --git a/images/php/7.4-cli/bin/cloud-post-deploy b/images/php/7.4-cli/bin/cloud-post-deploy deleted file mode 100644 index f5bb3956..00000000 --- a/images/php/7.4-cli/bin/cloud-post-deploy +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"post-deploy\" hook." - -run-hooks post_deploy - -echo "Post deployment finished." diff --git a/images/php/7.4-cli/bin/ece-command b/images/php/7.4-cli/bin/ece-command deleted file mode 100644 index 36d896c5..00000000 --- a/images/php/7.4-cli/bin/ece-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" - -exec $ECE_COMMAND "$@" diff --git a/images/php/7.4-cli/bin/magento-command b/images/php/7.4-cli/bin/magento-command deleted file mode 100644 index 8d439f7d..00000000 --- a/images/php/7.4-cli/bin/magento-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" - -exec $MAGENTO_COMMAND "$@" diff --git a/images/php/7.4-cli/bin/magento-installer b/images/php/7.4-cli/bin/magento-installer deleted file mode 100644 index 73645ab7..00000000 --- a/images/php/7.4-cli/bin/magento-installer +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -BUILD_COMMAND="cloud-build" -DEPLOY_COMMAND="cloud-deploy" - -$BUILD_COMMAND -$DEPLOY_COMMAND diff --git a/images/php/7.4-cli/bin/mftf-command b/images/php/7.4-cli/bin/mftf-command deleted file mode 100644 index 88eaa1df..00000000 --- a/images/php/7.4-cli/bin/mftf-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" - -exec $MFTF_COMMAND "$@" diff --git a/images/php/7.4-cli/bin/run-cron b/images/php/7.4-cli/bin/run-cron deleted file mode 100644 index f6554a5c..00000000 --- a/images/php/7.4-cli/bin/run-cron +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/7.4-cli/bin/run-hooks b/images/php/7.4-cli/bin/run-hooks deleted file mode 100644 index 8ac215c9..00000000 --- a/images/php/7.4-cli/bin/run-hooks +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import json -import base64 - -# Disable output buffering. -os.environ['PYTHONUNBUFFERED'] = "1" - -# The list of available hooks. -available_hooks = ["build", "deploy", "post_deploy"] - - -# Prints a message and returns an exit code. -def error_exit(msg, code=1): - print(msg) - sys.exit(code) - - -# Gets Magento root path. -def get_magento_root(): - try: - return str(os.environ['MAGENTO_ROOT']) - except KeyError: - error_exit('Environment variable MAGENTO_ROOT is not available') - - -# Gets set hooks by hook name. -def get_hooks(hook_name): - try: - application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) - content = json.loads(base64.b64decode(application).decode("utf-8")) - - return content['hooks'][hook_name] - except Exception as exc: - error_exit("Cannot decode string: " + str(exc)) - - -# Main function. -def main(): - if len(sys.argv) != 2: - error_exit("Usage: run-hooks ") - - hook_name = str(sys.argv[1]) - if hook_name not in available_hooks: - error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) - - try: - subprocess.check_call( - get_hooks(hook_name), - shell=True, - cwd=get_magento_root() - ) - except subprocess.CalledProcessError as exc: - error_exit("returned non-zero exit status " + str(exc.returncode)) - - -if __name__ == '__main__': - main() diff --git a/images/php/7.4-cli/docker-entrypoint.sh b/images/php/7.4-cli/docker-entrypoint.sh deleted file mode 100644 index ee380b80..00000000 --- a/images/php/7.4-cli/docker-entrypoint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -if [ ! -z "${CRONTAB}" ]; then - echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log -fi - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Clear composer cache if needed -[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ - composer clearcache - -# Configure composer -[ ! -z "${COMPOSER_VERSION}" ] && \ - composer self-update $COMPOSER_VERSION - -[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ - composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN - -[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ - composer config --global http-basic.repo.magento.com \ - $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD - -exec "$@" diff --git a/images/php/7.4-cli/etc/mail.ini b/images/php/7.4-cli/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/7.4-cli/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/7.4-cli/etc/php-cli.ini b/images/php/7.4-cli/etc/php-cli.ini deleted file mode 100644 index dfaf04e4..00000000 --- a/images/php/7.4-cli/etc/php-cli.ini +++ /dev/null @@ -1,10 +0,0 @@ -; php.ini -memory_limit = ${PHP_MEMORY_LIMIT} -zlib.output_compression = on -realpath_cache_size = 32k -realpath_cache_ttl = 7200 -always_populate_raw_post_data = -1 -max_input_vars = 10000 -session.gc_probability = 1 -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/7.4-cli/etc/php-gnupg.ini b/images/php/7.4-cli/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/7.4-cli/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/7.4-cli/etc/php-pcov.ini b/images/php/7.4-cli/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/7.4-cli/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/7.4-cli/etc/php-xdebug.ini b/images/php/7.4-cli/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/7.4-cli/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/7.4-fpm/Dockerfile b/images/php/7.4-fpm/Dockerfile deleted file mode 100644 index 2c085a62..00000000 --- a/images/php/7.4-fpm/Dockerfile +++ /dev/null @@ -1,183 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.4-fpm - -ARG MAGENTO_ROOT=/app - -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV UPLOAD_MAX_FILESIZE 64M -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - sendmail-bin \ - sendmail \ - sudo \ - iproute2 \ - git \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - opcache --enable-opcache - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini -COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -COPY etc/php-fpm.conf /usr/local/etc/ -COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN ["chmod", "+x", "/docker-entrypoint.sh"] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["php-fpm", "-R"] diff --git a/images/php/7.4-fpm/docker-entrypoint.sh b/images/php/7.4-fpm/docker-entrypoint.sh deleted file mode 100644 index 0c8c5c9c..00000000 --- a/images/php/7.4-fpm/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Set host.docker.internal if not available -HOST_NAME="host.docker.internal" -HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") -if [[ "$HOST_IP" == "$HOST_NAME" ]]; then - HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') - printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts -fi - -exec "$@" diff --git a/images/php/7.4-fpm/etc/mail.ini b/images/php/7.4-fpm/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/7.4-fpm/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/7.4-fpm/etc/php-fpm.conf b/images/php/7.4-fpm/etc/php-fpm.conf deleted file mode 100644 index d988b314..00000000 --- a/images/php/7.4-fpm/etc/php-fpm.conf +++ /dev/null @@ -1,25 +0,0 @@ -[global] - -error_log = /proc/self/fd/2 -daemonize = no - -[www] - -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 - -listen = [::]:9000 - -pm = dynamic -pm.max_children = 10 -pm.start_servers = 4 -pm.min_spare_servers = 2 -pm.max_spare_servers = 6 -pm.status_path = /status - -clear_env = no - -env[MAGE_MODE] = $MAGENTO_RUN_MODE - -; Ensure worker stdout and stderr are sent to the main error log. -catch_workers_output = yes diff --git a/images/php/7.4-fpm/etc/php-fpm.ini b/images/php/7.4-fpm/etc/php-fpm.ini deleted file mode 100644 index 387c8aeb..00000000 --- a/images/php/7.4-fpm/etc/php-fpm.ini +++ /dev/null @@ -1,4 +0,0 @@ -memory_limit = ${PHP_MEMORY_LIMIT} -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} -user_ini.filename = diff --git a/images/php/7.4-fpm/etc/php-gnupg.ini b/images/php/7.4-fpm/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/7.4-fpm/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/7.4-fpm/etc/php-pcov.ini b/images/php/7.4-fpm/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/7.4-fpm/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/7.4-fpm/etc/php-xdebug.ini b/images/php/7.4-fpm/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/7.4-fpm/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile deleted file mode 100644 index 03ddcad2..00000000 --- a/images/php/8.0-cli/Dockerfile +++ /dev/null @@ -1,209 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:8.0.14-cli - -ARG COMPOSER_VERSION=2.2.23 -ARG MAGENTO_ROOT=/app -ARG COMPOSER_ALLOW_SUPERUSER=1 -ARG COMPOSER_HOME=/composer -ARG CRONTAB="" - -ENV COMPOSER_MEMORY_LIMIT -1 -ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} -ENV COMPOSER_HOME ${COMPOSER_HOME} -ENV COMPOSER_CLEAR_CACHE false -ENV PHP_MEMORY_LIMIT -1 -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Configure Node.js version -RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - cron \ - git \ - mariadb-client \ - nano \ - nodejs \ - python3 \ - python3-pip \ - redis-tools \ - sendmail-bin \ - sendmail \ - sudo \ - unzip \ - vim \ - openssh-client \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgmp-dev \ - libgpgme11-dev \ - libicu-dev \ - libldap2-dev \ - libpcre3-dev \ - libpspell-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml - -# Install Grunt -RUN npm install -g grunt-cli - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - opcache --enable-opcache - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - gnupg \ - mailparse \ - msgpack \ - oauth \ - pcov \ - raphf \ - redis \ - xdebug-3.1.2 \ - xmlrpc-1.0.0RC3 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium - -ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini -ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -# Get composer installed to /usr/local/bin/composer -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer - -ADD bin/* /usr/local/bin/ - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -ADD docker-entrypoint.sh /docker-entrypoint.sh - -RUN ["chmod", "+x", \ - "/docker-entrypoint.sh", \ - "/usr/local/bin/magento-installer", \ - "/usr/local/bin/magento-command", \ - "/usr/local/bin/mftf-command", \ - "/usr/local/bin/ece-command", \ - "/usr/local/bin/cloud-build", \ - "/usr/local/bin/cloud-deploy", \ - "/usr/local/bin/cloud-post-deploy", \ - "/usr/local/bin/run-cron", \ - "/usr/local/bin/run-hooks" \ -] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["bash"] diff --git a/images/php/8.0-cli/bin/cloud-build b/images/php/8.0-cli/bin/cloud-build deleted file mode 100644 index bbd584c9..00000000 --- a/images/php/8.0-cli/bin/cloud-build +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -RUN_HOOKS="run-hooks" - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Cleaning directories:" - - if [ "$INSTALLATION_TYPE" == "composer" ]; then - echo "Cleaning setup directory." - rm -rf $MAGENTO_ROOT/setup/* - fi - - echo "Cleaning vendor directory." - rm -rf $MAGENTO_ROOT/vendor/* - - echo "Cleaning generated directory." - rm -rf $MAGENTO_ROOT/generated/* - - echo "Removing app/etc/env.php file" - rm -f $MAGENTO_ROOT/app/etc/env.php -fi - -echo "Installing dependencies." - -composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist - -echo "Running \"build\" hook." - -$RUN_HOOKS build - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Setting file permissions." - - chown -R www:www $MAGENTO_ROOT - - find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; - find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; -fi - -echo "Building complete." diff --git a/images/php/8.0-cli/bin/cloud-deploy b/images/php/8.0-cli/bin/cloud-deploy deleted file mode 100644 index f6b891bf..00000000 --- a/images/php/8.0-cli/bin/cloud-deploy +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"deploy\" hook." - -run-hooks deploy - -# check that Varnish exists -if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then - minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") - if [[ "$minor_magento_version" != "2.1" ]]; then - output=$(magento-command config:set system/full_page_cache/caching_application 2) - # as config:set does not return error code, we check output text to continue set varnish settings - if [[ $output == *"Value was saved"* ]]; then - echo "Setting Varnish for Magento FPC." - magento-command setup:config:set --http-cache-hosts=varnish -n - else - echo $output - fi - fi -fi - -# set developer mode if it is configured in $MAGENTO_RUN_MODE -if [ "$MAGENTO_RUN_MODE" == "developer" ]; then - output=$(magento-command deploy:mode:set developer) - if [[ $output == *"Enabled developer mode."* ]]; then - echo "Enabled developer mode." - else - echo $output - fi -fi - - -echo "Deployment finished." diff --git a/images/php/8.0-cli/bin/cloud-post-deploy b/images/php/8.0-cli/bin/cloud-post-deploy deleted file mode 100644 index f5bb3956..00000000 --- a/images/php/8.0-cli/bin/cloud-post-deploy +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"post-deploy\" hook." - -run-hooks post_deploy - -echo "Post deployment finished." diff --git a/images/php/8.0-cli/bin/ece-command b/images/php/8.0-cli/bin/ece-command deleted file mode 100644 index 36d896c5..00000000 --- a/images/php/8.0-cli/bin/ece-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" - -exec $ECE_COMMAND "$@" diff --git a/images/php/8.0-cli/bin/magento-command b/images/php/8.0-cli/bin/magento-command deleted file mode 100644 index 8d439f7d..00000000 --- a/images/php/8.0-cli/bin/magento-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" - -exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.0-cli/bin/magento-installer b/images/php/8.0-cli/bin/magento-installer deleted file mode 100644 index 73645ab7..00000000 --- a/images/php/8.0-cli/bin/magento-installer +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -BUILD_COMMAND="cloud-build" -DEPLOY_COMMAND="cloud-deploy" - -$BUILD_COMMAND -$DEPLOY_COMMAND diff --git a/images/php/8.0-cli/bin/mftf-command b/images/php/8.0-cli/bin/mftf-command deleted file mode 100644 index 88eaa1df..00000000 --- a/images/php/8.0-cli/bin/mftf-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" - -exec $MFTF_COMMAND "$@" diff --git a/images/php/8.0-cli/bin/run-cron b/images/php/8.0-cli/bin/run-cron deleted file mode 100644 index f6554a5c..00000000 --- a/images/php/8.0-cli/bin/run-cron +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.0-cli/bin/run-hooks b/images/php/8.0-cli/bin/run-hooks deleted file mode 100644 index 8ac215c9..00000000 --- a/images/php/8.0-cli/bin/run-hooks +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import json -import base64 - -# Disable output buffering. -os.environ['PYTHONUNBUFFERED'] = "1" - -# The list of available hooks. -available_hooks = ["build", "deploy", "post_deploy"] - - -# Prints a message and returns an exit code. -def error_exit(msg, code=1): - print(msg) - sys.exit(code) - - -# Gets Magento root path. -def get_magento_root(): - try: - return str(os.environ['MAGENTO_ROOT']) - except KeyError: - error_exit('Environment variable MAGENTO_ROOT is not available') - - -# Gets set hooks by hook name. -def get_hooks(hook_name): - try: - application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) - content = json.loads(base64.b64decode(application).decode("utf-8")) - - return content['hooks'][hook_name] - except Exception as exc: - error_exit("Cannot decode string: " + str(exc)) - - -# Main function. -def main(): - if len(sys.argv) != 2: - error_exit("Usage: run-hooks ") - - hook_name = str(sys.argv[1]) - if hook_name not in available_hooks: - error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) - - try: - subprocess.check_call( - get_hooks(hook_name), - shell=True, - cwd=get_magento_root() - ) - except subprocess.CalledProcessError as exc: - error_exit("returned non-zero exit status " + str(exc.returncode)) - - -if __name__ == '__main__': - main() diff --git a/images/php/8.0-cli/docker-entrypoint.sh b/images/php/8.0-cli/docker-entrypoint.sh deleted file mode 100644 index ee380b80..00000000 --- a/images/php/8.0-cli/docker-entrypoint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -if [ ! -z "${CRONTAB}" ]; then - echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log -fi - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Clear composer cache if needed -[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ - composer clearcache - -# Configure composer -[ ! -z "${COMPOSER_VERSION}" ] && \ - composer self-update $COMPOSER_VERSION - -[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ - composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN - -[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ - composer config --global http-basic.repo.magento.com \ - $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD - -exec "$@" diff --git a/images/php/8.0-cli/etc/mail.ini b/images/php/8.0-cli/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/8.0-cli/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.0-cli/etc/php-cli.ini b/images/php/8.0-cli/etc/php-cli.ini deleted file mode 100644 index dfaf04e4..00000000 --- a/images/php/8.0-cli/etc/php-cli.ini +++ /dev/null @@ -1,10 +0,0 @@ -; php.ini -memory_limit = ${PHP_MEMORY_LIMIT} -zlib.output_compression = on -realpath_cache_size = 32k -realpath_cache_ttl = 7200 -always_populate_raw_post_data = -1 -max_input_vars = 10000 -session.gc_probability = 1 -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/8.0-cli/etc/php-gnupg.ini b/images/php/8.0-cli/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/8.0-cli/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/8.0-cli/etc/php-pcov.ini b/images/php/8.0-cli/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/8.0-cli/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.0-cli/etc/php-xdebug.ini b/images/php/8.0-cli/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/8.0-cli/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/8.0-fpm/Dockerfile b/images/php/8.0-fpm/Dockerfile deleted file mode 100644 index c97994d6..00000000 --- a/images/php/8.0-fpm/Dockerfile +++ /dev/null @@ -1,167 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:8.0.14-fpm - -ARG MAGENTO_ROOT=/app - -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV UPLOAD_MAX_FILESIZE 64M -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - sendmail-bin \ - sendmail \ - sudo \ - iproute2 \ - git \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgmp-dev \ - libgpgme11-dev \ - libicu-dev \ - libldap2-dev \ - libpcre3-dev \ - libpspell-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - opcache --enable-opcache - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - gnupg \ - mailparse \ - msgpack \ - oauth \ - pcov \ - raphf \ - redis \ - xdebug-3.1.2 \ - xmlrpc-1.0.0RC3 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium - -COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini -COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -COPY etc/php-fpm.conf /usr/local/etc/ -COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN ["chmod", "+x", "/docker-entrypoint.sh"] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["php-fpm", "-R"] diff --git a/images/php/8.0-fpm/docker-entrypoint.sh b/images/php/8.0-fpm/docker-entrypoint.sh deleted file mode 100644 index 0c8c5c9c..00000000 --- a/images/php/8.0-fpm/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Set host.docker.internal if not available -HOST_NAME="host.docker.internal" -HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") -if [[ "$HOST_IP" == "$HOST_NAME" ]]; then - HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') - printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts -fi - -exec "$@" diff --git a/images/php/8.0-fpm/etc/mail.ini b/images/php/8.0-fpm/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/8.0-fpm/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.0-fpm/etc/php-fpm.conf b/images/php/8.0-fpm/etc/php-fpm.conf deleted file mode 100644 index d988b314..00000000 --- a/images/php/8.0-fpm/etc/php-fpm.conf +++ /dev/null @@ -1,25 +0,0 @@ -[global] - -error_log = /proc/self/fd/2 -daemonize = no - -[www] - -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 - -listen = [::]:9000 - -pm = dynamic -pm.max_children = 10 -pm.start_servers = 4 -pm.min_spare_servers = 2 -pm.max_spare_servers = 6 -pm.status_path = /status - -clear_env = no - -env[MAGE_MODE] = $MAGENTO_RUN_MODE - -; Ensure worker stdout and stderr are sent to the main error log. -catch_workers_output = yes diff --git a/images/php/8.0-fpm/etc/php-fpm.ini b/images/php/8.0-fpm/etc/php-fpm.ini deleted file mode 100644 index 387c8aeb..00000000 --- a/images/php/8.0-fpm/etc/php-fpm.ini +++ /dev/null @@ -1,4 +0,0 @@ -memory_limit = ${PHP_MEMORY_LIMIT} -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} -user_ini.filename = diff --git a/images/php/8.0-fpm/etc/php-gnupg.ini b/images/php/8.0-fpm/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/8.0-fpm/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/8.0-fpm/etc/php-pcov.ini b/images/php/8.0-fpm/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/8.0-fpm/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.0-fpm/etc/php-xdebug.ini b/images/php/8.0-fpm/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/8.0-fpm/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM From 9462a2083c5a9112853c420014d882c76d7e01f5 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Fri, 20 Jun 2025 15:06:26 +0530 Subject: [PATCH 096/113] updated service name --- src/Config/Source/CliSource.php | 2 +- src/Config/Source/CloudSource.php | 2 +- src/Service/ServiceFactory.php | 2 +- src/Service/ServiceInterface.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Config/Source/CliSource.php b/src/Config/Source/CliSource.php index 58acfdbf..101cf4b8 100644 --- a/src/Config/Source/CliSource.php +++ b/src/Config/Source/CliSource.php @@ -27,7 +27,7 @@ class CliSource implements SourceInterface public const OPTION_EXPOSE_DB_QUOTE_PORT = 'expose-db-quote-port'; public const OPTION_EXPOSE_DB_SALES_PORT = 'expose-db-sales-port'; public const OPTION_REDIS = 'redis'; - public const OPTION_VALKEY = 'valkey'; + public const OPTION_VALKEY = 'cache'; public const OPTION_ES = 'es'; public const OPTION_OS = 'os'; public const OPTION_RABBIT_MQ = 'rmq'; diff --git a/src/Config/Source/CloudSource.php b/src/Config/Source/CloudSource.php index 39f174c6..6b39885e 100644 --- a/src/Config/Source/CloudSource.php +++ b/src/Config/Source/CloudSource.php @@ -47,7 +47,7 @@ class CloudSource implements SourceInterface ServiceInterface::SERVICE_ELASTICSEARCH => ['elasticsearch', 'es'], ServiceInterface::SERVICE_OPENSEARCH => ['opensearch', 'os'], ServiceInterface::SERVICE_REDIS => ['redis'], - ServiceInterface::SERVICE_VALKEY => ['valkey'], + ServiceInterface::SERVICE_VALKEY => ['cache'], ServiceInterface::SERVICE_RABBITMQ => ['rmq', 'rabbitmq'] ]; diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index b062be0d..119fcc51 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -106,7 +106,7 @@ class ServiceFactory ], ], ServiceInterface::SERVICE_VALKEY => [ - 'image' => 'valkey', + 'image' => 'valkey/valkey', 'pattern' => self::PATTERN_STD, 'config' => [ 'volumes' => [ diff --git a/src/Service/ServiceInterface.php b/src/Service/ServiceInterface.php index 54936094..b93b11b1 100644 --- a/src/Service/ServiceInterface.php +++ b/src/Service/ServiceInterface.php @@ -23,7 +23,7 @@ interface ServiceInterface public const SERVICE_DB_SALES = 'mysql-sales'; public const SERVICE_NGINX = 'nginx'; public const SERVICE_REDIS = 'redis'; - public const SERVICE_VALKEY = 'valkey'; + public const SERVICE_VALKEY = 'cache'; public const SERVICE_ELASTICSEARCH = 'elasticsearch'; public const SERVICE_OPENSEARCH = 'opensearch'; public const SERVICE_RABBITMQ = 'rabbitmq'; From 0d2d01ff8005f48ae66b4714d6d7786164061f8f Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Wed, 25 Jun 2025 17:20:47 +0530 Subject: [PATCH 097/113] MCLOUD-13311: Added health check fix for Integration test & fixed composer test class --- src/Test/Integration/BuildComposeTest.php | 4 ++-- src/Test/Integration/_files/cloud_base/docker-compose.exp.yml | 4 +++- .../_files/cloud_base_developer/docker-compose.exp.yml | 4 +++- .../_files/cloud_base_developer_manual/docker-compose.exp.yml | 4 +++- .../Integration/_files/cloud_base_mftf/docker-compose.exp.yml | 4 +++- .../_files/cloud_base_os_2.3_cli/docker-compose.exp.yml | 4 +++- .../_files/cloud_base_os_2_cli/docker-compose.exp.yml | 4 +++- .../Integration/_files/cloud_base_test/docker-compose.exp.yml | 4 +++- .../docker-compose.exp.yml | 4 +++- .../docker-compose.exp.yml | 4 +++- .../docker-compose.exp.yml | 4 +++- .../_files/cloud_no_tls_service/docker-compose.exp.yml | 4 +++- .../cloud_no_varnish_and_tls_service/docker-compose.exp.yml | 4 +++- .../_files/cloud_no_varnish_service/docker-compose.exp.yml | 4 +++- .../_files/custom_cloud_base/docker-compose.exp.yml | 4 +++- .../_files/custom_cloud_base_native/docker-compose.exp.yml | 4 +++- .../_files/custom_cloud_custom_images/docker-compose.exp.yml | 4 +++- .../_files/custom_cloud_no_tls_service/docker-compose.exp.yml | 4 +++- .../docker-compose.exp.yml | 4 +++- .../custom_cloud_no_varnish_service/docker-compose.exp.yml | 4 +++- .../Integration/_files/custom_registry/docker-compose.exp.yml | 4 +++- 21 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/Test/Integration/BuildComposeTest.php b/src/Test/Integration/BuildComposeTest.php index 1d07abab..e2501ac9 100644 --- a/src/Test/Integration/BuildComposeTest.php +++ b/src/Test/Integration/BuildComposeTest.php @@ -51,12 +51,12 @@ public function testBuild(string $directory, array $options): void ); /** @var MockObject|InputInterface $inputMock */ - $inputMock = $this->getMockForAbstractClass(InputInterface::class); + $inputMock = $this->createMock(InputInterface::class); $inputMock->method('getOption') ->willReturnMap($options); /** @var MockObject|OutputInterface $outputMock */ - $outputMock = $this->getMockForAbstractClass(OutputInterface::class); + $outputMock = $this->createMock(OutputInterface::class); $command->execute($inputMock, $outputMock); diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index 74dfdd7f..3e64a489 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index 74a84bf7..392942a8 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - '.docker/mysql/mariadb.conf.d:/etc/mysql/mariadb.conf.d' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index 54c717fd..32990f6e 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - 'magento-app:/app' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index e25a911e..c73c204e 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml index d3cf9d96..a6fb654a 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml index 8b774054..485a2a8d 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index 93cc628a..8f6e09d6 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'mymagento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index 79de8db1..d84556fe 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'mymagento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index 8c3eacb0..dabb4e45 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'mymagento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index 54f88c2d..1b57b564 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'mymagento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index 6c22ca4f..997ea5db 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index 945b3ed5..11547a9d 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index 427a05e9..c7829271 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index f281d22e..b83c1ae0 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index f281d22e..b83c1ae0 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml index e06213a8..f94d3d8a 100644 --- a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index a4075782..e52b4d7e 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml index 04141e68..756a1cc6 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml index 0b086bc0..a8f578ad 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index 6fa9e929..17a34bab 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - 'mariadb-admin ping -h localhost -pmagento2' interval: 30s timeout: 30s retries: 3 From 572df9a7afd5f3353d062abe0cb96a7229c9c336 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Thu, 26 Jun 2025 18:15:17 +0530 Subject: [PATCH 098/113] valkey changes for correct service config --- .../ProductionBuilder/Service/Valkey.php | 34 ++++++++++++------- src/Config/Relationship.php | 2 +- src/Config/Source/CliSource.php | 2 +- src/Config/Source/CloudSource.php | 2 +- src/Service/ServiceInterface.php | 2 +- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/Compose/ProductionBuilder/Service/Valkey.php b/src/Compose/ProductionBuilder/Service/Valkey.php index a9263178..da6d9705 100644 --- a/src/Compose/ProductionBuilder/Service/Valkey.php +++ b/src/Compose/ProductionBuilder/Service/Valkey.php @@ -50,22 +50,30 @@ public function getServiceName(): string * @inheritDoc */ public function getConfig(Config $config): array - { - return $this->serviceFactory->create( - $this->getServiceName(), - $config->getServiceVersion($this->getServiceName()), - [ + { + $configArray = $this->serviceFactory->create( + $this->getServiceName(), + $config->getServiceVersion($this->getServiceName()), + [ BuilderInterface::SERVICE_HEALTHCHECK => [ - 'test' => 'valkey-cli ping || exit 1', - 'interval' => '30s', - 'timeout' => '30s', - 'retries' => 3 + 'test' => 'valkey-cli ping || exit 1', + 'interval' => '30s', + 'timeout' => '30s', + 'retries' => 3 ] - ], - $config->getServiceImage($this->getServiceName()), - $config->getCustomRegistry() + ], + $config->getServiceImage($this->getServiceName()), + $config->getCustomRegistry() ); - } + + // Set both 'cache' and 'valkey.magento2.docker' as aliases unconditionally + $configArray['networks'][BuilderInterface::NETWORK_MAGENTO]['aliases'] = [ + 'cache', + 'valkey.magento2.docker' + ]; + + return $configArray; + } /** * @inheritDoc diff --git a/src/Config/Relationship.php b/src/Config/Relationship.php index 6464ff81..c22e4c3e 100644 --- a/src/Config/Relationship.php +++ b/src/Config/Relationship.php @@ -57,7 +57,7 @@ class Relationship ], 'valkey' => [ [ - 'host' => 'valkey', + 'host' => 'cache', 'port' => '6379' ] ], diff --git a/src/Config/Source/CliSource.php b/src/Config/Source/CliSource.php index 101cf4b8..58acfdbf 100644 --- a/src/Config/Source/CliSource.php +++ b/src/Config/Source/CliSource.php @@ -27,7 +27,7 @@ class CliSource implements SourceInterface public const OPTION_EXPOSE_DB_QUOTE_PORT = 'expose-db-quote-port'; public const OPTION_EXPOSE_DB_SALES_PORT = 'expose-db-sales-port'; public const OPTION_REDIS = 'redis'; - public const OPTION_VALKEY = 'cache'; + public const OPTION_VALKEY = 'valkey'; public const OPTION_ES = 'es'; public const OPTION_OS = 'os'; public const OPTION_RABBIT_MQ = 'rmq'; diff --git a/src/Config/Source/CloudSource.php b/src/Config/Source/CloudSource.php index 6b39885e..2e9e3712 100644 --- a/src/Config/Source/CloudSource.php +++ b/src/Config/Source/CloudSource.php @@ -47,7 +47,7 @@ class CloudSource implements SourceInterface ServiceInterface::SERVICE_ELASTICSEARCH => ['elasticsearch', 'es'], ServiceInterface::SERVICE_OPENSEARCH => ['opensearch', 'os'], ServiceInterface::SERVICE_REDIS => ['redis'], - ServiceInterface::SERVICE_VALKEY => ['cache'], + ServiceInterface::SERVICE_VALKEY => ['cache','valkey'], ServiceInterface::SERVICE_RABBITMQ => ['rmq', 'rabbitmq'] ]; diff --git a/src/Service/ServiceInterface.php b/src/Service/ServiceInterface.php index b93b11b1..54936094 100644 --- a/src/Service/ServiceInterface.php +++ b/src/Service/ServiceInterface.php @@ -23,7 +23,7 @@ interface ServiceInterface public const SERVICE_DB_SALES = 'mysql-sales'; public const SERVICE_NGINX = 'nginx'; public const SERVICE_REDIS = 'redis'; - public const SERVICE_VALKEY = 'cache'; + public const SERVICE_VALKEY = 'valkey'; public const SERVICE_ELASTICSEARCH = 'elasticsearch'; public const SERVICE_OPENSEARCH = 'opensearch'; public const SERVICE_RABBITMQ = 'rabbitmq'; From efdc1d60e2249c7f76b910a729d94a6e5216e920 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Thu, 26 Jun 2025 19:36:50 +0530 Subject: [PATCH 099/113] MCLOUD-13843: Fixed FTP ext dynamically add in docker-compose.yml file --- src/Compose/Php/ExtensionResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 43ad5d0e..f9a82d0e 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -63,7 +63,7 @@ class ExtensionResolver 'dom' => '>=7.0', 'fileinfo' => '>=7.0', 'filter' => '>=7.0', - 'ftp' => '>=7.0', + 'ftp' => '>=7.0 <8.2', 'hash' => '>=7.0', 'iconv' => '>=7.0', 'json' => '>=7.0', From 9df427aab3742ba1deb5312d95625fd692d57ad8 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Thu, 3 Jul 2025 16:22:33 +0530 Subject: [PATCH 100/113] unit test fixes --- src/Test/Unit/Config/RelationshipTest.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Test/Unit/Config/RelationshipTest.php b/src/Test/Unit/Config/RelationshipTest.php index e4a18f2a..7def0faf 100644 --- a/src/Test/Unit/Config/RelationshipTest.php +++ b/src/Test/Unit/Config/RelationshipTest.php @@ -46,6 +46,12 @@ class RelationshipTest extends TestCase 'port' => '6379' ] ], + 'valkey' => [ + [ + 'host' => 'cache', + 'port' => '6379' + ] + ], 'elasticsearch' => [ [ 'host' => 'elasticsearch', @@ -90,6 +96,7 @@ public function testGet() { $mysqlVersion = '10.4'; $redisVersion = '5.2'; + $valkeyVersion = '8.0'; $esVersion = '7.7'; $osVersion = '1.1'; $rmqVersion = '3.5'; @@ -97,12 +104,13 @@ public function testGet() $configWithType = $this->defaultConfigs; $configWithType['database'][0]['type'] = "mysql:$mysqlVersion"; $configWithType['redis'][0]['type'] = "redis:$redisVersion"; + $configWithType['valkey'][0]['type'] = "valkey:$valkeyVersion"; $configWithType['elasticsearch'][0]['type'] = "elasticsearch:$esVersion"; $configWithType['opensearch'][0]['type'] = "opensearch:$osVersion"; $configWithType['rabbitmq'][0]['type'] = "rabbitmq:$rmqVersion"; $configWithType['zookeeper'][0]['type'] = "zookeeper:$zookeeperVersion"; - $this->configMock->expects($this->exactly(8)) + $this->configMock->expects($this->exactly(9)) ->method('hasServiceEnabled') ->willReturnCallback(function ($service) { static $services = [ @@ -110,6 +118,7 @@ public function testGet() ServiceInterface::SERVICE_DB_QUOTE, ServiceInterface::SERVICE_DB_SALES, 'redis', + 'valkey', 'elasticsearch', 'opensearch', 'rabbitmq', @@ -124,6 +133,7 @@ public function testGet() true, true, true, + true, true ]; @@ -138,6 +148,7 @@ public function testGet() $services = [ ServiceInterface::SERVICE_DB, 'redis', + 'valkey', 'elasticsearch', 'opensearch', 'rabbitmq', @@ -147,13 +158,14 @@ public function testGet() $versions = [ $mysqlVersion, $redisVersion, + $valkeyVersion, $esVersion, $osVersion, $rmqVersion, $zookeeperVersion ]; - $this->configMock->expects($this->exactly(6)) + $this->configMock->expects($this->exactly(7)) ->method('getServiceVersion') ->willReturnCallback(function ($service) use ( &$services, From c5e37d9a47f8231f93b639a5b20a449575e79570 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Thu, 3 Jul 2025 16:43:21 +0530 Subject: [PATCH 101/113] phpcs fixes --- src/Compose/ProductionBuilder/Service/Valkey.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Compose/ProductionBuilder/Service/Valkey.php b/src/Compose/ProductionBuilder/Service/Valkey.php index da6d9705..150a54d8 100644 --- a/src/Compose/ProductionBuilder/Service/Valkey.php +++ b/src/Compose/ProductionBuilder/Service/Valkey.php @@ -50,20 +50,20 @@ public function getServiceName(): string * @inheritDoc */ public function getConfig(Config $config): array - { + { $configArray = $this->serviceFactory->create( - $this->getServiceName(), - $config->getServiceVersion($this->getServiceName()), - [ + $this->getServiceName(), + $config->getServiceVersion($this->getServiceName()), + [ BuilderInterface::SERVICE_HEALTHCHECK => [ 'test' => 'valkey-cli ping || exit 1', 'interval' => '30s', 'timeout' => '30s', 'retries' => 3 ] - ], - $config->getServiceImage($this->getServiceName()), - $config->getCustomRegistry() + ], + $config->getServiceImage($this->getServiceName()), + $config->getCustomRegistry() ); // Set both 'cache' and 'valkey.magento2.docker' as aliases unconditionally @@ -73,7 +73,7 @@ public function getConfig(Config $config): array ]; return $configArray; - } + } /** * @inheritDoc From 7fb5e196bca140eb10c3ec6b7492338f5614e731 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Thu, 3 Jul 2025 18:00:35 +0530 Subject: [PATCH 102/113] added test for Valkey service --- .../Functional/Acceptance/Valkey82Cest.php | 19 +++ .../Functional/Acceptance/Valkey83Cest.php | 19 +++ .../Functional/Acceptance/Valkey84Cest.php | 19 +++ src/Test/Functional/Acceptance/ValkeyCest.php | 123 ++++++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 src/Test/Functional/Acceptance/Valkey82Cest.php create mode 100644 src/Test/Functional/Acceptance/Valkey83Cest.php create mode 100644 src/Test/Functional/Acceptance/Valkey84Cest.php create mode 100644 src/Test/Functional/Acceptance/ValkeyCest.php diff --git a/src/Test/Functional/Acceptance/Valkey82Cest.php b/src/Test/Functional/Acceptance/Valkey82Cest.php new file mode 100644 index 00000000..40bffdbf --- /dev/null +++ b/src/Test/Functional/Acceptance/Valkey82Cest.php @@ -0,0 +1,19 @@ +generateDockerCompose($this->buildCommand($data)); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + + // Test that Valkey is running + $I->runDockerComposeCommand('exec -T valkey ps aux | grep valkey'); + $I->seeInOutput('valkey-server'); + + // Test Valkey connectivity using valkey-cli + $I->runDockerComposeCommand('exec -T valkey valkey-cli ping'); + $I->seeInOutput('PONG'); + + // Test that Valkey is accessible through cache alias + $I->runDockerComposeCommand('exec -T fpm valkey-cli -h cache ping'); + $I->seeInOutput('PONG'); + + // Test that Valkey is accessible through valkey.magento2.docker alias + $I->runDockerComposeCommand('exec -T fpm valkey-cli -h valkey.magento2.docker ping'); + $I->seeInOutput('PONG'); + + // Test basic Valkey functionality + $I->runDockerComposeCommand('exec -T valkey valkey-cli set test_key "test_value"'); + $I->seeInOutput('OK'); + + $I->runDockerComposeCommand('exec -T valkey valkey-cli get test_key'); + $I->seeInOutput('test_value'); + + // Test Valkey info command to verify version + $I->runDockerComposeCommand('exec -T valkey valkey-cli info server'); + $I->seeInOutput('valkey_version:' . $data['version']); + + // Test that Valkey is running on the expected port + $I->runDockerComposeCommand('exec -T valkey netstat -tlnp | grep 6379'); + $I->seeInOutput('6379'); + + // Test memory usage reporting + $I->runDockerComposeCommand('exec -T valkey valkey-cli info memory'); + $I->seeInOutput('used_memory:'); + $I->seeInOutput('used_memory_human:'); + + // Test health check functionality + $I->runDockerComposeCommand('exec -T valkey valkey-cli ping'); + $I->seeInOutput('PONG'); + + // Test data persistence + $I->runDockerComposeCommand('exec -T valkey valkey-cli set persistent_key "persistent_value"'); + $I->seeInOutput('OK'); + + $I->runDockerComposeCommand('exec -T valkey valkey-cli get persistent_key'); + $I->seeInOutput('persistent_value'); + + // Test database operations + $I->runDockerComposeCommand('exec -T valkey valkey-cli dbsize'); + $I->seeInOutput('2'); // We should have 2 keys: test_key and persistent_key + + // Test that Valkey configuration is accessible + $I->runDockerComposeCommand('exec -T valkey valkey-cli config get save'); + $I->seeInOutput('save'); + } + + /** + * Builds build:compose command from given test data + * + * @param Example $data + * @return string + */ + private function buildCommand(Example $data): string + { + $command = sprintf( + '--mode=production --valkey=%s --no-es --no-os', + $data['version'] + ); + + return $command; + } + + /** + * @return array + */ + protected function dataProvider(): array + { + return [ + [ + 'version' => '8.0', + ], + [ + 'version' => '7.2', + ], + ]; + } +} \ No newline at end of file From ce44b7aaa0718f92015a8ed3c4a4a208e003d629 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Fri, 4 Jul 2025 14:07:19 +0530 Subject: [PATCH 103/113] updated test --- .../Functional/Acceptance/Valkey82Cest.php | 19 ------------------- .../Functional/Acceptance/Valkey83Cest.php | 19 ------------------- .../Functional/Acceptance/Valkey84Cest.php | 2 +- src/Test/Functional/Acceptance/ValkeyCest.php | 3 --- 4 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 src/Test/Functional/Acceptance/Valkey82Cest.php delete mode 100644 src/Test/Functional/Acceptance/Valkey83Cest.php diff --git a/src/Test/Functional/Acceptance/Valkey82Cest.php b/src/Test/Functional/Acceptance/Valkey82Cest.php deleted file mode 100644 index 40bffdbf..00000000 --- a/src/Test/Functional/Acceptance/Valkey82Cest.php +++ /dev/null @@ -1,19 +0,0 @@ - '8.0', ], - [ - 'version' => '7.2', - ], ]; } } \ No newline at end of file From 1f38b965770396cc03c92c957eabdc7f2ee664db Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Fri, 4 Jul 2025 18:16:59 +0530 Subject: [PATCH 104/113] MCLOUD-13766: Fixed docker file to support both platform images - linux/arm64 and linux/amd64 --- images/opensearch/1.3/Dockerfile | 6 ------ images/opensearch/2.12/Dockerfile | 6 ------ images/opensearch/2.3/Dockerfile | 6 ------ images/opensearch/2.4/Dockerfile | 6 ------ images/opensearch/2.5/Dockerfile | 6 ------ images/opensearch/3.0/Dockerfile | 6 ------ 6 files changed, 36 deletions(-) diff --git a/images/opensearch/1.3/Dockerfile b/images/opensearch/1.3/Dockerfile index ee27282e..66ea8c91 100644 --- a/images/opensearch/1.3/Dockerfile +++ b/images/opensearch/1.3/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:1.3.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.12/Dockerfile b/images/opensearch/2.12/Dockerfile index 976c19fd..613d3c58 100644 --- a/images/opensearch/2.12/Dockerfile +++ b/images/opensearch/2.12/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.12.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.3/Dockerfile b/images/opensearch/2.3/Dockerfile index 1f52e728..cbdac08a 100644 --- a/images/opensearch/2.3/Dockerfile +++ b/images/opensearch/2.3/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.3.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.4/Dockerfile b/images/opensearch/2.4/Dockerfile index b38adc78..945c59a8 100644 --- a/images/opensearch/2.4/Dockerfile +++ b/images/opensearch/2.4/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.4.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.5/Dockerfile b/images/opensearch/2.5/Dockerfile index a1b197fa..fbf3067c 100644 --- a/images/opensearch/2.5/Dockerfile +++ b/images/opensearch/2.5/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.5.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/3.0/Dockerfile b/images/opensearch/3.0/Dockerfile index 0366ad98..2b2e876b 100644 --- a/images/opensearch/3.0/Dockerfile +++ b/images/opensearch/3.0/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:3.0.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ From 52bc0c243ca228bd4f8d5f8ba578e4f6570d1a75 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Mon, 7 Jul 2025 16:26:40 +0530 Subject: [PATCH 105/113] valkey test fixed --- src/Command/BuildCompose.php | 10 +++++++ src/Config/Source/CliSource.php | 4 +++ src/Test/Functional/Acceptance/ValkeyCest.php | 27 +++++++++---------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/Command/BuildCompose.php b/src/Command/BuildCompose.php index e06a86a9..1dca9c56 100644 --- a/src/Command/BuildCompose.php +++ b/src/Command/BuildCompose.php @@ -193,6 +193,16 @@ protected function configure(): void null, InputOption::VALUE_NONE, 'Disable Opensearch' + )->addOption( + Source\CliSource::OPTION_NO_REDIS, + null, + InputOption::VALUE_NONE, + 'Disable Redis' + )->addOption( + Source\CliSource::OPTION_NO_DB, + null, + InputOption::VALUE_NONE, + 'Disable Database' )->addOption( Source\CliSource::OPTION_NO_MAILHOG, null, diff --git a/src/Config/Source/CliSource.php b/src/Config/Source/CliSource.php index 58acfdbf..1d2d8e6b 100644 --- a/src/Config/Source/CliSource.php +++ b/src/Config/Source/CliSource.php @@ -38,6 +38,8 @@ class CliSource implements SourceInterface public const OPTION_INSTALLATION_TYPE = 'installation-type'; public const OPTION_NO_ES = 'no-es'; public const OPTION_NO_OS = 'no-os'; + public const OPTION_NO_REDIS = 'no-redis'; + public const OPTION_NO_DB = 'no-db'; public const OPTION_NO_MAILHOG = 'no-mailhog'; public const OPTION_NO_TLS = 'no-tls'; @@ -150,6 +152,8 @@ class CliSource implements SourceInterface private static $disableOptionsMap = [ self::OPTION_NO_ES => self::SERVICES_ES, self::OPTION_NO_OS => self::SERVICES_OS, + self::OPTION_NO_REDIS => self::SERVICES_REDIS, + self::OPTION_NO_DB => self::SERVICES_DB, self::OPTION_NO_MAILHOG => self::SERVICES_MAILHOG, self::OPTION_NO_TLS => self::SERVICES_TLS, ]; diff --git a/src/Test/Functional/Acceptance/ValkeyCest.php b/src/Test/Functional/Acceptance/ValkeyCest.php index d492715c..ba27404b 100644 --- a/src/Test/Functional/Acceptance/ValkeyCest.php +++ b/src/Test/Functional/Acceptance/ValkeyCest.php @@ -34,21 +34,22 @@ public function testValkey(CliTester $I, Example $data) $I->replaceImagesWithCustom(); $I->startEnvironment(); - // Test that Valkey is running - $I->runDockerComposeCommand('exec -T valkey ps aux | grep valkey'); - $I->seeInOutput('valkey-server'); - - // Test Valkey connectivity using valkey-cli + // Test Valkey connectivity (this also confirms it's running) $I->runDockerComposeCommand('exec -T valkey valkey-cli ping'); $I->seeInOutput('PONG'); - // Test that Valkey is accessible through cache alias - $I->runDockerComposeCommand('exec -T fpm valkey-cli -h cache ping'); - $I->seeInOutput('PONG'); + // Test that Valkey container is running and healthy + $I->runDockerComposeCommand('ps'); + $I->seeInOutput('valkey'); + $I->seeInOutput('(healthy)'); + + // Test that Valkey is accessible through cache alias (using nc to test network connectivity) + $I->runDockerComposeCommand('exec -T fpm nc -z cache 6379'); + $I->seeInOutput(''); // nc returns empty output on success // Test that Valkey is accessible through valkey.magento2.docker alias - $I->runDockerComposeCommand('exec -T fpm valkey-cli -h valkey.magento2.docker ping'); - $I->seeInOutput('PONG'); + $I->runDockerComposeCommand('exec -T fpm nc -z valkey.magento2.docker 6379'); + $I->seeInOutput(''); // Test basic Valkey functionality $I->runDockerComposeCommand('exec -T valkey valkey-cli set test_key "test_value"'); @@ -61,9 +62,7 @@ public function testValkey(CliTester $I, Example $data) $I->runDockerComposeCommand('exec -T valkey valkey-cli info server'); $I->seeInOutput('valkey_version:' . $data['version']); - // Test that Valkey is running on the expected port - $I->runDockerComposeCommand('exec -T valkey netstat -tlnp | grep 6379'); - $I->seeInOutput('6379'); + // Test confirmed: Valkey is accessible on port 6379 (validated via info command above) // Test memory usage reporting $I->runDockerComposeCommand('exec -T valkey valkey-cli info memory'); @@ -99,7 +98,7 @@ public function testValkey(CliTester $I, Example $data) private function buildCommand(Example $data): string { $command = sprintf( - '--mode=production --valkey=%s --no-es --no-os', + '--mode=production --valkey=%s --no-es --no-os --no-redis', $data['version'] ); From 113b85d46a43619dc471f8673cc2440cc455a079 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Mon, 7 Jul 2025 18:24:30 +0530 Subject: [PATCH 106/113] valkey test fixed --- src/Test/Functional/Acceptance/AbstractCest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index dc491f14..a66f8b7c 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,9 +33,9 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.4.1'); + $I->createArtifactCurrentTestedCode('docker', '1.4.2'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.1'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.2'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( From 8afdbbda8d5a71e0262a9f1fc723d50f3f67b324 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Mon, 7 Jul 2025 18:28:42 +0530 Subject: [PATCH 107/113] code refactor --- src/Test/Functional/Acceptance/Valkey84Cest.php | 2 +- src/Test/Functional/Acceptance/ValkeyCest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Test/Functional/Acceptance/Valkey84Cest.php b/src/Test/Functional/Acceptance/Valkey84Cest.php index 21b9fd7e..56e4fc7c 100644 --- a/src/Test/Functional/Acceptance/Valkey84Cest.php +++ b/src/Test/Functional/Acceptance/Valkey84Cest.php @@ -16,4 +16,4 @@ class Valkey84Cest extends ValkeyCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.8'; -} \ No newline at end of file +} diff --git a/src/Test/Functional/Acceptance/ValkeyCest.php b/src/Test/Functional/Acceptance/ValkeyCest.php index ba27404b..f76d4157 100644 --- a/src/Test/Functional/Acceptance/ValkeyCest.php +++ b/src/Test/Functional/Acceptance/ValkeyCest.php @@ -22,11 +22,11 @@ class ValkeyCest extends AbstractCest protected const TEMPLATE_VERSION = '2.4.7'; /** - * @param CliTester $I - * @param Example $data + * @param CliTester $I + * @param Example $data * @dataProvider dataProvider - * @return void - * @throws TaskException + * @return void + * @throws TaskException */ public function testValkey(CliTester $I, Example $data) { @@ -92,7 +92,7 @@ public function testValkey(CliTester $I, Example $data) /** * Builds build:compose command from given test data * - * @param Example $data + * @param Example $data * @return string */ private function buildCommand(Example $data): string @@ -116,4 +116,4 @@ protected function dataProvider(): array ], ]; } -} \ No newline at end of file +} From ab7bebe896be8a9180fde62bb99c145f887b93d7 Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Mon, 7 Jul 2025 19:13:29 +0530 Subject: [PATCH 108/113] revert changes --- src/Test/Functional/Acceptance/AbstractCest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index a66f8b7c..dc491f14 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,9 +33,9 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.4.2'); + $I->createArtifactCurrentTestedCode('docker', '1.4.1'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.2'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.1'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( From b32804edfa76b63ffaa1323651bc8cc6a19fe309 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Sun, 13 Jul 2025 22:44:12 +0530 Subject: [PATCH 109/113] MCLOUD-13311: DB health check backward compatibility --- .../ProductionBuilder/Service/Database/Db/HealthCheck.php | 5 ++++- .../Integration/_files/cloud_base/docker-compose.exp.yml | 2 +- .../_files/cloud_base_developer/docker-compose.exp.yml | 2 +- .../cloud_base_developer_manual/docker-compose.exp.yml | 2 +- .../_files/cloud_base_mftf/docker-compose.exp.yml | 2 +- .../_files/cloud_base_os_2.3_cli/docker-compose.exp.yml | 2 +- .../_files/cloud_base_os_2_cli/docker-compose.exp.yml | 2 +- .../_files/cloud_base_test/docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../_files/cloud_no_tls_service/docker-compose.exp.yml | 2 +- .../cloud_no_varnish_and_tls_service/docker-compose.exp.yml | 2 +- .../_files/cloud_no_varnish_service/docker-compose.exp.yml | 2 +- .../_files/custom_cloud_base/docker-compose.exp.yml | 2 +- .../_files/custom_cloud_base_native/docker-compose.exp.yml | 2 +- .../_files/custom_cloud_custom_images/docker-compose.exp.yml | 2 +- .../custom_cloud_no_tls_service/docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../custom_cloud_no_varnish_service/docker-compose.exp.yml | 2 +- .../_files/custom_registry/docker-compose.exp.yml | 2 +- 21 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php b/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php index 60a60a0b..3c9eb951 100644 --- a/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php +++ b/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php @@ -20,7 +20,10 @@ class HealthCheck public function getConfig(): array { return [ - 'test' => ['CMD-SHELL', 'mariadb-admin ping -h localhost -pmagento2'], + 'test' => [ + 'CMD-SHELL', + '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' + ], 'interval' => '30s', 'timeout' => '30s', 'retries' => 3 diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index 3e64a489..1ed81d52 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index 392942a8..e96c64b1 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index 32990f6e..b244c9eb 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index c73c204e..b9b179e0 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml index a6fb654a..d0f17348 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml index 485a2a8d..50b71d7a 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index 8f6e09d6..a8f32c1b 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index d84556fe..da788c3e 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index dabb4e45..773a33d2 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index 1b57b564..4d7bda12 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index 997ea5db..3f38882e 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index 11547a9d..33757293 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index c7829271..5c791f8b 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index b83c1ae0..0a9f3b9f 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index b83c1ae0..0a9f3b9f 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml index f94d3d8a..6549599d 100644 --- a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index e52b4d7e..95a7c3d7 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml index 756a1cc6..086e6ebd 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml index a8f578ad..f91ef529 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml @@ -17,7 +17,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index 17a34bab..e498a0f6 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -19,7 +19,7 @@ services: healthcheck: test: - CMD-SHELL - - 'mariadb-admin ping -h localhost -pmagento2' + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 From 70b61202a459f6f3a0491175363c92ffdf13aa70 Mon Sep 17 00:00:00 2001 From: Prateek Karanpuria Date: Sun, 13 Jul 2025 22:50:26 +0530 Subject: [PATCH 110/113] MCLOUD-13311: Updated the magento template version for AcceptanceCest test --- src/Test/Functional/Acceptance/AcceptanceCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index f776eb4c..219e7c63 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -17,7 +17,7 @@ class AcceptanceCest extends AbstractCest /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.8-php8.3'; + protected const TEMPLATE_VERSION = '2.4.8'; /** * @param \CliTester $I From a24ca3ac72fa77557c4fef788dd5e303d7104bbf Mon Sep 17 00:00:00 2001 From: ashvini22326 Date: Mon, 14 Jul 2025 18:00:01 +0530 Subject: [PATCH 111/113] updated default test --- .../Acceptance/{Valkey84Cest.php => Valkey83Cest.php} | 6 +++--- src/Test/Functional/Acceptance/ValkeyCest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/Test/Functional/Acceptance/{Valkey84Cest.php => Valkey83Cest.php} (71%) diff --git a/src/Test/Functional/Acceptance/Valkey84Cest.php b/src/Test/Functional/Acceptance/Valkey83Cest.php similarity index 71% rename from src/Test/Functional/Acceptance/Valkey84Cest.php rename to src/Test/Functional/Acceptance/Valkey83Cest.php index 56e4fc7c..b1231965 100644 --- a/src/Test/Functional/Acceptance/Valkey84Cest.php +++ b/src/Test/Functional/Acceptance/Valkey83Cest.php @@ -8,12 +8,12 @@ namespace Magento\CloudDocker\Test\Functional\Acceptance; /** - * @group php84 + * @group php83 */ -class Valkey84Cest extends ValkeyCest +class Valkey83Cest extends ValkeyCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.8'; + protected const TEMPLATE_VERSION = '2.4.7'; } diff --git a/src/Test/Functional/Acceptance/ValkeyCest.php b/src/Test/Functional/Acceptance/ValkeyCest.php index f76d4157..bf9280e5 100644 --- a/src/Test/Functional/Acceptance/ValkeyCest.php +++ b/src/Test/Functional/Acceptance/ValkeyCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php83 + * @group php84 */ class ValkeyCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.7'; + protected const TEMPLATE_VERSION = '2.4.8'; /** * @param CliTester $I From c5da8cf10fbd64509fc45f7cb2d8f1dd7e37dc0b Mon Sep 17 00:00:00 2001 From: pru32453 Date: Wed, 23 Jul 2025 15:33:17 +0530 Subject: [PATCH 112/113] MCLOUD-13768: Restored the functional test changes after develop merge --- .../Acceptance/Opensearch84Cest.php | 23 ------------------- .../Functional/Acceptance/OpensearchCest.php | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 src/Test/Functional/Acceptance/Opensearch84Cest.php diff --git a/src/Test/Functional/Acceptance/Opensearch84Cest.php b/src/Test/Functional/Acceptance/Opensearch84Cest.php deleted file mode 100644 index fc89cc29..00000000 --- a/src/Test/Functional/Acceptance/Opensearch84Cest.php +++ /dev/null @@ -1,23 +0,0 @@ - Date: Wed, 6 Aug 2025 15:17:09 +0530 Subject: [PATCH 113/113] MCLOUD-13940: Cloud tools August 2025 release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c8cb805a..0fb17f2b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.4.3", + "version": "1.4.4", "license": [ "OSL-3.0", "AFL-3.0"