Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 1dc76c6

Browse files
committed
Merge branch 'release/1.1.0'
2 parents d61b6ca + 8f4545d commit 1dc76c6

File tree

4 files changed

+74
-5
lines changed

4 files changed

+74
-5
lines changed

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,67 @@
1-
# fast-hypernode
1+
# Fast Hypernode Vagrant Box
2+
3+
**The fastest Magento Vagrant VM**
24
Fast Byte Hypernode Box (Uses nfs_guest plugin for file shares)
5+
6+
Based on images from https://github.com/byteinternet/hypernode-vagrant
7+
8+
# Installation
9+
10+
Installation is possible via composer:
11+
12+
```bash
13+
composer create-project --keep-vcs ecomdev/fast-hypernode
14+
```
15+
16+
17+
18+
# Required Vagrant plugins
19+
20+
* vagrant-hostmanager
21+
* vagrant-auto_network
22+
* vagrant-nfs_guest
23+
24+
25+
# Usage
26+
27+
1. Copy config.rb.dst to config.rb
28+
2. Edit it to reflect your project settings
29+
```ruby
30+
name 'your-project-name'
31+
hostname name + '.box' # will be your main url http://your-project-name.box/
32+
domains %w(www.your-project-name-additional.box) # additional domain names separated by space
33+
profiler true # Add tideways-profiler ?
34+
developer true # Enable development mode?
35+
directory 'server' # Directory into which NFS share will be mounted on your host
36+
```
37+
38+
# Configuration Options
39+
40+
* `name` - name of your node
41+
* `hostname` - default project hostname
42+
* `domains` - list of additional domain names for your project
43+
* `varnish` - enable or disable varnish for your project (default: `false`)
44+
* `profiler` - enable or disable tideways-profiler (default: `false`)
45+
* `developer` - enable or disable developer mode in Magento (default: `false`)
46+
* `magento2` - Magento 2.0 installment? (default: `false`)
47+
* `install` - Shall Magento be installed? (default: `false`, only Magento 2.0 installation supported)
48+
* `shell` - Install FishShell? (default: `false`)
49+
* `php7` - PHP7 instead of PHP5? (default: `false`)
50+
* `cpu` - number of CPUs to dedicate to your VM (default: `1`)
51+
* `memory` - memory in MB to dedicate to your VM (default: `1024`)
52+
* `user` - User name for nfs share permissions (default: `app`)
53+
* `group` - Group name for nfs share permissions (default: `app`)
54+
* `uid` - User ID of your host to be mapped to linux VM (default: `Process.euid`)
55+
* `gid` - Group ID of your host to be mapped to linux VM (default: `Process.egid`)
56+
* `directory` - Directory to be used as mount on host machine (default: `server`)
57+
* `network` - Network mast for automatical network assignment to VM (default: `33.33.33.0/24`)
58+
59+
# Adding custom shell provisioners
60+
61+
You can easily add more provision shell scripts from configuration file (config.rb):
62+
```ruby
63+
add_shell 'some-custom-shell-script.sh'
64+
65+
# Will provision only if PHP7 flag is turned on
66+
add_shell 'some-custom-script-for-php7.sh', :php7
67+
```

Vagrantfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ Vagrant.configure("2") do |config|
9292
VAGRANT_USER: box_config.get(:user),
9393
VAGRANT_GROUP: box_config.get(:group),
9494
VAGRANT_HOSTNAME: box_config.get(:hostname),
95-
VAGRANT_FPM_SERVICE: box_config.flag?(:php7) ? 'php7.0-fpm' : 'php5-fpm'
95+
VAGRANT_FPM_SERVICE: box_config.flag?(:php7) ? 'php7.0-fpm' : 'php5-fpm',
96+
VAGRNAT_PHP_ETC_DIR: box_config.flag?(:php7) ? '/etc/php/7.0/' : '/etc/php5/',
97+
VAGRNAT_PHP_PACKAGE_PREFIX: box_config.flag?(:php7) ? 'php7.0' : 'php5'
9698
}
9799
end
98100

vagrant/provisioning/hypernode.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ fi
3131
/usr/local/bin/n98-magerun -q self-update || true
3232
/usr/local/bin/n98-magerun2 -q self-update || true
3333

34+
usermod -a -G admin app
35+
3436
# Remove mysql user from cgroup limitation, as hardcoded ones during deployment of hypernode box swap all stuff out
3537
tee /etc/cgrules.conf <<"CONFIG"
3638
solr memory limited

vagrant/provisioning/profiler.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AS_USER="sudo -u ${VAGRANT_USER}"
66
CUR_DIR=$(pwd)
77
HOME_DIR=$(getent passwd ${VAGRANT_USER} | cut -d ':' -f6)
88

9-
apt-get install php-pear php5-dev graphviz build-essential -y -q
9+
apt-get install ${VAGRNAT_PHP_PACKAGE_PREFIX}-dev graphviz build-essential -y -q
1010

1111
[ -d $HOME_DIR/tideways-profiler ] || $AS_USER mkdir $HOME_DIR/tideways-profiler
1212
[ -d $HOME_DIR/tideways-profiler/.git ] || $AS_USER git clone https://github.com/tideways/php-profiler-extension.git $HOME_DIR/tideways-profiler
@@ -36,13 +36,13 @@ if (!empty($_SERVER['PHP_PROFILE']) || !empty($_COOKIE['PHP_PROFILE'])) {
3636
}
3737
PHPFILE1
3838

39-
tee /etc/php5/fpm/conf.d/tideways.ini <<PHPINI
39+
tee ${VAGRNAT_PHP_ETC_DIR}/fpm/conf.d/tideways.ini <<PHPINI
4040
extension=tideways.so
4141
auto_prepend_file=$HOME_DIR/xhprof/prepend.php
4242
tideways.auto_prepend_library=0
4343
PHPINI
4444

45-
cp /etc/php5/fpm/conf.d/tideways.ini /etc/php5/cli/conf.d/tideways.ini
45+
cp ${VAGRNAT_PHP_ETC_DIR}/fpm/conf.d/tideways.ini ${VAGRNAT_PHP_ETC_DIR}/cli/conf.d/tideways.ini
4646

4747
if [ ! -L /data/web/staging ]
4848
then

0 commit comments

Comments
 (0)