-
Notifications
You must be signed in to change notification settings - Fork 196
MAGECLOUD-4004: Move Docker-related functionality to separate package #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
define('ECE_BP', BP); | ||
} | ||
|
||
foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will look better
foreach ([ '/../../autoload.php', '/vendor/autoload.php'] as $file) {
if (file_exists(__DIR__.$file)) {
return require $file;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You won't be able to navigate to those files from IDE
dist/bin/docker
Outdated
@@ -0,0 +1,63 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think will be better if you change the name of this file to docker.sh
or mc-docker
Because the current name can be confused with docker
command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be BC change, as we already released this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually submitted a Jira ticket about this as well. This file creates some really frustrating conflicts if you add your project's bin directory to $PATH
. It's not just confusing; it actually breaks things.
@@ -0,0 +1,149 @@ | |||
FROM php:7.3-fpm-stretch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the image php:7.3-cli-stretch
has problems with libsodium too
$ docker run -it php:7.3-cli-stretch bash
root@92cc980b6e64:/# php -v
PHP 7.3.7 (cli) (built: Jul 17 2019 22:25:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
root@92cc980b6e64:/# php -i | grep libsodium
libsodium headers version => 1.0.11
libsodium library version => 1.0.11
root@92cc980b6e64:/# php -r 'echo SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13;'
Warning: Use of undefined constant SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 - assumed 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13' (this will throw an Error in a future version of PHP) in Command line code on line 1
SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
images/php/php-extensions.php
Outdated
pecl install -o -f libsodium | ||
BASH | ||
], | ||
'~7.2.0' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change the value of constraint because the image php:7.3-cli-stretch
also has an outdated library libsodium.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/Command/BuildCompose.php
Outdated
[ComposeFactory::COMPOSE_DEVELOPER, ComposeFactory::COMPOSE_PRODUCTION], | ||
false | ||
)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete empty line, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/Compose/PhpExtension.php
Outdated
/** | ||
* Extensions which can be installed or uninstalled | ||
*/ | ||
const AVAILABLE_PHP_EXTENSIONS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this constant can be deleted since this information is contained in the file 'images/php/php-extensions.php'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in this class. It seems like separate task
'soap' => '>=7.0', | ||
'sockets' => '>=7.0', | ||
'sodium' => '>=7.0', | ||
'ssh2' => '>=7.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must be indicated that the package is not available for PHP 7.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
* See COPYING.txt for license details. | ||
*/ | ||
error_reporting(E_ALL); | ||
date_default_timezone_set('UTC'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we setting a timezone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always good to set timezone in the beginning of php script to not depend on user settings.
images/php/cli/bin/cloud-build
Outdated
|
||
[ "$DEBUG" = "true" ] && set -x | ||
|
||
MAGENTO_COMMAND="magento-command" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could be missing something, but I can't see how this variable is used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, removed
src/Command/Image/GeneratePhp.php
Outdated
|
||
use Composer\Semver\Constraint\Constraint; | ||
use Composer\Semver\Semver; | ||
use Composer\Semver\VersionParser; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/Command/Image/GeneratePhp.php
Outdated
namespace Mcd\Command\Generate; | ||
declare(strict_types=1); | ||
|
||
namespace Magento\CloudDocker\Command\Image; | ||
|
||
use Composer\Semver\Constraint\Constraint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/Command/Image/GeneratePhp.php
Outdated
@@ -87,26 +94,33 @@ class Php extends Command | |||
/** | |||
* @var VersionParser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Semver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
"ext-json": "*", | ||
"composer/semver": "^1.0", | ||
"illuminate/config": "^5.5", | ||
"illuminate/filesystem": "^5.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should consider using symfony/filesystem
since it's already included with ECE tools, and would thus cut down on the number of extra dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It lacks a bunch of methods that the previous implementation was relying on
QA approved |
Description
Fixed Issues (if relevant)
Manual testing scenarios
!!! Use branch https://github.com/magento/ece-tools/tree/MAGECLOUD-4004
!!!
./vendor/bin/ece-docker build:compose
is equivalent to./vendor/bin/ece-tools docker:build
Contribution checklist