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

Commit 86c396d

Browse files
author
Alexander Paliarush
committed
- Added support of Rabbit MQ
- Added possibility to specify tokens for repo.magento.com composer repository - Fixed virtual hosts configuration to be compatible with Apache 2.4 - git is now installed by default
1 parent d8b0d27 commit 86c396d

File tree

5 files changed

+44
-9
lines changed

5 files changed

+44
-9
lines changed

install_environment.sh

+6
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,9 @@ if [ ${is_windows_host} -eq 1 ]; then
8484
chown -R vagrant:vagrant /var/www
8585
chmod -R 755 /var/www
8686
fi
87+
88+
# Install RabbitMQ (is used by Enterprise edition)
89+
apt-get install -y rabbitmq-server
90+
rabbitmq-plugins enable rabbitmq_management
91+
invoke-rc.d rabbitmq-server stop
92+
invoke-rc.d rabbitmq-server start

install_magento.sh

+22-6
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,23 @@ 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+
4245
# Install Magento application
4346
cd ${magento_dir}
44-
github_token="/vagrant/local.config/github.oauth.token"
45-
if [ -f ${github_token} ]; then
47+
composer_auth_json="/vagrant/local.config/composer/auth.json"
48+
if [ -f ${composer_auth_json} ]; then
4649
set +x
47-
echo "Installing GitHub OAuth token from ${github_token}..."
48-
composer config -g github-oauth.github.com `cat ${github_token}`
50+
echo "Installing composer OAuth tokens from ${composer_auth_json}..."
4951
set -x
50-
composer install
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'
5157
else
52-
composer install --prefer-source
58+
sudo -H -u vagrant bash -c 'composer install --prefer-source'
5359
fi
5460

5561
admin_frontame="admin"
@@ -69,6 +75,16 @@ install_cmd="./bin/magento setup:install \
6975
--admin-password=123123q \
7076
--cleanup-database \
7177
--use-rewrites=1"
78+
79+
# Configure Rabbit MQ
80+
if [ -d "${magento_dir}/app/code/Magento/Amqp" ]; then
81+
install_cmd="${install_cmd} \
82+
--amqp-host=localhost \
83+
--amqp-port=5672 \
84+
--amqp-user=guest \
85+
--amqp-password=guest"
86+
fi
87+
7288
chmod +x bin/magento
7389
php ${install_cmd}
7490

local.config/.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/*
2-
!/.gitignore
2+
!/.gitignore
3+
!/composer
4+
/composer/*
5+
!/composer/auth.json.dist

local.config/composer/auth.json.dist

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"github-oauth": {
3+
"github.com": "your-github-token"
4+
},
5+
"http-basic": {
6+
"repo.magento.com": {
7+
"username": "your-magento-repo-public-key",
8+
"password": "your-magento-repo-secret-key"
9+
}
10+
}
11+
}

magento2.vhost.conf

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<Directory /var/www/magento2ce>
55
Options Indexes FollowSymLinks
66
AllowOverride All
7-
Order allow,deny
8-
Allow from all
7+
Require all granted
98
</Directory>
109
ErrorLog "${APACHE_LOG_DIR}/error.log"
1110
CustomLog "${APACHE_LOG_DIR}/access.log" common

0 commit comments

Comments
 (0)