├── .github ├── .metadata.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── COPYING.txt ├── LICENSE.txt ├── LICENSE_AFL.txt ├── LICENSE_MIT.txt ├── README.md ├── autoload.php ├── bin ├── .gitignore ├── ece-docker └── init-docker.sh ├── bootstrap.php ├── codeception.dist.yml ├── composer.json ├── config └── services.xml ├── dist ├── bin │ └── magento-docker ├── docker-sync.yml ├── mnt │ └── .gitignore ├── mutagen.sh ├── mysql-quote │ └── docker-entrypoint-initdb.d │ │ └── .gitignore ├── mysql-sales │ └── docker-entrypoint-initdb.d │ │ └── .gitignore ├── mysql │ ├── .gitignore │ ├── docker-entrypoint-initdb.d │ │ └── .gitignore │ └── mariadb.conf.d │ │ └── example.cnf ├── php.dev.ini └── tmp │ └── .gitignore ├── images ├── elasticsearch │ ├── 7.10 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 7.11 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ └── es │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh ├── mailhog │ └── 1.0 │ │ └── Dockerfile ├── nginx │ └── 1.24 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ ├── nginx.conf │ │ ├── vhost.conf │ │ └── xdebug-upstream.conf ├── opensearch │ ├── 1.1 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 1.2 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 1.3 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 2.12 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 2.3 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 2.4 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ ├── 2.5 │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh │ └── os │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── docker-healthcheck.sh ├── php │ ├── 7.4-cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 7.4-fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-fpm.conf │ │ │ ├── php-fpm.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.0-cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.0-fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-fpm.conf │ │ │ ├── php-fpm.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.1-cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.1-fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-fpm.conf │ │ │ ├── php-fpm.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.2-cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.2-fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-fpm.conf │ │ │ ├── php-fpm.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.3-cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.3-fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-fpm.conf │ │ │ ├── php-fpm.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.4-cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── 8.4-fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-fpm.conf │ │ │ ├── php-fpm.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug.ini │ ├── cli │ │ ├── Dockerfile │ │ ├── bin │ │ │ ├── cloud-build │ │ │ ├── cloud-deploy │ │ │ ├── cloud-post-deploy │ │ │ ├── ece-command │ │ │ ├── magento-command │ │ │ ├── magento-installer │ │ │ ├── mftf-command │ │ │ ├── run-cron │ │ │ └── run-hooks │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ │ ├── mail.ini │ │ │ ├── php-cli.ini │ │ │ ├── php-gnupg.ini │ │ │ ├── php-pcov.ini │ │ │ └── php-xdebug-3.ini │ └── fpm │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── etc │ │ ├── mail.ini │ │ ├── php-fpm.conf │ │ ├── php-fpm.ini │ │ ├── php-gnupg.ini │ │ ├── php-pcov.ini │ │ └── php-xdebug-3.ini └── varnish │ ├── 6.0 │ ├── Dockerfile │ └── etc │ │ └── default.vcl │ ├── 6.2 │ ├── Dockerfile │ └── etc │ │ └── default.vcl │ ├── 6.5 │ ├── Dockerfile │ └── etc │ │ └── default.vcl │ ├── 6.6 │ ├── Dockerfile │ └── etc │ │ └── default.vcl │ ├── 7.0 │ ├── Dockerfile │ └── etc │ │ └── default.vcl │ ├── 7.1.1 │ ├── Dockerfile │ └── etc │ │ └── default.vcl │ └── 7.1 │ ├── Dockerfile │ └── etc │ └── default.vcl ├── src ├── App │ ├── ConfigurationMismatchException.php │ ├── Container.php │ ├── ContainerException.php │ ├── ContainerInterface.php │ └── GenericException.php ├── Application.php ├── Cli.php ├── Command │ ├── BuildCompose.php │ ├── BuildCustomCompose.php │ ├── BuildDist.php │ └── Image │ │ ├── GenerateEs.php │ │ ├── GenerateOs.php │ │ └── GeneratePhp.php ├── Compose │ ├── BuilderFactory.php │ ├── BuilderInterface.php │ ├── DeveloperBuilder.php │ ├── Manager.php │ ├── ManagerFactory.php │ ├── Php │ │ ├── ConfigFilesResolver.php │ │ └── ExtensionResolver.php │ ├── ProductionBuilder.php │ └── ProductionBuilder │ │ ├── CliDepend.php │ │ ├── Service │ │ ├── Blackfire.php │ │ ├── Build.php │ │ ├── Cron.php │ │ ├── Database │ │ │ ├── Db.php │ │ │ ├── Db │ │ │ │ └── HealthCheck.php │ │ │ ├── DbQuote.php │ │ │ └── DbSales.php │ │ ├── Deploy.php │ │ ├── ElasticSearch.php │ │ ├── Fpm.php │ │ ├── FpmXdebug.php │ │ ├── Generic.php │ │ ├── Mailhog.php │ │ ├── Node.php │ │ ├── OpenSearch.php │ │ ├── RabbitMq.php │ │ ├── Redis.php │ │ ├── Selenium.php │ │ ├── Test.php │ │ ├── Tls.php │ │ ├── Varnish.php │ │ ├── Web.php │ │ └── Zookeeper.php │ │ ├── ServiceBuilderInterface.php │ │ ├── ServicePool.php │ │ ├── Volume.php │ │ └── VolumeResolver.php ├── Config │ ├── Config.php │ ├── ConfigFactory.php │ ├── Dist │ │ ├── Formatter.php │ │ └── Generator.php │ ├── Environment │ │ ├── Converter.php │ │ ├── Encoder.php │ │ └── Shared │ │ │ └── Reader.php │ ├── ReaderInterface.php │ ├── Relationship.php │ └── Source │ │ ├── BaseSource.php │ │ ├── CliSource.php │ │ ├── CloudBaseSource.php │ │ ├── CloudSource.php │ │ ├── ConfigSource.php │ │ ├── CustomSource.php │ │ ├── SourceException.php │ │ ├── SourceFactory.php │ │ └── SourceInterface.php ├── Filesystem │ ├── DirectoryList.php │ ├── FileList.php │ ├── FileNotFoundException.php │ ├── Filesystem.php │ └── FilesystemException.php ├── Service │ ├── ServiceFactory.php │ └── ServiceInterface.php └── Test │ ├── Functional │ ├── Acceptance.suite.dist.yml │ └── Acceptance │ │ ├── AbstractCest.php │ │ ├── Acceptance81Cest.php │ │ ├── Acceptance82Cest.php │ │ ├── AcceptanceCest.php │ │ ├── Developer82Cest.php │ │ ├── DeveloperCest.php │ │ ├── Elasticsearch81Cest.php │ │ ├── Elasticsearch82Cest.php │ │ ├── ElasticsearchCest.php │ │ ├── MailHog82Cest.php │ │ ├── MailHogCest.php │ │ ├── Opensearch81Cest.php │ │ ├── Opensearch82Cest.php │ │ └── OpensearchCest.php │ ├── Integration │ ├── BuildComposeTest.php │ ├── BuildCustomComposeTest.php │ └── _files │ │ ├── .gitignore │ │ ├── cloud_base │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_developer │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_developer_manual │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_mftf │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_os_2.3_cli │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_os_2_cli │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_test │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_with_custom_zookeeper_image │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_with_custom_zookeeper_image_and_version │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_base_with_custom_zookeeper_version │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_no_tls_service │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_no_varnish_and_tls_service │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── cloud_no_varnish_service │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── composer.json │ │ ├── custom_cloud_base │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── custom_cloud_base_native │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── custom_cloud_custom_images │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── custom_cloud_no_tls_service │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── custom_cloud_no_varnish_and_tls_services │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ ├── custom_cloud_no_varnish_service │ │ ├── .docker │ │ │ ├── .gitignore │ │ │ └── config.php.dist │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ │ └── custom_registry │ │ ├── .docker │ │ ├── .gitignore │ │ └── config.php.dist │ │ ├── .magento.app.yaml │ │ ├── .magento │ │ └── services.yaml │ │ ├── composer.json │ │ └── docker-compose.exp.yml │ └── Unit │ └── Config │ ├── Dist │ └── GeneratorTest.php │ ├── Environment │ ├── ConverterTest.php │ └── Shared │ │ └── ReaderTest.php │ └── RelationshipTest.php └── tests ├── README.md ├── functional ├── Codeception │ ├── BaseModule.php │ ├── Docker.php │ ├── MagentoDb.php │ └── TestInfrastructure.php ├── Robo │ ├── Tasks.php │ └── Tasks │ │ ├── Bash.php │ │ ├── CopyFromDocker.php │ │ ├── CopyToDocker.php │ │ ├── DockerCompose.php │ │ ├── DockerCompose │ │ └── Run.php │ │ ├── EnvCleanUp.php │ │ ├── EnvDown.php │ │ ├── EnvUp.php │ │ ├── GenerateDockerCompose.php │ │ └── RemoveDockerCompose.php ├── _data │ └── .gitkeep ├── _output │ └── .gitignore ├── _support │ ├── .gitignore │ ├── CliTester.php │ └── FailedInfo.php └── configuration.dist.yml ├── integration ├── Container.php └── phpunit.xml.dist ├── static ├── Sniffs │ ├── Directives │ │ └── StrictTypesSniff.php │ └── Whitespace │ │ └── MultipleEmptyLinesSniff.php ├── phpcs-ruleset.xml ├── phpmd-ruleset.xml └── phpstan.neon └── unit ├── .gitignore └── phpunit.xml.dist /.github/.metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "templateVersion": "0.2", 3 | "product": { 4 | "name": "Magento Cloud Docker", 5 | "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" 6 | }, 7 | "contacts": { 8 | "team": { 9 | "name": "Mystic Mountain", 10 | "DL": "Grp-Mystic-Mountain", 11 | "slackChannel": "#mystic-mountain-team" 12 | } 13 | }, 14 | "ticketTracker": { 15 | "functionalJiraQueue": { 16 | "projectKey": "MCLOUD" 17 | }, 18 | "securityJiraQueue": { 19 | "projectKey": "MAGREQ", 20 | "component": "MAGREQ/Magento Cloud Engineering" 21 | } 22 | }, 23 | "productionCodeBranches": ["1.0", "1.1", "1.2", "1.3"] 24 | } 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Technical issue with the Magento ECE-Tools 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | 19 | 20 | ### Preconditions 21 | 25 | 1. 26 | 2. 27 | 28 | ### Steps to reproduce 29 | 33 | 1. 34 | 2. 35 | 3. 36 | 37 | ### Expected result 38 | 39 | 1. [Screenshots, logs or description] 40 | 41 | ### Actual result 42 | 43 | 1. [Screenshots, logs or description] 44 | 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.idea 3 | /vendor 4 | /composer.phar 5 | /composer.lock 6 | /auth.json 7 | /_workdir 8 | /_workdir_cache 9 | /venv 10 | /*.code-workspace 11 | .phpunit.result.cache 12 | -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2013-present Magento, Inc. 2 | 3 | Each Magento source file included in this distribution is licensed under OSL 3.0 license 4 | 5 | http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 6 | Please see LICENSE.txt for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy. 7 | -------------------------------------------------------------------------------- /LICENSE_MIT.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Meanbee, Taylor Otwell and Mage Inferno 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /autoload.php: -------------------------------------------------------------------------------- 1 | run(); 11 | -------------------------------------------------------------------------------- /bootstrap.php: -------------------------------------------------------------------------------- 1 | > /usr/share/elasticsearch/config/elasticsearch.yml 12 | RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml 13 | RUN bin/elasticsearch-plugin install -b analysis-icu && \ 14 | bin/elasticsearch-plugin install -b analysis-phonetic 15 | 16 | ADD docker-healthcheck.sh /docker-healthcheck.sh 17 | ADD docker-entrypoint.sh /docker-entrypoint.sh 18 | 19 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 20 | 21 | ENTRYPOINT ["/docker-entrypoint.sh"] 22 | 23 | EXPOSE 9200 9300 24 | -------------------------------------------------------------------------------- /images/elasticsearch/7.10/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$ES_PLUGINS" ]]; then 5 | echo "Installing plugins: $ES_PLUGNS" 6 | for PLUGIN in $ES_PLUGINS 7 | do 8 | ./bin/elasticsearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/local/bin/docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/elasticsearch/7.10/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/elasticsearch/7.11/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/elasticsearch/elasticsearch:7.11.2 2 | 3 | RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \ 4 | sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://mirror.rackspace.com\/centos-vault|g' /etc/yum.repos.d/CentOS-Linux-* && \ 5 | yum -y install zip && \ 6 | zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 7 | yum remove -y zip && \ 8 | yum -y clean all && \ 9 | rm -rf /var/cache 10 | 11 | RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml 12 | RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml 13 | RUN bin/elasticsearch-plugin install -b analysis-icu && \ 14 | bin/elasticsearch-plugin install -b analysis-phonetic 15 | 16 | ADD docker-healthcheck.sh /docker-healthcheck.sh 17 | ADD docker-entrypoint.sh /docker-entrypoint.sh 18 | 19 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 20 | 21 | ENTRYPOINT ["/docker-entrypoint.sh"] 22 | 23 | EXPOSE 9200 9300 24 | -------------------------------------------------------------------------------- /images/elasticsearch/7.11/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$ES_PLUGINS" ]]; then 5 | echo "Installing plugins: $ES_PLUGNS" 6 | for PLUGIN in $ES_PLUGINS 7 | do 8 | ./bin/elasticsearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/local/bin/docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/elasticsearch/7.11/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/elasticsearch/es/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/elasticsearch/elasticsearch:{%version%} 2 | 3 | RUN {%fix_repos%}yum -y install zip && \ 4 | zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 5 | yum remove -y zip && \ 6 | yum -y clean all && \ 7 | rm -rf /var/cache 8 | 9 | RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml 10 | {%single_node%} 11 | RUN bin/elasticsearch-plugin install -b analysis-icu && \ 12 | bin/elasticsearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/elasticsearch/es/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$ES_PLUGINS" ]]; then 5 | echo "Installing plugins: $ES_PLUGNS" 6 | for PLUGIN in $ES_PLUGINS 7 | do 8 | ./bin/elasticsearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/local/bin/docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/elasticsearch/es/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/mailhog/1.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MailHog Dockerfile 3 | # 4 | 5 | FROM golang:1.17.9-alpine 6 | 7 | # Install MailHog: 8 | RUN apk --no-cache add --virtual build-dependencies \ 9 | git \ 10 | && mkdir -p /root/gocode \ 11 | && export GOPATH=/root/gocode \ 12 | && go get github.com/mailhog/MailHog@v1.0.1 \ 13 | && mv /root/gocode/bin/MailHog /usr/local/bin \ 14 | && rm -rf /root/gocode \ 15 | && apk del --purge build-dependencies 16 | 17 | # Add mailhog user/group with uid/gid 1000. 18 | # This is a workaround for boot2docker issue #581, see 19 | # https://github.com/boot2docker/boot2docker/issues/581 20 | RUN adduser -D -u 1000 mailhog 21 | 22 | USER mailhog 23 | 24 | WORKDIR /home/mailhog 25 | 26 | ENTRYPOINT ["MailHog"] 27 | 28 | # Expose the SMTP and HTTP ports: 29 | EXPOSE 1025 8025 30 | -------------------------------------------------------------------------------- /images/nginx/1.24/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.24 2 | 3 | ENV UPLOAD_MAX_FILESIZE 64M 4 | ENV XDEBUG_HOST fpm_xdebug 5 | ENV FPM_HOST fpm 6 | ENV FPM_PORT 9000 7 | ENV UPSTREAM_HOST web 8 | ENV UPSTREAM_PORT 8080 9 | ENV MAGENTO_ROOT /app 10 | ENV MAGENTO_RUN_MODE production 11 | ENV MFTF_UTILS 0 12 | ENV DEBUG false 13 | ENV NGINX_WORKER_PROCESSES 1 14 | ENV NGINX_WORKER_CONNECTIONS 1024 15 | 16 | COPY etc/nginx.conf /etc/nginx/ 17 | COPY etc/vhost.conf /etc/nginx/conf.d/default.conf 18 | COPY etc/xdebug-upstream.conf /etc/nginx/conf.d/xdebug/upstream.conf 19 | 20 | RUN mkdir /etc/nginx/ssl 21 | 22 | RUN apt-get update && \ 23 | apt-get install -y openssl 24 | 25 | RUN openssl req -x509 -newkey rsa:2048 -sha256 -days 730 -nodes \ 26 | -keyout /etc/nginx/ssl/magento.key -out /etc/nginx/ssl/magento.crt \ 27 | -subj "/C=US/ST=TX/L=Austin/O=Adobe Commerce/OU=Cloud Docker/CN=magento2.docker" \ 28 | -addext "subjectAltName=DNS:magento2.docker,DNS:www.magento2.docker" 29 | 30 | VOLUME ${MAGENTO_ROOT} 31 | 32 | COPY docker-entrypoint.sh /docker-entrypoint.sh 33 | RUN ["chmod", "+x", "/docker-entrypoint.sh"] 34 | ENTRYPOINT ["/docker-entrypoint.sh"] 35 | 36 | EXPOSE 443 37 | 38 | WORKDIR ${MAGENTO_ROOT} 39 | 40 | CMD ["nginx", "-g", "daemon off;"] 41 | -------------------------------------------------------------------------------- /images/nginx/1.24/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | VHOST_FILE="/etc/nginx/conf.d/default.conf" 6 | NGINX_FILE="/etc/nginx/nginx.conf" 7 | XDEBUG_UPSTREAM_FILE="/etc/nginx/conf.d/xdebug/upstream.conf" 8 | 9 | [ ! -z "${FPM_HOST}" ] && sed -i "s/!FPM_HOST!/${FPM_HOST}/" $VHOST_FILE 10 | [ ! -z "${XDEBUG_HOST}" ] && sed -i "s/!XDEBUG_HOST!/${XDEBUG_HOST}/" $XDEBUG_UPSTREAM_FILE 11 | [ ! -z "${FPM_PORT}" ] && sed -i "s/!FPM_PORT!/${FPM_PORT}/" $VHOST_FILE 12 | [ ! -z "${FPM_PORT}" ] && sed -i "s/!FPM_PORT!/${FPM_PORT}/" $XDEBUG_UPSTREAM_FILE 13 | [ ! -z "${UPSTREAM_HOST}" ] && sed -i "s/!UPSTREAM_HOST!/${UPSTREAM_HOST}/" $VHOST_FILE 14 | [ ! -z "${UPSTREAM_PORT}" ] && sed -i "s/!UPSTREAM_PORT!/${UPSTREAM_PORT}/" $VHOST_FILE 15 | [ ! -z "${MAGENTO_ROOT}" ] && sed -i "s#!MAGENTO_ROOT!#${MAGENTO_ROOT}#" $VHOST_FILE 16 | [ ! -z "${MAGENTO_RUN_MODE}" ] && sed -i "s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE}/" $VHOST_FILE 17 | [ ! -z "${MFTF_UTILS}" ] && sed -i "s/!MFTF_UTILS!/${MFTF_UTILS}/" $VHOST_FILE 18 | [ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" $VHOST_FILE 19 | [ ! -z "${WITH_XDEBUG}" ] && sed -i "s/!WITH_XDEBUG!/${WITH_XDEBUG}/" $VHOST_FILE 20 | [ "${WITH_XDEBUG}" == "1" ] && sed -i "s/#include_xdebug_upstream/include/" $NGINX_FILE 21 | [ ! -z "${NGINX_WORKER_PROCESSES}" ] && sed -i "s/!NGINX_WORKER_PROCESSES!/${NGINX_WORKER_PROCESSES}/" $NGINX_FILE 22 | [ ! -z "${NGINX_WORKER_CONNECTIONS}" ] && sed -i "s/!NGINX_WORKER_CONNECTIONS!/${NGINX_WORKER_CONNECTIONS}/" $NGINX_FILE 23 | 24 | # Check if the nginx syntax is fine, then launch. 25 | nginx -t 26 | 27 | exec "$@" 28 | -------------------------------------------------------------------------------- /images/nginx/1.24/etc/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes !NGINX_WORKER_PROCESSES!; 2 | 3 | error_log /var/log/nginx/error.log debug; 4 | pid /var/run/nginx.pid; 5 | 6 | events { 7 | # this should be equal to value of "ulimit -n" 8 | # reference: https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration 9 | worker_connections !NGINX_WORKER_CONNECTIONS!; 10 | } 11 | 12 | http { 13 | include /etc/nginx/mime.types; 14 | default_type application/octet-stream; 15 | 16 | log_format main 17 | '$remote_addr - $remote_user [$time_local] "$request" ' 18 | '$status $body_bytes_sent "$http_referer" ' 19 | '"$http_user_agent" "$http_x_forwarded_for"'; 20 | 21 | access_log /var/log/nginx/access.log main; 22 | 23 | sendfile on; 24 | #tcp_nopush on; 25 | 26 | keepalive_timeout 65; 27 | 28 | #gzip on; 29 | 30 | client_max_body_size 20M; 31 | 32 | #include_xdebug_upstream /etc/nginx/conf.d/xdebug/upstream.conf; 33 | include /etc/nginx/conf.d/*.conf; 34 | } 35 | -------------------------------------------------------------------------------- /images/nginx/1.24/etc/xdebug-upstream.conf: -------------------------------------------------------------------------------- 1 | upstream fastcgi_backend_xdebug { 2 | server !XDEBUG_HOST!:!FPM_PORT!; # Variables: XDEBUG_HOST FPM_PORT 3 | } 4 | -------------------------------------------------------------------------------- /images/opensearch/1.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:1.1.0 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/1.1/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/1.1/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/1.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:1.2.1 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/1.2/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/1.2/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/1.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:1.3.0 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/1.3/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/1.3/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/2.12/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:2.12.0 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/2.12/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/2.12/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/2.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:2.3.0 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/2.3/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/2.3/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/2.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:2.4.0 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/2.4/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/2.4/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/2.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:2.5.0 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/2.5/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/2.5/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/opensearch/os/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensearchproject/opensearch:{%version%} 2 | 3 | USER root 4 | RUN yum -y install zip && \ 5 | zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ 6 | yum remove -y zip && \ 7 | yum -y clean all && \ 8 | rm -rf /var/cache 9 | USER opensearch 10 | 11 | RUN bin/opensearch-plugin install -b analysis-icu && \ 12 | bin/opensearch-plugin install -b analysis-phonetic 13 | 14 | ADD docker-healthcheck.sh /docker-healthcheck.sh 15 | ADD docker-entrypoint.sh /docker-entrypoint.sh 16 | 17 | HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] 18 | 19 | ENTRYPOINT ["/docker-entrypoint.sh"] 20 | 21 | EXPOSE 9200 9300 22 | -------------------------------------------------------------------------------- /images/opensearch/os/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if [[ -n "$OS_PLUGINS" ]]; then 5 | echo "Installing plugins: $OS_PLUGINS" 6 | for PLUGIN in $OS_PLUGINS 7 | do 8 | ./bin/opensearch-plugin install -b "$PLUGIN" 9 | done 10 | fi 11 | 12 | /bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh 13 | -------------------------------------------------------------------------------- /images/opensearch/os/docker-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then 5 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 6 | if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then 7 | exit 0 8 | fi 9 | echo >&2 "Unexpected health status: $health" 10 | fi 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/7.4-cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/7.4-cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/7.4-cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/7.4-cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/7.4-cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/7.4-cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/7.4-cli/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/7.4-fpm/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/8.0-cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/8.0-cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/8.0-cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.0-cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/8.0-cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.0-cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.0-cli/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.0-fpm/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/8.1-cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/8.1-cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/8.1-cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.1-cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/8.1-cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.1-cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.1-cli/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.1-fpm/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/8.2-cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/8.2-cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/8.2-cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.2-cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/8.2-cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.2-cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.2-cli/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.2-fpm/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/8.3-cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/8.3-cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/8.3-cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.3-cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/8.3-cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.3-cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.3-cli/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.3-fpm/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/8.4-cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/8.4-cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/8.4-cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.4-cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/8.4-cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.4-cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.4-cli/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/8.4-fpm/etc/php-xdebug.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/cli/bin/cloud-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | RUN_HOOKS="run-hooks" 8 | 9 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 10 | echo "Cleaning directories:" 11 | 12 | if [ "$INSTALLATION_TYPE" == "composer" ]; then 13 | echo "Cleaning setup directory." 14 | rm -rf $MAGENTO_ROOT/setup/* 15 | fi 16 | 17 | echo "Cleaning vendor directory." 18 | rm -rf $MAGENTO_ROOT/vendor/* 19 | 20 | echo "Cleaning generated directory." 21 | rm -rf $MAGENTO_ROOT/generated/* 22 | 23 | echo "Removing app/etc/env.php file" 24 | rm -f $MAGENTO_ROOT/app/etc/env.php 25 | fi 26 | 27 | echo "Installing dependencies." 28 | 29 | composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist 30 | 31 | echo "Running \"build\" hook." 32 | 33 | $RUN_HOOKS build 34 | 35 | if [ "$MAGENTO_RUN_MODE" == "production" ]; then 36 | echo "Setting file permissions." 37 | 38 | chown -R www:www $MAGENTO_ROOT 39 | 40 | find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; 41 | find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; 42 | fi 43 | 44 | echo "Building complete." 45 | -------------------------------------------------------------------------------- /images/php/cli/bin/cloud-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"deploy\" hook." 8 | 9 | run-hooks deploy 10 | 11 | # check that Varnish exists 12 | if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then 13 | minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") 14 | if [[ "$minor_magento_version" != "2.1" ]]; then 15 | output=$(magento-command config:set system/full_page_cache/caching_application 2) 16 | # as config:set does not return error code, we check output text to continue set varnish settings 17 | if [[ $output == *"Value was saved"* ]]; then 18 | echo "Setting Varnish for Magento FPC." 19 | magento-command setup:config:set --http-cache-hosts=varnish -n 20 | else 21 | echo $output 22 | fi 23 | fi 24 | fi 25 | 26 | # set developer mode if it is configured in $MAGENTO_RUN_MODE 27 | if [ "$MAGENTO_RUN_MODE" == "developer" ]; then 28 | output=$(magento-command deploy:mode:set developer) 29 | if [[ $output == *"Enabled developer mode."* ]]; then 30 | echo "Enabled developer mode." 31 | else 32 | echo $output 33 | fi 34 | fi 35 | 36 | 37 | echo "Deployment finished." 38 | -------------------------------------------------------------------------------- /images/php/cli/bin/cloud-post-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | echo "Running \"post-deploy\" hook." 8 | 9 | run-hooks post_deploy 10 | 11 | echo "Post deployment finished." 12 | -------------------------------------------------------------------------------- /images/php/cli/bin/ece-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" 6 | 7 | exec $ECE_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/cli/bin/magento-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" 6 | 7 | exec $MAGENTO_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/cli/bin/magento-installer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" = "true" ] && set -x 6 | 7 | BUILD_COMMAND="cloud-build" 8 | DEPLOY_COMMAND="cloud-deploy" 9 | 10 | $BUILD_COMMAND 11 | $DEPLOY_COMMAND 12 | -------------------------------------------------------------------------------- /images/php/cli/bin/mftf-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" 6 | 7 | exec $MFTF_COMMAND "$@" 8 | -------------------------------------------------------------------------------- /images/php/cli/bin/run-cron: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && tail -f -n0 /var/log/cron.log 4 | -------------------------------------------------------------------------------- /images/php/cli/bin/run-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import json 7 | import base64 8 | 9 | # Disable output buffering. 10 | os.environ['PYTHONUNBUFFERED'] = "1" 11 | 12 | # The list of available hooks. 13 | available_hooks = ["build", "deploy", "post_deploy"] 14 | 15 | 16 | # Prints a message and returns an exit code. 17 | def error_exit(msg, code=1): 18 | print(msg) 19 | sys.exit(code) 20 | 21 | 22 | # Gets Magento root path. 23 | def get_magento_root(): 24 | try: 25 | return str(os.environ['MAGENTO_ROOT']) 26 | except KeyError: 27 | error_exit('Environment variable MAGENTO_ROOT is not available') 28 | 29 | 30 | # Gets set hooks by hook name. 31 | def get_hooks(hook_name): 32 | try: 33 | application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) 34 | content = json.loads(base64.b64decode(application).decode("utf-8")) 35 | 36 | return content['hooks'][hook_name] 37 | except Exception as exc: 38 | error_exit("Cannot decode string: " + str(exc)) 39 | 40 | 41 | # Main function. 42 | def main(): 43 | if len(sys.argv) != 2: 44 | error_exit("Usage: run-hooks ") 45 | 46 | hook_name = str(sys.argv[1]) 47 | if hook_name not in available_hooks: 48 | error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) 49 | 50 | try: 51 | subprocess.check_call( 52 | get_hooks(hook_name), 53 | shell=True, 54 | cwd=get_magento_root() 55 | ) 56 | except subprocess.CalledProcessError as exc: 57 | error_exit("returned non-zero exit status " + str(exc.returncode)) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /images/php/cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | if [ ! -z "${CRONTAB}" ]; then 6 | echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log 7 | fi 8 | 9 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 10 | 11 | # Enable PHP extensions 12 | PHP_EXT_COM_ON=docker-php-ext-enable 13 | 14 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 15 | 16 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 17 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 18 | fi 19 | 20 | # Clear composer cache if needed 21 | [ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ 22 | composer clearcache 23 | 24 | # Configure composer 25 | [ ! -z "${COMPOSER_VERSION}" ] && \ 26 | composer self-update $COMPOSER_VERSION 27 | 28 | [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ 29 | composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN 30 | 31 | [ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ 32 | composer config --global http-basic.repo.magento.com \ 33 | $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD 34 | 35 | exec "$@" 36 | -------------------------------------------------------------------------------- /images/php/cli/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/cli/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; php.ini 2 | memory_limit = ${PHP_MEMORY_LIMIT} 3 | zlib.output_compression = on 4 | realpath_cache_size = 32k 5 | realpath_cache_ttl = 7200 6 | always_populate_raw_post_data = -1 7 | max_input_vars = 10000 8 | session.gc_probability = 1 9 | opcache.enable = 1 10 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 11 | -------------------------------------------------------------------------------- /images/php/cli/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/cli/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/cli/etc/php-xdebug-3.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/php/fpm/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | PHP_EXT_DIR=/usr/local/etc/php/conf.d 6 | 7 | # Enable PHP extensions 8 | PHP_EXT_COM_ON=docker-php-ext-enable 9 | 10 | [ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini 11 | 12 | if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then 13 | ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} 14 | fi 15 | 16 | # Set host.docker.internal if not available 17 | HOST_NAME="host.docker.internal" 18 | HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") 19 | if [[ "$HOST_IP" == "$HOST_NAME" ]]; then 20 | HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 21 | printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts 22 | fi 23 | 24 | exec "$@" 25 | -------------------------------------------------------------------------------- /images/php/fpm/etc/mail.ini: -------------------------------------------------------------------------------- 1 | ; Sendmail 2 | sendmail_path = ${SENDMAIL_PATH} 3 | -------------------------------------------------------------------------------- /images/php/fpm/etc/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | 3 | error_log = /proc/self/fd/2 4 | daemonize = no 5 | 6 | [www] 7 | 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | listen = [::]:9000 12 | 13 | pm = dynamic 14 | pm.max_children = 10 15 | pm.start_servers = 4 16 | pm.min_spare_servers = 2 17 | pm.max_spare_servers = 6 18 | pm.status_path = /status 19 | 20 | clear_env = no 21 | 22 | env[MAGE_MODE] = $MAGENTO_RUN_MODE 23 | 24 | ; Ensure worker stdout and stderr are sent to the main error log. 25 | catch_workers_output = yes 26 | -------------------------------------------------------------------------------- /images/php/fpm/etc/php-fpm.ini: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | opcache.enable = 1 3 | opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} 4 | user_ini.filename = 5 | -------------------------------------------------------------------------------- /images/php/fpm/etc/php-gnupg.ini: -------------------------------------------------------------------------------- 1 | extension = gnupg.so 2 | -------------------------------------------------------------------------------- /images/php/fpm/etc/php-pcov.ini: -------------------------------------------------------------------------------- 1 | pcov.enabled = 1 2 | pcov.directory = ${MAGENTO_ROOT} 3 | -------------------------------------------------------------------------------- /images/php/fpm/etc/php-xdebug-3.ini: -------------------------------------------------------------------------------- 1 | ; Xdebug settings will only kick in if the Xdebug module is loaded 2 | xdebug.mode = debug 3 | xdebug.client_port = 9001 4 | xdebug.start_with_request = trigger 5 | xdebug.discover_client_host = false 6 | xdebug.scream = false 7 | xdebug.show_local_vars = 1 8 | xdebug.idekey = PHPSTORM 9 | -------------------------------------------------------------------------------- /images/varnish/6.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:6.0 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | -------------------------------------------------------------------------------- /images/varnish/6.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:6.2 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | 5 | RUN ["chmod", "644", "/etc/varnish/default.vcl"] 6 | -------------------------------------------------------------------------------- /images/varnish/6.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:6.5 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | -------------------------------------------------------------------------------- /images/varnish/6.6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:6.6 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | -------------------------------------------------------------------------------- /images/varnish/7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:7.0 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | -------------------------------------------------------------------------------- /images/varnish/7.1.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:7.1.1 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | -------------------------------------------------------------------------------- /images/varnish/7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM varnish:7.1 2 | 3 | COPY etc/default.vcl /etc/varnish/ 4 | -------------------------------------------------------------------------------- /src/App/ConfigurationMismatchException.php: -------------------------------------------------------------------------------- 1 | container = $container; 31 | 32 | parent::__construct(); 33 | } 34 | 35 | /** 36 | * @inheritdoc 37 | */ 38 | protected function getDefaultCommands(): array 39 | { 40 | return array_merge(parent::getDefaultCommands(), [ 41 | $this->container->get(Command\BuildCompose::class), 42 | $this->container->get(Command\BuildCustomCompose::class), 43 | $this->container->get(Command\BuildDist::class), 44 | $this->container->get(Command\Image\GeneratePhp::class), 45 | $this->container->get(Command\Image\GenerateEs::class), 46 | $this->container->get(Command\Image\GenerateOs::class) 47 | ]); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Cli.php: -------------------------------------------------------------------------------- 1 | container = $container; 40 | $this->strategies = $strategies; 41 | } 42 | 43 | /** 44 | * @param string $strategy 45 | * @return BuilderInterface 46 | * @throws ConfigurationMismatchException 47 | */ 48 | public function create(string $strategy): BuilderInterface 49 | { 50 | if (!array_key_exists($strategy, $this->strategies)) { 51 | throw new ConfigurationMismatchException( 52 | sprintf('Wrong mode "%s" passed', $strategy) 53 | ); 54 | } 55 | 56 | return $this->container->get($this->strategies[$strategy]); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Compose/ManagerFactory.php: -------------------------------------------------------------------------------- 1 | 'mysqladmin ping -h localhost -pmagento2', 24 | 'interval' => '30s', 25 | 'timeout' => '30s', 26 | 'retries' => 3 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Compose/ProductionBuilder/ServiceBuilderInterface.php: -------------------------------------------------------------------------------- 1 | services = $services; 26 | } 27 | 28 | /** 29 | * Returns list of services 30 | * 31 | * @return ServiceBuilderInterface[] 32 | */ 33 | public function getServices(): array 34 | { 35 | return $this->services; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Config/ConfigFactory.php: -------------------------------------------------------------------------------- 1 | container = $container; 29 | } 30 | 31 | /** 32 | * @param array $sources 33 | * @return Config 34 | */ 35 | public function create(array $sources): Config 36 | { 37 | return new Config($this->container->get(DirectoryList::class), $sources); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Config/Dist/Formatter.php: -------------------------------------------------------------------------------- 1 | = 5.4 short array syntax. Otherwise use 22 | * default var_export functionality. 23 | * 24 | * @param mixed $var 25 | * @param int $depth 26 | * @return string 27 | */ 28 | public function varExport($var, int $depth = 1): string 29 | { 30 | if (!is_array($var)) { 31 | return var_export($var, true); 32 | } 33 | 34 | $indexed = array_keys($var) === range(0, count($var) - 1); 35 | $expanded = []; 36 | foreach ($var as $key => $value) { 37 | $expanded[] = str_repeat(self::INDENT, $depth) 38 | . ($indexed ? '' : $this->varExport($key) . ' => ') 39 | . $this->varExport($value, $depth + 1); 40 | } 41 | 42 | return sprintf("[\n%s\n%s]", implode(",\n", $expanded), str_repeat(self::INDENT, $depth - 1)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Config/Environment/Converter.php: -------------------------------------------------------------------------------- 1 | $value) { 26 | $formattedValue = is_bool($value) ? var_export($value, true) : $value; 27 | $data [] = $variable . '=' . $formattedValue; 28 | } 29 | 30 | return $data; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Config/ReaderInterface.php: -------------------------------------------------------------------------------- 1 | set($data); 29 | 30 | $this->data = $repo; 31 | } 32 | 33 | /** 34 | * @return Repository 35 | */ 36 | public function read(): Repository 37 | { 38 | return $this->data; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Config/Source/SourceException.php: -------------------------------------------------------------------------------- 1 | container = $container; 30 | } 31 | 32 | /** 33 | * @param string $object 34 | * @return SourceInterface 35 | */ 36 | public function create(string $object): SourceInterface 37 | { 38 | return $this->container->create($object); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Filesystem/DirectoryList.php: -------------------------------------------------------------------------------- 1 | root = realpath($root); 32 | $this->magentoRoot = realpath($magentoRoot); 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getRoot(): string 39 | { 40 | return $this->root; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function getMagentoRoot(): string 47 | { 48 | return $this->magentoRoot; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function getDockerRoot(): string 55 | { 56 | return $this->getMagentoRoot() . '/.docker'; 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function getImagesRoot(): string 63 | { 64 | return $this->getRoot() . '/images'; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Filesystem/FileList.php: -------------------------------------------------------------------------------- 1 | directoryList = $directoryList; 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getMagentoDockerCompose(): string 32 | { 33 | return $this->directoryList->getMagentoRoot() . '/docker-compose.yml'; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getAppConfig(): string 40 | { 41 | return $this->directoryList->getMagentoRoot() . '/.magento.app.yaml'; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getServicesConfig(): string 48 | { 49 | return $this->directoryList->getMagentoRoot() . '/.magento/services.yaml'; 50 | } 51 | 52 | /** 53 | * @return string 54 | */ 55 | public function getComposer(): string 56 | { 57 | return $this->directoryList->getRoot() . '/composer.json'; 58 | } 59 | 60 | /** 61 | * @return string 62 | */ 63 | public function getMagentoComposer(): string 64 | { 65 | return $this->directoryList->getMagentoRoot() . '/composer.json'; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Filesystem/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | generateDockerCompose('--mode=developer'); 31 | $I->replaceImagesWithCustom(); 32 | $I->startEnvironment(); 33 | 34 | $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); 35 | $I->seeInOutput('=> On'); 36 | 37 | $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); 38 | $I->seeInOutput('=> On'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Elasticsearch81Cest.php: -------------------------------------------------------------------------------- 1 | '7.6', 32 | 'xms' => '520m', 33 | 'xmx' => '520m', 34 | 'plugins' => ['analysis-nori'], 35 | 'param' => [ 36 | 'key' => 'node.store.allow_mmap', 37 | 'value' => 'false', 38 | 'needle' => '"store":{"allow_mmap":"false"}', 39 | ] 40 | ], 41 | ]; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Elasticsearch82Cest.php: -------------------------------------------------------------------------------- 1 | '1.1', 32 | 'xms' => '520m', 33 | 'xmx' => '520m', 34 | 'plugins' => ['analysis-nori'], 35 | 'param' => [ 36 | 'key' => 'node.store.allow_mmap', 37 | 'value' => 'false', 38 | 'needle' => '"store":{"allow_mmap":"false"}', 39 | ] 40 | ], 41 | [ 42 | 'version' => '1.2', 43 | 'xms' => '520m', 44 | 'xmx' => '520m', 45 | 'plugins' => ['analysis-nori'], 46 | 'param' => [ 47 | 'key' => 'node.store.allow_mmap', 48 | 'value' => 'false', 49 | 'needle' => '"store":{"allow_mmap":"false"}', 50 | ] 51 | ], 52 | ]; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Opensearch82Cest.php: -------------------------------------------------------------------------------- 1 | base64_encode(json_encode([ 5 | 'database' => [ 6 | [ 7 | 'host' => 'db', 8 | 'path' => 'magento2', 9 | 'password' => 'magento2', 10 | 'username' => 'magento2', 11 | 'port' => '3306', 12 | 'type' => 'mysql:10.2' 13 | ] 14 | ], 15 | 'redis' => [ 16 | [ 17 | 'host' => 'redis', 18 | 'port' => '6379', 19 | 'type' => 'redis:5.0' 20 | ] 21 | ] 22 | ])), 23 | 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ 24 | 'http://magento2.docker/' => [ 25 | 'type' => 'upstream', 26 | 'original_url' => 'http://{default}' 27 | ], 28 | 'https://magento2.docker/' => [ 29 | 'type' => 'upstream', 30 | 'original_url' => 'https://{default}' 31 | ] 32 | ])), 33 | 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ 34 | 'ADMIN_EMAIL' => 'admin@example.com', 35 | 'ADMIN_PASSWORD' => '123123q', 36 | 'ADMIN_URL' => 'admin' 37 | ])), 38 | 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ 39 | 'hooks' => [ 40 | 41 | ], 42 | 'mounts' => [ 43 | 'var' => [ 44 | 'path' => 'var', 45 | 'orig' => 'shared:files/var' 46 | ], 47 | 'app/etc' => [ 48 | 'path' => 'app/etc', 49 | 'orig' => 'shared:files/etc' 50 | ], 51 | 'pub/media' => [ 52 | 'path' => 'pub/media', 53 | 'orig' => 'shared:files/media' 54 | ], 55 | 'pub/static' => [ 56 | 'path' => 'pub/static', 57 | 'orig' => 'shared:files/static' 58 | ] 59 | ] 60 | ])), 61 | ]; 62 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_mftf/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | opensearch: "opensearch:opensearch" 20 | 21 | mounts: 22 | "var": "shared:files/var" 23 | "app/etc": "shared:files/etc" 24 | "pub/media": "shared:files/media" 25 | "pub/static": "shared:files/static" 26 | 27 | crons: 28 | cronrun: 29 | spec: "* * * * *" 30 | cmd: "php bin/magento cron:run" 31 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_mftf/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | 12 | opensearch: 13 | type: opensearchsearch:1.1 14 | disk: 512 15 | configuration: 16 | plugins: 17 | - plugin_3 18 | - plugin_4 19 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_mftf/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.3.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | opensearch: "opensearch:opensearch" 20 | 21 | mounts: 22 | "var": "shared:files/var" 23 | "app/etc": "shared:files/etc" 24 | "pub/media": "shared:files/media" 25 | "pub/static": "shared:files/static" 26 | 27 | crons: 28 | cronrun: 29 | spec: "* * * * *" 30 | cmd: "php bin/magento cron:run" 31 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | configuration: 12 | plugins: 13 | - plugin_1 14 | - plugin_2 15 | 16 | opensearch: 17 | type: opensearchsearch:1.1 18 | disk: 512 19 | configuration: 20 | plugins: 21 | - plugin_3 22 | - plugin_4 23 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | opensearch: "opensearch:opensearch" 20 | 21 | mounts: 22 | "var": "shared:files/var" 23 | "app/etc": "shared:files/etc" 24 | "pub/media": "shared:files/media" 25 | "pub/static": "shared:files/static" 26 | 27 | crons: 28 | cronrun: 29 | spec: "* * * * *" 30 | cmd: "php bin/magento cron:run" 31 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | configuration: 12 | plugins: 13 | - plugin_1 14 | - plugin_2 15 | 16 | opensearch: 17 | type: opensearchsearch:1.1 18 | disk: 512 19 | configuration: 20 | plugins: 21 | - plugin_3 22 | - plugin_4 23 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_os_2_cli/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_test/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_base_test/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_test/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: mymagento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | opensearch: "opensearch:opensearch" 20 | 21 | mounts: 22 | "var": "shared:files/var" 23 | "app/etc": "shared:files/etc" 24 | "pub/media": "shared:files/media" 25 | "pub/static": "shared:files/static" 26 | 27 | crons: 28 | cronrun: 29 | spec: "* * * * *" 30 | cmd: "php bin/magento cron:run" 31 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_test/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | 12 | opensearch: 13 | type: opensearchsearch:1.1 14 | disk: 512 15 | configuration: 16 | plugins: 17 | - plugin_3 18 | - plugin_4 19 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_test/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.3.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: mymagento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.3.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: mymagento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.3.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: mymagento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.3.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_tls_service/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_no_tls_service/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_tls_service/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_tls_service/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | configuration: 12 | plugins: 13 | - plugin_1 14 | - plugin_2 15 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_tls_service/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_and_tls_service/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | configuration: 12 | plugins: 13 | - plugin_1 14 | - plugin_2 15 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_and_tls_service/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_service/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/cloud_no_varnish_service/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_service/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_service/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | configuration: 12 | plugins: 13 | - plugin_1 14 | - plugin_2 15 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/cloud_no_varnish_service/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/magento-cloud-docker", 3 | "description": "Magento Cloud Docker", 4 | "type": "magento2-component", 5 | "version": "1.2.0", 6 | "license": [ 7 | "OSL-3.0", 8 | "AFL-3.0" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_base/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_cloud_base/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_base/.docker/config.php.dist: -------------------------------------------------------------------------------- 1 | base64_encode(json_encode([ 5 | 'database' => [ 6 | [ 7 | 'host' => 'db', 8 | 'path' => 'magento2', 9 | 'password' => 'magento2', 10 | 'username' => 'magento2', 11 | 'port' => '3306', 12 | 'type' => 'mysql:10.0' 13 | ] 14 | ] 15 | ])), 16 | 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ 17 | 'http://magento2.test:8080/' => [ 18 | 'type' => 'upstream', 19 | 'original_url' => 'http://{default}' 20 | ], 21 | 'https://magento2.test:8080/' => [ 22 | 'type' => 'upstream', 23 | 'original_url' => 'https://{default}' 24 | ] 25 | ])), 26 | 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ 27 | 'ADMIN_EMAIL' => 'admin@example.com', 28 | 'ADMIN_PASSWORD' => '123123q', 29 | 'ADMIN_URL' => 'admin' 30 | ])), 31 | 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ 32 | 'hooks' => [ 33 | 'build' => 'set -e 34 | php ./vendor/bin/ece-tools run scenario/build/generate.xml 35 | php ./vendor/bin/ece-tools run scenario/build/transfer.xml', 36 | 'deploy' => 'php ./vendor/bin/ece-tools run scenario/deploy.xml', 37 | 'post_deploy' => 'php ./vendor/bin/ece-tools run scenario/post-deploy.xml' 38 | ], 39 | 'mounts' => [ 40 | 'var' => [ 41 | 'path' => 'var' 42 | ], 43 | 'app-etc' => [ 44 | 'path' => 'app/etc' 45 | ], 46 | 'pub-media' => [ 47 | 'path' => 'pub/media' 48 | ], 49 | 'pub-static' => [ 50 | 'path' => 'pub/static' 51 | ] 52 | ] 53 | ])), 54 | ]; 55 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_base/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_base_native/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_cloud_base_native/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_base_native/.docker/config.php.dist: -------------------------------------------------------------------------------- 1 | base64_encode(json_encode([ 5 | 'database' => [ 6 | [ 7 | 'host' => 'db', 8 | 'path' => 'magento2', 9 | 'password' => 'magento2', 10 | 'username' => 'magento2', 11 | 'port' => '3306', 12 | 'type' => 'mysql:10.0' 13 | ] 14 | ] 15 | ])), 16 | 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ 17 | 'http://magento2.test:8080/' => [ 18 | 'type' => 'upstream', 19 | 'original_url' => 'http://{default}' 20 | ], 21 | 'https://magento2.test:8080/' => [ 22 | 'type' => 'upstream', 23 | 'original_url' => 'https://{default}' 24 | ] 25 | ])), 26 | 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ 27 | 'ADMIN_EMAIL' => 'admin@example.com', 28 | 'ADMIN_PASSWORD' => '123123q', 29 | 'ADMIN_URL' => 'admin' 30 | ])), 31 | 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ 32 | 'hooks' => [ 33 | 'build' => 'set -e 34 | php ./vendor/bin/ece-tools run scenario/build/generate.xml 35 | php ./vendor/bin/ece-tools run scenario/build/transfer.xml', 36 | 'deploy' => 'php ./vendor/bin/ece-tools run scenario/deploy.xml', 37 | 'post_deploy' => 'php ./vendor/bin/ece-tools run scenario/post-deploy.xml' 38 | ], 39 | 'mounts' => [ 40 | 'var' => [ 41 | 'path' => 'var' 42 | ], 43 | 'app-etc' => [ 44 | 'path' => 'app/etc' 45 | ], 46 | 'pub-media' => [ 47 | 'path' => 'pub/media' 48 | ], 49 | 'pub-static' => [ 50 | 'path' => 'pub/static' 51 | ] 52 | ] 53 | ])), 54 | ]; 55 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_base_native/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_custom_images/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_cloud_custom_images/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_custom_images/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_tls_service/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_cloud_no_tls_service/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_tls_service/.docker/config.php.dist: -------------------------------------------------------------------------------- 1 | base64_encode(json_encode([ 5 | 'database' => [ 6 | [ 7 | 'host' => 'db', 8 | 'path' => 'magento2', 9 | 'password' => 'magento2', 10 | 'username' => 'magento2', 11 | 'port' => '3306', 12 | 'type' => 'mysql:10.0' 13 | ] 14 | ] 15 | ])), 16 | 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ 17 | 'http://magento2.docker/' => [ 18 | 'type' => 'upstream', 19 | 'original_url' => 'http://{default}' 20 | ], 21 | 'https://magento2.docker/' => [ 22 | 'type' => 'upstream', 23 | 'original_url' => 'https://{default}' 24 | ] 25 | ])), 26 | 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ 27 | 'ADMIN_EMAIL' => 'admin@example.com', 28 | 'ADMIN_PASSWORD' => '123123q', 29 | 'ADMIN_URL' => 'admin' 30 | ])), 31 | 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ 32 | 'hooks' => [ 33 | 34 | ], 35 | 'mounts' => [ 36 | 37 | ] 38 | ])), 39 | ]; 40 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_tls_service/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/.docker/config.php.dist: -------------------------------------------------------------------------------- 1 | base64_encode(json_encode([ 5 | 'database' => [ 6 | [ 7 | 'host' => 'db', 8 | 'path' => 'magento2', 9 | 'password' => 'magento2', 10 | 'username' => 'magento2', 11 | 'port' => '3306', 12 | 'type' => 'mysql:10.0' 13 | ] 14 | ] 15 | ])), 16 | 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ 17 | 'http://magento2.docker/' => [ 18 | 'type' => 'upstream', 19 | 'original_url' => 'http://{default}' 20 | ], 21 | 'https://magento2.docker/' => [ 22 | 'type' => 'upstream', 23 | 'original_url' => 'https://{default}' 24 | ] 25 | ])), 26 | 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ 27 | 'ADMIN_EMAIL' => 'admin@example.com', 28 | 'ADMIN_PASSWORD' => '123123q', 29 | 'ADMIN_URL' => 'admin' 30 | ])), 31 | 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ 32 | 'hooks' => [ 33 | 34 | ], 35 | 'mounts' => [ 36 | 37 | ] 38 | ])), 39 | ]; 40 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_varnish_service/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_cloud_no_varnish_service/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_varnish_service/.docker/config.php.dist: -------------------------------------------------------------------------------- 1 | base64_encode(json_encode([ 5 | 'database' => [ 6 | [ 7 | 'host' => 'db', 8 | 'path' => 'magento2', 9 | 'password' => 'magento2', 10 | 'username' => 'magento2', 11 | 'port' => '3306', 12 | 'type' => 'mysql:10.0' 13 | ] 14 | ] 15 | ])), 16 | 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ 17 | 'http://magento2.docker/' => [ 18 | 'type' => 'upstream', 19 | 'original_url' => 'http://{default}' 20 | ], 21 | 'https://magento2.docker/' => [ 22 | 'type' => 'upstream', 23 | 'original_url' => 'https://{default}' 24 | ] 25 | ])), 26 | 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ 27 | 'ADMIN_EMAIL' => 'admin@example.com', 28 | 'ADMIN_PASSWORD' => '123123q', 29 | 'ADMIN_URL' => 'admin' 30 | ])), 31 | 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ 32 | 'hooks' => [ 33 | 34 | ], 35 | 'mounts' => [ 36 | 37 | ] 38 | ])), 39 | ]; 40 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_cloud_no_varnish_service/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_registry/.docker/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/src/Test/Integration/_files/custom_registry/.docker/.gitignore -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_registry/.magento.app.yaml: -------------------------------------------------------------------------------- 1 | name: magento 2 | 3 | type: php:8.0 4 | build: 5 | flavor: composer 6 | 7 | runtime: 8 | extensions: 9 | - redis 10 | - xsl 11 | - json 12 | - newrelic 13 | - sodium 14 | 15 | relationships: 16 | database: "mysql:mysql" 17 | redis: "redis:redis" 18 | elasticsearch: "elasticsearch:elasticsearch" 19 | 20 | mounts: 21 | "var": "shared:files/var" 22 | "app/etc": "shared:files/etc" 23 | "pub/media": "shared:files/media" 24 | "pub/static": "shared:files/static" 25 | 26 | crons: 27 | cronrun: 28 | spec: "* * * * *" 29 | cmd: "php bin/magento cron:run" 30 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_registry/.magento/services.yaml: -------------------------------------------------------------------------------- 1 | mysql: 2 | type: mysql:10.2 3 | disk: 2048 4 | 5 | redis: 6 | type: redis:5.0 7 | 8 | elasticsearch: 9 | type: elasticsearch:6.5 10 | disk: 1024 11 | configuration: 12 | plugins: 13 | - plugin_1 14 | - plugin_2 15 | -------------------------------------------------------------------------------- /src/Test/Integration/_files/custom_registry/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-enterprise-edition", 3 | "description": "Composer file for integration tests", 4 | "type": "project", 5 | "version": "2.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /src/Test/Unit/Config/Environment/ConverterTest.php: -------------------------------------------------------------------------------- 1 | converter = new Converter(); 29 | } 30 | 31 | public function testConvert() 32 | { 33 | $this->assertSame( 34 | [ 35 | 'MAGENTO_RUN_MODE=production', 36 | 'DEBUG=false', 37 | 'PHP_ENABLE_XDEBUG=true', 38 | ], 39 | $this->converter->convert([ 40 | 'MAGENTO_RUN_MODE' => 'production', 41 | 'DEBUG' => false, 42 | 'PHP_ENABLE_XDEBUG' => true, 43 | ]) 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Running tests 2 | 3 | ## Test suites 4 | 5 | This way will run next tests: 6 | 7 | - Static tests, including PHPMD and PHPCS 8 | - All unit tests 9 | - Code coverage test 10 | 11 | This is the best way to run tests locally. 12 | 13 | 1. Navigate to working directory 14 | 2. Run `composer test` and verify results 15 | 16 | ## Unit tests 17 | 18 | To run unit tests, specify the configuration file in the following command: 19 | 20 | ``` 21 | ./vendor/bin/phpunit --configuration tests/unit 22 | ``` 23 | 24 | ## Static tests 25 | 26 | 1. Run PHPCS test with following command: 27 | ``` 28 | ./vendor/bin/phpcs src --standard=tests/static/phpcs-ruleset.xml -p -n 29 | ``` 30 | 2. Run PHPMD tests withfollowing command: 31 | ``` 32 | ./vendor/bin/phpmd src xml tests/static/phpmd-ruleset.xml 33 | ``` 34 | 35 | ## Code coverage check 36 | 37 | This test will generate a pretty report for unit test coverage. 38 | 39 | 1. Run the command `composer test-coverage` 40 | 2. Observe result in CLI output 41 | - Be sure to enable [xDebug](http://devdocs.magento.com/guides/v2.2/cloud/howtos/debug.html) for this test 42 | 43 | ## Code coverage report 44 | 45 | This test will generate a pretty report for unit test coverage. 46 | 47 | 1. Run the command `composer test-coverage-generate` 48 | 2. Navigate to `tests/unit/tmp/coverage` and open `index.html` file in browser 49 | - Be sure to enable [xDebug](http://devdocs.magento.com/guides/v2.2/cloud/howtos/debug.html) for this test 50 | 51 | ## Best practices 52 | 53 | - After you setup PhpStorm with PhpUnit and PHPCS, etc, it sometimes runs really slow. But, there is an icon in the bottom right corner of PhpStorm you can click on (it looks like Travis) that will let you temporarily disable inspections. 54 | 55 | -------------------------------------------------------------------------------- /tests/functional/Robo/Tasks/Bash.php: -------------------------------------------------------------------------------- 1 | command = $command; 32 | } 33 | 34 | /** 35 | * @inheritdoc 36 | */ 37 | public function getCommand(): string 38 | { 39 | return sprintf('docker-compose %s', $this->command); 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function run(): Result 46 | { 47 | return $this->executeCommand($this->getCommand()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tests/functional/Robo/Tasks/EnvCleanUp.php: -------------------------------------------------------------------------------- 1 | volumes = $volumes; 34 | } 35 | 36 | /** 37 | * @inheritdoc 38 | */ 39 | public function getCommand(): string 40 | { 41 | $commands = [ 42 | 'docker-compose down -v --remove-orphans', 43 | ]; 44 | 45 | foreach ($this->volumes as $volume) { 46 | $commands[] = sprintf( 47 | 'docker-compose run %s bash -c "mkdir -p %s"', 48 | Docker::BUILD_CONTAINER, 49 | $volume 50 | ); 51 | } 52 | 53 | $commands[] = 'docker-compose up -d build'; 54 | 55 | return implode(' && ', $commands); 56 | } 57 | 58 | /** 59 | * @inheritdoc 60 | */ 61 | public function run(): Result 62 | { 63 | return $this->executeCommand($this->getCommand()); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /tests/functional/Robo/Tasks/EnvDown.php: -------------------------------------------------------------------------------- 1 | getCommand(); 41 | $command .= $this->keepVolumes ? '' : ' -v'; 42 | 43 | return $this->executeCommand($command); 44 | } 45 | 46 | /** 47 | * @param bool $value 48 | * @return EnvDown 49 | */ 50 | public function keepVolumes(bool $value = true): self 51 | { 52 | $this->keepVolumes = $value; 53 | 54 | return $this; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/functional/Robo/Tasks/EnvUp.php: -------------------------------------------------------------------------------- 1 | executeCommand($this->getCommand()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/functional/Robo/Tasks/GenerateDockerCompose.php: -------------------------------------------------------------------------------- 1 | services = $services; 38 | } 39 | 40 | /** 41 | * @inheritdoc 42 | */ 43 | public function getCommand(): string 44 | { 45 | $command = './vendor/bin/ece-docker build:compose --mode=functional'; 46 | 47 | foreach ($this->services as $service => $version) { 48 | $command .= sprintf(' --%s=%s', $service, $version); 49 | } 50 | 51 | return $command; 52 | } 53 | 54 | /** 55 | * @inheritdoc 56 | */ 57 | public function run(): Result 58 | { 59 | return $this->executeCommand($this->getCommand()); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /tests/functional/Robo/Tasks/RemoveDockerCompose.php: -------------------------------------------------------------------------------- 1 | executeCommand($this->getCommand()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/functional/_data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-docker/bdac8ec07f6a218872565f0ce39739ee5f2f57b9/tests/functional/_data/.gitkeep -------------------------------------------------------------------------------- /tests/functional/_output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/functional/_support/.gitignore: -------------------------------------------------------------------------------- 1 | /_generated 2 | -------------------------------------------------------------------------------- /tests/functional/_support/CliTester.php: -------------------------------------------------------------------------------- 1 | 'testFailed' 21 | ]; 22 | 23 | /** 24 | * Method to handle failed tests. 25 | * @param \Codeception\Event\FailEvent $e 26 | */ 27 | public function testFailed(FailEvent $e) { 28 | $failure = $e->getFail(); 29 | $this->writeln('------------------------------------'); 30 | $this->writeln('Message: ' . $failure->getMessage()); 31 | $this->writeln('------------------------------------'); 32 | $this->writeln('Stack Trace: '); 33 | $this->writeln($failure->getTraceAsString()); 34 | $this->writeln('------------------------------------'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/functional/configuration.dist.yml: -------------------------------------------------------------------------------- 1 | Magento: 2 | docker: 3 | settings: 4 | db: 5 | host: '127.0.0.1' 6 | port: '3306' 7 | username: 'magento2' 8 | password: 'magento2' 9 | path: 'magento2' 10 | db_quote: 11 | port: '3307' 12 | db_sales: 13 | port: '3308' 14 | system: 15 | magento_dir: '/app' 16 | env: 17 | url: 18 | base: 'http://magento2.docker/' 19 | secure_base: 'https://magento2.docker/' 20 | -------------------------------------------------------------------------------- /tests/integration/Container.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | ../../src/Test/Integration 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/static/Sniffs/Whitespace/MultipleEmptyLinesSniff.php: -------------------------------------------------------------------------------- 1 | getTokens(); 32 | if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) 33 | || $phpcsFile->hasCondition($stackPtr, T_CLASS) 34 | || $phpcsFile->hasCondition($stackPtr, T_INTERFACE) 35 | ) { 36 | if ($tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] 37 | && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] 38 | ) { 39 | // This is an empty line and the line before this one is not 40 | // empty, so this could be the start of a multiple empty line block 41 | $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); 42 | $lines = $tokens[$next]['line'] - $tokens[$stackPtr]['line']; 43 | if ($lines > 1) { 44 | $error = 'Code must not contain multiple empty lines in a row; found %s empty lines'; 45 | $data = [$lines]; 46 | $phpcsFile->addError($error, $stackPtr, 'MultipleEmptyLines', $data); 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /tests/static/phpcs-ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Custom Magento ECE Tools coding standard. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | _files 29 | _file 30 | 31 | -------------------------------------------------------------------------------- /tests/static/phpstan.neon: -------------------------------------------------------------------------------- 1 | parameters: 2 | level: 5 3 | paths: 4 | - ../../src 5 | excludePaths: 6 | - ../../src/Test/* 7 | reportUnmatchedIgnoredErrors: false 8 | ignoreErrors: 9 | - message: "#.*Ternary operator condition is always true*#" 10 | path: ../../src/Command/Image/GeneratePhp.php 11 | 12 | -------------------------------------------------------------------------------- /tests/unit/.gitignore: -------------------------------------------------------------------------------- 1 | /phpunit.xml 2 | -------------------------------------------------------------------------------- /tests/unit/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | ../../src/Test/Unit 13 | 14 | 15 | 16 | 17 | ../../src 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | --------------------------------------------------------------------------------