Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit d74d70c

Browse files
author
Alexander Paliarush
committed
- Increased virtual box memory to 3GB to support tests
- Composer initialization and git installation moved to install_environment.sh
1 parent 86c396d commit d74d70c

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

Vagrantfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Vagrant.configure(2) do |config|
1515
config.vm.box = "ubuntu/trusty64"
1616

1717
config.vm.provider "virtualbox" do |vb|
18-
vb.memory = 2048
18+
vb.memory = 3072 # Around 3Gb is necessary to be able to run tests
1919
end
2020
config.vm.network :private_network, ip: '192.168.10.11'
2121
config.vm.hostname = "magento2.vagrant"

install_environment.sh

+15
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,28 @@ sed -i '/\[client\]/a \
6868
user = root \
6969
password =' /etc/mysql/my.cnf
7070

71+
# Install git
72+
apt-get install -y git
73+
7174
# Setup Composer
7275
if [ ! -f /usr/local/bin/composer ]; then
7376
cd /tmp
7477
curl -sS https://getcomposer.org/installer | php
7578
mv composer.phar /usr/local/bin/composer
7679
fi
7780

81+
# Configure composer
82+
composer_auth_json="/vagrant/local.config/composer/auth.json"
83+
if [ -f ${composer_auth_json} ]; then
84+
set +x
85+
echo "Installing composer OAuth tokens from ${composer_auth_json}..."
86+
set -x
87+
if [ ! -d /home/vagrant/.composer ] ; then
88+
sudo -H -u vagrant bash -c 'mkdir /home/vagrant/.composer'
89+
fi
90+
cp ${composer_auth_json} /home/vagrant/.composer/auth.json
91+
fi
92+
7893
# Declare path to scripts supplied with vagrant and Magento
7994
magento_dir="/var/www/magento2ce"
8095
echo "export PATH=\$PATH:/vagrant/bin:${magento_dir}/bin" >> /etc/profile

install_magento.sh

+1-17
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,8 @@ for db_name in "${db_names[@]}"; do
3939
mysql -e "drop database if exists ${db_name}; create database ${db_name};"
4040
done
4141

42-
# Install git
43-
apt-get install -y git
44-
4542
# Install Magento application
4643
cd ${magento_dir}
47-
composer_auth_json="/vagrant/local.config/composer/auth.json"
48-
if [ -f ${composer_auth_json} ]; then
49-
set +x
50-
echo "Installing composer OAuth tokens from ${composer_auth_json}..."
51-
set -x
52-
if [ ! -d /home/vagrant/.composer ] ; then
53-
sudo -H -u vagrant bash -c 'mkdir /home/vagrant/.composer'
54-
fi
55-
cp ${composer_auth_json} /home/vagrant/.composer/auth.json
56-
sudo -H -u vagrant bash -c 'composer install'
57-
else
58-
sudo -H -u vagrant bash -c 'composer install --prefer-source'
59-
fi
6044

6145
admin_frontame="admin"
6246
install_cmd="./bin/magento setup:install \
@@ -77,7 +61,7 @@ install_cmd="./bin/magento setup:install \
7761
--use-rewrites=1"
7862

7963
# Configure Rabbit MQ
80-
if [ -d "${magento_dir}/app/code/Magento/Amqp" ]; then
64+
if [ -f "${magento_dir}/app/code/Magento/Amqp/registration.php" ]; then
8165
install_cmd="${install_cmd} \
8266
--amqp-host=localhost \
8367
--amqp-port=5672 \

0 commit comments

Comments
 (0)