Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge c7e20a2 into 876c8b7
Browse files Browse the repository at this point in the history
  • Loading branch information
vdloo committed Apr 13, 2017
2 parents 876c8b7 + c7e20a2 commit 58bc0a4
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 58 deletions.
5 changes: 3 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 'fileutils'

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
VAGRANT_HYPCONFIGMGMT_VERSION = "0.0.7"
VAGRANT_HYPCONFIGMGMT_VERSION = "0.0.8"

# if vagrant-hypconfigmgmt is not installed, install it and abort
if !Vagrant.has_plugin?("vagrant-hypconfigmgmt", version = VAGRANT_HYPCONFIGMGMT_VERSION) && !ARGV.include?("plugin") && !ARGV.include?("status")
Expand Down Expand Up @@ -71,7 +71,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
-f #{settings['firewall']['state']} \
-c #{settings['cgroup']['state']} \
-x #{settings['xdebug']['state']} \
-d #{settings['hostmanager']['default_domain']}" \
-d #{settings['hostmanager']['default_domain']} \
-p #{settings['php']['version']}" \

config.vm.provider :virtualbox do |vbox, override|
override.vm.network "private_network", type: "dhcp"
Expand Down
2 changes: 1 addition & 1 deletion vagrant/plugins/vagrant-hypconfigmgmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ Create the gemfile (package)
```
$ make
rake build
vagrant-hypconfigmgmt 0.0.7 built to pkg/vagrant-hypconfigmgmt-0.0.7.gem.
vagrant-hypconfigmgmt 0.0.8 built to pkg/vagrant-hypconfigmgmt-0.0.8.gem.
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Vagrant
module Hypconfigmgmt
VERSION = "0.0.7"
VERSION = "0.0.8"
end
end
Binary file not shown.
Binary file not shown.
118 changes: 64 additions & 54 deletions vagrant/provisioning/hypernode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -e

while getopts "m:v:f:c:x:d:" opt; do
while getopts "m:v:f:c:x:d:p:" opt; do
case "$opt" in
m)
magento_version="$OPTARG" ;;
Expand All @@ -17,6 +17,8 @@ while getopts "m:v:f:c:x:d:" opt; do
xdebug_enabled="$OPTARG" ;;
d)
default_domain="$OPTARG" ;;
p)
php_version="$OPTARG" ;;
esac
done

Expand Down Expand Up @@ -73,61 +75,69 @@ if ! find /data/web/public/ -mindepth 1 -name '*.php' -name '*.html' | read; the
chown -R $user:$user /data/web/public
fi

if $xdebug_enabled; then
XDEBUG_RELEASE="https://xdebug.org/files/xdebug-2.5.0rc1.tgz"
echo "Ensuring Xdebug is installed"

# Install Xdebug for retrieving extended debug information and
# stacktraces from your development environment.
which php5 && PHP_VERSION="php5" || /bin/true
which php7.0 && PHP_VERSION="php7.0" || /bin/true

if [ -z $PHP_VERSION ]; then
echo "No supported PHP version found for this xdebug installation script. Skipping.."
break
fi

# Download the configured release
if [ ! -f /tmp/xdebug.tgz ]; then
# Install the required package(s)
apt-get update
apt-get install ${PHP_VERSION}-dev -yy

# Unpack Xdebug
wget -q -nc -O /tmp/xdebug.tgz $XDEBUG_RELEASE
cd /tmp
tar -xvzf xdebug.tgz
cd xdebug-*

# Build Xdebug from source
/usr/bin/phpize
./configure
make
[ "$PHP_VERSION" == "php5" ] && MODULES_DIR="/usr/lib/php5/20121212/"
[ "$PHP_VERSION" == "php7.0" ] && MODULES_DIR="/usr/lib/php/20151012/"
cp -f modules/xdebug.so $MODULES_DIR

[ "$PHP_VERSION" == "php5" ] && PHP_DIR="/etc/php5/"
[ "$PHP_VERSION" == "php7.0" ] && PHP_DIR="/etc/php/7.0/"

# Configure PHP to load xdebug.so
for i in fpm cli; do
EXTENSION_CONFIG="zend_extension = ${MODULES_DIR}xdebug.so"
touch ${PHP_DIR}${i}/conf.d/10-xdebug.ini
grep -q "$EXTENSION_CONFIG" ${PHP_DIR}${i}/conf.d/10-xdebug.ini || \
echo -n "$EXTENSION_CONFIG" > ${PHP_DIR}${i}/conf.d/10-xdebug.ini
done

# Restart PHP and Nginx
[ "$PHP_VERSION" == "php5" ] && service php5-fpm restart
[ "$PHP_VERSION" == "php7.0" ] && service php7.0-fpm restart
service nginx restart
# Start the correct FPM daemon
hypernode-switch-php $php_version

if $xdebug_enabled; then
if grep -q xenial /etc/lsb-release; then
echo "Xdebug not implemented for Xenial at this point in time."
echo "Need this? Please let us know on https://github.com/ByteInternet/hypernode-vagrant/issues"
else
XDEBUG_RELEASE="https://xdebug.org/files/xdebug-2.5.0rc1.tgz"
echo "Ensuring Xdebug is installed"

# Install Xdebug for retrieving extended debug information and
# stacktraces from your development environment.
which php5 && PHP_VERSION="php5" || /bin/true
which php7.0 && PHP_VERSION="php7.0" || /bin/true

if [ -z $PHP_VERSION ]; then
echo "No supported PHP version found for this xdebug installation script. Skipping.."
break
fi

# Download the configured release
if [ ! -f /tmp/xdebug.tgz ]; then
# Install the required package(s)
apt-get update
apt-get install ${PHP_VERSION}-dev -yy

# Unpack Xdebug
wget -q -nc -O /tmp/xdebug.tgz $XDEBUG_RELEASE
cd /tmp
tar -xvzf xdebug.tgz
cd xdebug-*

# Build Xdebug from source
/usr/bin/phpize
./configure
make
[ "$PHP_VERSION" == "php5" ] && MODULES_DIR="/usr/lib/php5/20121212/"
[ "$PHP_VERSION" == "php7.0" ] && MODULES_DIR="/usr/lib/php/20151012/"
cp -f modules/xdebug.so $MODULES_DIR

[ "$PHP_VERSION" == "php5" ] && PHP_DIR="/etc/php5/"
[ "$PHP_VERSION" == "php7.0" ] && PHP_DIR="/etc/php/7.0/"

# Configure PHP to load xdebug.so
for i in fpm cli; do
EXTENSION_CONFIG="zend_extension = ${MODULES_DIR}xdebug.so"
touch ${PHP_DIR}${i}/conf.d/10-xdebug.ini
grep -q "$EXTENSION_CONFIG" ${PHP_DIR}${i}/conf.d/10-xdebug.ini || \
echo -n "$EXTENSION_CONFIG" > ${PHP_DIR}${i}/conf.d/10-xdebug.ini
done

# Restart PHP and Nginx
[ "$PHP_VERSION" == "php5" ] && service php5-fpm restart
[ "$PHP_VERSION" == "php7.0" ] && service php7.0-fpm restart
service nginx restart

fi
echo ""
echo "Xdebug is installed. To configure Xdebug to send metrics to"
echo "your IDE, see the 'Configuring Xdebug to send metrics section in "
echo "this article: https://support.hypernode.com/knowledgebase/install-xdebug-hypernode-vagrant/"
fi
echo ""
echo "Xdebug is installed. To configure Xdebug to send metrics to"
echo "your IDE, see the 'Configuring Xdebug to send metrics section in "
echo "this article: https://support.hypernode.com/knowledgebase/install-xdebug-hypernode-vagrant/"
fi

if ! $varnish_enabled; then
Expand Down

0 comments on commit 58bc0a4

Please sign in to comment.