Skip to content

Commit b2364a0

Browse files
author
Bohdan Korablov
authored
Merge pull request #194 from magento/develop
Merge develop into 2002.0
2 parents ccdc265 + 10c8071 commit b2364a0

File tree

208 files changed

+8424
-1736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+8424
-1736
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
auth.json
3+
.git
4+
vendor

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.idea
22
vendor
33
composer.phar
4-
phpunit.xml
54
composer.lock
65
.DS_Store
6+
app

.travis.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,5 @@ cache:
3333
- $HOME/.composer/cache
3434
before_install: ./tests/travis/before_install.sh
3535
install: composer install --no-interaction
36-
script:
37-
- if [ $TEST_SUITE == "static" ]; then phpcs src --standard=tests/static/phpcs-ruleset.xml -p -n; fi;
38-
- if [ $TEST_SUITE == "static" ]; then phpmd src xml tests/static/phpmd-ruleset.xml; fi;
39-
- if [ $TEST_SUITE == "static" ]; then phpunit --configuration tests/unit/phpunit.xml.dist --coverage-clover tests/unit/tmp/clover.xml && php tests/unit/code-coverage.php tests/unit/tmp/clover.xml $MIN_CODE_COVERAGE; fi;
40-
- if [ $TEST_SUITE == "unit" ]; then phpunit --configuration tests/unit/phpunit.xml.dist; fi;
41-
- if [ $TEST_SUITE == "integration" ]; then phpunit --verbose --configuration tests/integration/phpunit.xml.dist; fi;
42-
- if [ $TEST_SUITE == "integration-docker" ]; then cd tests/integration-docker && docker-compose run cli magento-command; fi;
36+
before_script: ./tests/travis/before_script.sh
37+
script: ./tests/travis/script.sh

bootstrap.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,4 @@
1111
$handler = new \Magento\MagentoCloud\App\ErrorHandler();
1212
set_error_handler([$handler, 'handle']);
1313

14-
$config = $_SERVER['DIRS_CONFIG'] ?? [];
15-
16-
return new \Magento\MagentoCloud\App\Container(
17-
new \Magento\MagentoCloud\Filesystem\DirectoryList(ECE_BP, BP, $config)
18-
);
14+
return new \Magento\MagentoCloud\App\Container(ECE_BP, BP);

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"require": {
1010
"php": "^7.0",
11-
"monolog/monolog": "^1.17",
11+
"monolog/monolog": "^1.16",
1212
"symfony/console": "^2.6",
1313
"illuminate/contracts": "^5.5",
1414
"illuminate/container": "^5.5",
@@ -17,7 +17,7 @@
1717
"psr/container": "^1.0",
1818
"composer/composer": "@stable",
1919
"composer/semver": "^1.4",
20-
"symfony/yaml": "^3.3"
20+
"symfony/yaml": "^2.3||^3.3"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "~6.2.0",
@@ -26,6 +26,10 @@
2626
"php-mock/php-mock-phpunit": "^2.0",
2727
"phpunit/php-code-coverage": "^5.2"
2828
},
29+
"replace": {
30+
"magento/ece-patches": "*",
31+
"magento/magento-cloud-configuration": "*"
32+
},
2933
"bin": [
3034
"bin/ece-tools",
3135
"m2-ece-build",

tests/integration-docker/docker-compose.yml docker-compose.yml

+23-26
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,31 @@
1-
version: "2"
1+
version: '2'
22
services:
3-
web:
4-
build: ./nginx
5-
ports:
6-
- 80
7-
links:
8-
- fpm
9-
- db
10-
volumes_from:
11-
- appdata
12-
env_file:
13-
- ./global.env
14-
environment:
15-
- VIRTUAL_HOST=magento2.docker
16-
- VIRTUAL_PORT=80
17-
- HTTPS_METHOD=noredirect
18-
193
fpm:
204
hostname: fpm.magento2.docker
21-
build: ./7.0-fpm
5+
build: ./docker/7.0-fpm
226
ports:
237
- 9000
248
links:
259
- db
2610
volumes_from:
2711
- appdata
2812
env_file:
29-
- ./global.env
13+
- ./docker/global.env
14+
- ./docker/composer.env
3015

3116
cli:
3217
hostname: cli.magento2.docker
33-
build: ./7.0-cli
18+
build: ./docker/7.0-cli
3419
links:
3520
- db
21+
# This must be uncommented once std integration plan is removed
22+
# volumes:
23+
# - ~/.composer/cache:/root/.composer/cache
3624
volumes_from:
3725
- appdata
3826
env_file:
39-
- ./global.env
40-
- ./composer.env
41-
environment:
42-
- M2SETUP_VERSION=2.2.*
27+
- ./docker/global.env
28+
- ./docker/composer.env
4329

4430
db:
4531
image: mariadb:10
@@ -52,12 +38,23 @@ services:
5238
- MYSQL_DATABASE=magento2
5339
- MYSQL_USER=magento2
5440
- MYSQL_PASSWORD=magento2
55-
- TERM=meh
41+
42+
web:
43+
build: ./docker/nginx
44+
ports:
45+
- "8080:80"
46+
links:
47+
- fpm
48+
- db
49+
volumes_from:
50+
- appdata
51+
env_file:
52+
- ./docker/global.env
5653

5754
appdata:
5855
image: tianon/true
5956
volumes:
60-
- ./magento:/var/www/magento
57+
- .:/var/www/magento
6158

6259
dbdata:
6360
image: tianon/true
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/magento
21
composer.env

tests/integration-docker/7.0-cli/Dockerfile docker/7.0-cli/Dockerfile

-12
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ ENV PHP_ENABLE_XDEBUG false
4242
ENV MAGENTO_ROOT /var/www/magento
4343

4444
ENV DEBUG false
45-
ENV UPDATE_UID_GID false
4645

4746
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
4847
ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini
@@ -54,11 +53,6 @@ RUN ["chmod", "+x", "/docker-entrypoint.sh"]
5453
ENTRYPOINT ["/docker-entrypoint.sh"]
5554

5655
ENV COMPOSER_ALLOW_SUPERUSER 1
57-
ENV COMPOSER_GITHUB_TOKEN ""
58-
ENV COMPOSER_MAGENTO_USERNAME ""
59-
ENV COMPOSER_MAGENTO_PASSWORD ""
60-
ENV COMPOSER_BITBUCKET_KEY ""
61-
ENV COMPOSER_BITBUCKET_SECRET ""
6256

6357
VOLUME /root/.composer/cache
6458

@@ -67,10 +61,4 @@ ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini
6761
# Get composer installed to /usr/local/bin/composer
6862
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
6963

70-
ADD bin/* /usr/local/bin/
71-
72-
RUN ["chmod", "+x", "/usr/local/bin/magento-installer"]
73-
RUN ["chmod", "+x", "/usr/local/bin/magento-command"]
74-
RUN ["chmod", "+x", "/usr/local/bin/run-cron"]
75-
7664
CMD ["bash"]

docker/7.0-cli/docker-entrypoint.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
[ "$DEBUG" = "true" ] && set -x
4+
5+
# Ensure our Magento directory exists
6+
mkdir -p $MAGENTO_ROOT
7+
chown www-data:www-data $MAGENTO_ROOT
8+
9+
# Configure Sendmail if required
10+
if [ "$ENABLE_SENDMAIL" == "true" ]; then
11+
/etc/init.d/sendmail start
12+
fi
13+
14+
# Substitute in php.ini values
15+
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" /usr/local/etc/php/conf.d/zz-magento.ini
16+
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" /usr/local/etc/php/conf.d/zz-magento.ini
17+
18+
[ "$PHP_ENABLE_XDEBUG" = "true" ] && \
19+
docker-php-ext-enable xdebug && \
20+
echo "Xdebug is enabled"
21+
22+
# Configure composer
23+
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \
24+
composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN
25+
26+
[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \
27+
composer config --global http-basic.repo.magento.com \
28+
$COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD
29+
30+
exec "$@"
31+
File renamed without changes.

tests/integration-docker/7.0-fpm/Dockerfile docker/7.0-fpm/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ ENV PHP_ENABLE_XDEBUG false
3838
ENV MAGENTO_ROOT /var/www/magento
3939

4040
ENV DEBUG false
41-
ENV UPDATE_UID_GID false
4241

4342
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
4443
ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini

docker/7.0-fpm/docker-entrypoint.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
[ "$DEBUG" = "true" ] && set -x
4+
5+
# Ensure our Magento directory exists
6+
mkdir -p $MAGENTO_ROOT
7+
chown www-data:www-data $MAGENTO_ROOT
8+
9+
# Configure Sendmail if required
10+
if [ "$ENABLE_SENDMAIL" == "true" ]; then
11+
/etc/init.d/sendmail start
12+
fi
13+
14+
# Substitute in php.ini values
15+
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" /usr/local/etc/php/conf.d/zz-magento.ini
16+
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" /usr/local/etc/php/conf.d/zz-magento.ini
17+
18+
[ "$PHP_ENABLE_XDEBUG" = "true" ] && \
19+
docker-php-ext-enable xdebug && \
20+
echo "Xdebug is enabled"
21+
22+
# Configure PHP-FPM
23+
[ ! -z "${MAGENTO_RUN_MODE}" ] && sed -i "s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE}/" /usr/local/etc/php-fpm.conf
24+
25+
exec "$@"
26+
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
COMPOSER_GITHUB_TOKEN=0000000000000000000000000000000000000000
22
COMPOSER_MAGENTO_USERNAME=00000000000000000000000000000000
33
COMPOSER_MAGENTO_PASSWORD=00000000000000000000000000000000
4-
COMPOSER_BITBUCKET_KEY=000000000000000000
5-
COMPOSER_BITBUCKET_SECRET=00000000000000000000000000000000

tests/integration-docker/global.env docker/global.env

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
MAGENTO_RUN_MODE=developer
1+
MAGENTO_RUN_MODE=production
22
PHP_MEMORY_LIMIT=2048M
33
PHP_ENABLE_XDEBUG=false
4-
UPDATE_UID_GID=true
54
DEBUG=false
65
ENABLE_SENDMAIL=true
76
UPLOAD_MAX_FILESIZE=64M

tests/integration-docker/nginx/Dockerfile docker/nginx/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
FROM nginx:1.9
22

3+
RUN apt-get update \
4+
&& apt-get install -y \
5+
wget
6+
37
ADD etc/vhost.conf /etc/nginx/conf.d/default.conf
48
COPY etc/certs/ /etc/nginx/ssl/
59
ADD bin/* /usr/local/bin/

docker/nginx/etc/vhost.conf

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
upstream fastcgi_backend {
2+
server !FPM_HOST!:!FPM_PORT!;
3+
}
4+
server {
5+
listen 80;
6+
listen 443 ssl;
7+
8+
set $MAGE_ROOT !MAGENTO_ROOT!;
9+
set $MAGE_MODE !MAGENTO_RUN_MODE!;
10+
11+
index index.php index.html;
12+
server_name magento2.docker;
13+
error_log /var/log/nginx/error.log;
14+
access_log /var/log/nginx/access.log;
15+
root $MAGE_ROOT/app/pub;
16+
17+
location ~ \.php$ {
18+
try_files $uri =404;
19+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
20+
fastcgi_pass fpm:9000;
21+
fastcgi_index index.php;
22+
include fastcgi_params;
23+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24+
fastcgi_param PATH_INFO $fastcgi_path_info;
25+
}
26+
}

0 commit comments

Comments
 (0)