From cff8c2f09080d71e957a3bf363f15af49f0b35b1 Mon Sep 17 00:00:00 2001 From: e7d Date: Mon, 4 Jul 2016 15:15:15 +0200 Subject: [PATCH 01/19] prepared Neap Box version 1.2.11 --- CHANGELOG.md | 2 ++ README.md | 2 +- VERSION | 2 +- metadata.json | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe8bc3..b8efcd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## v1.2.11 + ## v1.2.10 (2016-07-04) * fixed Debian reference box to version 8.5.0 as 8.5.1 is not usable as is * updated VirtualBox Gust additions to version 5.0.24 diff --git a/README.md b/README.md index 0da2700..66223af 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This project aims to give you the necessary tools to build yourself the Neap Box ## About -**Version:** 1.2.10 +**Version:** 1.2.11 **Web:** Coming later, [box.neap.io](http://box.neap.io) **Project Owner:** Michaƫl "[e7d](https://github.com/e7d)" Ferrand diff --git a/VERSION b/VERSION index 963ed7c..c114700 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.10 +1.2.11 diff --git a/metadata.json b/metadata.json index bb1ccaf..aab3b5b 100644 --- a/metadata.json +++ b/metadata.json @@ -4,7 +4,7 @@ "name": "e7d/neap-box", "versions": [ { - "version": "1.2.10", + "version": "1.2.11", "providers": [{ "name": "virtualbox", "url": "neap.box" From 9687e5137ebc3d29d74180e11bace29f267a3b9d Mon Sep 17 00:00:00 2001 From: e7d Date: Mon, 11 Jul 2016 12:12:36 +0200 Subject: [PATCH 02/19] updated NodeJS to version 6.3.0 --- CHANGELOG.md | 3 ++- README.md | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8efcd6..83261b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -## v1.2.11 +## v1.2.11 (unreleased) +* updated NodeJS to version 6.3.0 ## v1.2.10 (2016-07-04) * fixed Debian reference box to version 8.5.0 as 8.5.1 is not usable as is diff --git a/README.md b/README.md index 66223af..186356a 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ This project aims to give you the necessary tools to build yourself the Neap Box In order to build the Neap Box effectively, you'll need to have a few tools installed: 1. Install [Git](https://git-scm.com) -1. Install [VirtualBox](http://virtualbox.org) -1. Install [Vagrant](http://vagrantup.com) +2. Install [VirtualBox](http://virtualbox.org) +3. Install [Vagrant](http://vagrantup.com) ### Windows-specific ### @@ -30,7 +30,7 @@ In order to build the Neap Box effectively, you'll need to have a few tools inst ### Recommended 1. Use a development workstation with at least 2 cores and 8GB of RAM, as Vagrant should be allocated 1GB of RAM -1. Install [Vagrant::VBGuest](https://github.com/dotless-de/vagrant-vbguest), to manage the host's VirtualBox Guest Additions on the guest system +2. Install [Vagrant::VBGuest](https://github.com/dotless-de/vagrant-vbguest), to manage the host's VirtualBox Guest Additions on the guest system `vagrant plugin install vagrant-vbguest` ## Build ## @@ -67,7 +67,7 @@ Once Vagrant is done provisioning the VM, you will have a box containing: * [PhpRedis](https://github.com/phpredis/phpredis) 3.0.0, as PHP extension for Redis * [Xdebug](http://xdebug.org/) 2.4.0, as debugger and profiler tool * [Composer](https://getcomposer.org/) 1.1.3, as dependency manager -* [NodeJS](https://nodejs.org/) 6.2.2, as JavaScript runtime +* [NodeJS](https://nodejs.org/) 6.3.0, as JavaScript runtime * [NPM](https://www.npmjs.com/) 3.10.3, as JavaScript package Manager * [Newman](https://github.com/postmanlabs/newman) 2.1.2, as [Postman](http://getpostman.com/) collection runner * [FFmpeg](https://www.ffmpeg.org/) 2.8.7, as media converter From 884877967ba12471e588c8a85077e514b026d598 Mon Sep 17 00:00:00 2001 From: e7d Date: Mon, 11 Jul 2016 12:16:37 +0200 Subject: [PATCH 03/19] updated nginx-rtmp-module to version 1.1.8 --- CHANGELOG.md | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83261b4..86ac235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## v1.2.11 (unreleased) +* updated nginx-rtmp-module to version 1.1.8 * updated NodeJS to version 6.3.0 ## v1.2.10 (2016-07-04) diff --git a/README.md b/README.md index 186356a..3bff46e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Once Vagrant is done provisioning the VM, you will have a box containing: * [MailCatcher](https://mailcatcher.me/) 0.6.4 as mail catching server * [nginx](http://nginx.org/) 1.10.1, as web server, with: * [OpenSSL](https://www.openssl.org/) 1.0.2h, as SSL module - * [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module) 1.1.7, as streaming handler (RTMP, HLS and DASH protocols) + * [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module) 1.1.8, as streaming handler (RTMP, HLS and DASH protocols) * [PHP](http://php.net/) 7.0.8, as server-side scripting language, with: * [PHP-FPM](http://php-fpm.org/) 7.0.8, as PHP process manager * [PhpRedis](https://github.com/phpredis/phpredis) 3.0.0, as PHP extension for Redis From 24cff38fe866af78a454d3cad63f16c03c579e5d Mon Sep 17 00:00:00 2001 From: e7d Date: Mon, 11 Jul 2016 14:00:17 +0200 Subject: [PATCH 04/19] updated build script to use nginx-rtmp-module version 1.1.8 --- bootstrap/build-nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/build-nginx.sh b/bootstrap/build-nginx.sh index 8e7b975..9c0037f 100644 --- a/bootstrap/build-nginx.sh +++ b/bootstrap/build-nginx.sh @@ -11,7 +11,7 @@ fi NGINX_VERSION=1.10.1 # http://nginx.org/en/download.html OPENSSL_VERSION=1.0.2h # https://openssl.org/source/ -NGINX_RTMP_VERSION=1.1.7 # https://github.com/arut/nginx-rtmp-module/releases +NGINX_RTMP_VERSION=1.1.8 # https://github.com/arut/nginx-rtmp-module/releases try ( From 5f1e6d8e410ab8fa4955b2e1e51753c1160579c1 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 09:15:54 +0200 Subject: [PATCH 05/19] updated VirtualBox provider for Vagrant --- Vagrantfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 596b1a4..25bd1a6 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -28,11 +28,11 @@ Vagrant.configure(2) do |config| node.vm.synced_folder ".", "/vagrant" # VirtualBox provider - node.vm.provider "virtualbox" do |vb| + node.vm.provider "virtualbox" do |provider| # System configuration - vb.name = "Neap Box" - vb.cpus = cpus - vb.memory = "1024" + provider.name = "Neap Box" + provider.cpus = cpus + provider.memory = "1024" end # VirtualBox Guest update From d38a198ea61c09a677cafab15e2f97e4b814fd60 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 09:16:04 +0200 Subject: [PATCH 06/19] added Digital Ocean provider for Vagrant --- .gitignore | 1 + Vagrantfile | 19 ++++++++++++ build.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 105 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 67d3881..3d8006a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.vagrant +/resources/digital-ocean/* *.box *.log !/resources/**/*.cache diff --git a/Vagrantfile b/Vagrantfile index 25bd1a6..2152c28 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -39,6 +39,25 @@ Vagrant.configure(2) do |config| node.vbguest.auto_update = true node.vbguest.no_remote = true + # Digital Ocean provider + node.vm.provider "digital_ocean" do |provider, override| + override.nfs.functional = false + override.ssh.private_key_path = 'resources/digital-ocean/id_rsa' + override.vm.box = 'digital_ocean' + override.vm.box_url = 'https://github.com/devopsgroup-io/vagrant-digitalocean/raw/master/box/digital_ocean.box' + + token = '' + File.open("resources/digital-ocean/token", "r") do |infile| + while (line = infile.gets) + token = line + end + end + provider.token = token + provider.image = 'debian-8-x64' + provider.region = 'lon1' + provider.size = '512mb' + end + # Provisioning script node.vm.provision "shell" do |s| s.inline = "/vagrant/bootstrap.sh | tee /vagrant/bootstrap.log" diff --git a/build.sh b/build.sh index f79624b..820c0cd 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,87 @@ #!/bin/bash -vagrant destroy --force -vagrant up --install-provider --destroy-on-error -rm -rf neap.box -vagrant package --output neap.box +# Common +vagrant_plugin_install() { + echo "Install Vagrant plugin: $1" + plugins=$(vagrant plugin list | grep $1) + if [[ -z $plugins ]]; then + vagrant plugin install $1 + else + vagrant plugin update $1 + fi +} +build() { + if [ -z $1 ]; then + echo "No provider" + exit 1; + fi + vagrant destroy --force + vagrant up --provider=$1 --install-provider --destroy-on-error + echo +} +package() { + rm -rf neap.box + vagrant package --output neap.box + echo +} + +# VirtualBox +config_virtualbox() { + echo "Configure VirtualBox" + vagrant_plugin_install vagrant-vbguest +} +build_virtualbox() { + echo "Build VirtualBox" + build virtualbox +} + +# Digital Ocean +setup_digital_ocean_token() { + echo "Setup Token for Digital Ocean" + if [[ ! -e resources/digital-ocean/token ]]; then + read -p "Token: " token + echo $token >resources/digital-ocean/token + else + token=$(cat resources/digital-ocean/token) + fi + + vagrant digitalocean-list images $token >/dev/null 2>&1 + if [[ 1 -eq $? ]]; then + echo "Invalid token for Digital Ocean!" + rm resources/digital-ocean/token + setup_digital_ocean_token + fi +} +setup_digital_ocean_keys() { + timestamp=`date +%Y%m%d-%H%M%S` + echo -e 'y\n' | ssh-keygen -t rsa -b 2048 -f resources/digital-ocean/id_rsa -N '' -C "neap-box@$timestamp" +} +config_digital_ocean() { + echo "Configure Digital Ocean" + vagrant_plugin_install vagrant-vbguest + vagrant_plugin_install vagrant-digitalocean + setup_digital_ocean_token + setup_digital_ocean_keys +} +build_digital_ocean() { + echo "Build Digital Ocean" + build digital_ocean +} + +# Program +while true; do + echo "What provider do you want to use?" + echo "1. VirtualBox (local, default)" + echo "2. Digital Ocean (cloud)" + read -p "provider [1]: " choice + case "$choice" in + 1|v|"" ) + config_virtualbox + build_virtualbox + break;; + 2|d ) + config_digital_ocean + build_digital_ocean + break;; + esac +done From 80f1d5707b48121744c7952ba513a8ba73fe6741 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 09:32:12 +0200 Subject: [PATCH 07/19] catch exception in case the key pair for Digital Ocean does not exist --- Vagrantfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 2152c28..98d4310 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -47,10 +47,14 @@ Vagrant.configure(2) do |config| override.vm.box_url = 'https://github.com/devopsgroup-io/vagrant-digitalocean/raw/master/box/digital_ocean.box' token = '' - File.open("resources/digital-ocean/token", "r") do |infile| - while (line = infile.gets) - token = line + begin + File.open('resources/digital-ocean/token', 'r') do |file| + while (line = file.gets) + token = line + break + end end + rescue SystemCallError end provider.token = token provider.image = 'debian-8-x64' From ce4f3617effaea2c2dcf2c04565e48302841f9b7 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 09:32:38 +0200 Subject: [PATCH 08/19] updated Debian Jessie to version 8.5.2 --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 98d4310..41e45bf 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -22,7 +22,7 @@ Vagrant.configure(2) do |config| # General configuration node.vm.hostname = "box.neap.dev" node.vm.box = "debian/contrib-jessie64" - node.vm.box_version = "= 8.5.0" + node.vm.box_version = "= 8.5.2" # Synced folder configuration node.vm.synced_folder ".", "/vagrant" From cf1e858d3ba75742c12fec371a0d1dba7fe249f9 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 09:55:25 +0200 Subject: [PATCH 09/19] removed analytics dummy instruction --- resources/analytics.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/analytics.sh b/resources/analytics.sh index a093ebb..d81a2d7 100644 --- a/resources/analytics.sh +++ b/resources/analytics.sh @@ -97,7 +97,6 @@ QUERY="${QUERY} --data-urlencode \"z=${EPOCH}\"" QUERY="${QUERY} --user-agent \"${USER_AGENT}\"" QUERY="${QUERY} --compressed --silent --output /dev/null" QUERY="\"http://www.google-analytics.com/collect\" ${QUERY}" -export toto=$QUERY if [ ! -z $HELP ]; then display_help From 2746b3dbdff98e8e62fd06c7648c92309dfb3a9e Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 09:55:52 +0200 Subject: [PATCH 10/19] added analytics curl dependency installation --- resources/analytics.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/analytics.sh b/resources/analytics.sh index d81a2d7..4a7e121 100644 --- a/resources/analytics.sh +++ b/resources/analytics.sh @@ -1,5 +1,8 @@ #!/bin/bash +# require curl +apt-get -y -q install curl >/dev/null + . /vagrant/resources/colors.sh ANALYTICS=UA-66226242-7 From ebcc49251950766a39364c5fb65542f2c16b70cf Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 11:44:17 +0200 Subject: [PATCH 11/19] updated NPM to version 3.10.5 --- CHANGELOG.md | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86ac235..d66bf40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## v1.2.11 (unreleased) * updated nginx-rtmp-module to version 1.1.8 * updated NodeJS to version 6.3.0 +* updated NPM to version 3.10.5 ## v1.2.10 (2016-07-04) * fixed Debian reference box to version 8.5.0 as 8.5.1 is not usable as is diff --git a/README.md b/README.md index 3bff46e..0c0cd8d 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Once Vagrant is done provisioning the VM, you will have a box containing: * [Xdebug](http://xdebug.org/) 2.4.0, as debugger and profiler tool * [Composer](https://getcomposer.org/) 1.1.3, as dependency manager * [NodeJS](https://nodejs.org/) 6.3.0, as JavaScript runtime - * [NPM](https://www.npmjs.com/) 3.10.3, as JavaScript package Manager + * [NPM](https://www.npmjs.com/) 3.10.5, as JavaScript package Manager * [Newman](https://github.com/postmanlabs/newman) 2.1.2, as [Postman](http://getpostman.com/) collection runner * [FFmpeg](https://www.ffmpeg.org/) 2.8.7, as media converter * [UnrealIRCd](https://www.unrealircd.org/) 4.0.4, as IRC server daemon, with: From 9940de5c5a7cdd03c6573df1cce83eff622cdbfe Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 23:53:47 +0200 Subject: [PATCH 12/19] made all wget less verbose --- bootstrap/build-anope.sh | 2 +- bootstrap/build-nginx.sh | 6 +++--- bootstrap/build-redis.sh | 2 +- bootstrap/build-unreal.sh | 2 +- bootstrap/setup-certbot.sh | 2 +- bootstrap/setup-ffmpeg.sh | 2 +- bootstrap/setup-jq.sh | 2 +- bootstrap/setup-phpredis.sh | 2 +- bootstrap/setup-xdebug.sh | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bootstrap/build-anope.sh b/bootstrap/build-anope.sh index 5d2b7b7..9c620f2 100644 --- a/bootstrap/build-anope.sh +++ b/bootstrap/build-anope.sh @@ -17,7 +17,7 @@ try echo "Download sources" cd /usr/src - wget https://github.com/anope/anope/releases/download/${ANOPE_VERSION}/anope-${ANOPE_VERSION}-source.tar.gz + wget -nv https://github.com/anope/anope/releases/download/${ANOPE_VERSION}/anope-${ANOPE_VERSION}-source.tar.gz tar -zxvf anope-${ANOPE_VERSION}-source.tar.gz cd anope* diff --git a/bootstrap/build-nginx.sh b/bootstrap/build-nginx.sh index 9c0037f..f42c60e 100644 --- a/bootstrap/build-nginx.sh +++ b/bootstrap/build-nginx.sh @@ -22,17 +22,17 @@ try echo "Download source code" cd /usr/src - wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz + wget -nv http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz tar -zxvf nginx-${NGINX_VERSION}.tar.gz echo "Download OpenSSL source code" cd /usr/src - wget https://openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz + wget -nv https://openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz tar -zxvf openssl-${OPENSSL_VERSION}.tar.gz echo "Download nginx-rtmp-module source code" cd /usr/src - wget https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz -O nginx-rtmp-module-v${NGINX_RTMP_VERSION}.tar.gz + wget -nv https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz -O nginx-rtmp-module-v${NGINX_RTMP_VERSION}.tar.gz tar -zxvf nginx-rtmp-module-v${NGINX_RTMP_VERSION}.tar.gz echo "Build binaries" diff --git a/bootstrap/build-redis.sh b/bootstrap/build-redis.sh index bb07db5..8dcc2aa 100644 --- a/bootstrap/build-redis.sh +++ b/bootstrap/build-redis.sh @@ -18,7 +18,7 @@ try echo "Download source code" cd /usr/src if [ ! -f /usr/src/redis-${REDIS_VERSION}.tar.gz ]; then - wget http://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz + wget -nv http://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz tar -zxvf redis-${REDIS_VERSION}.tar.gz else echo "skipped..." diff --git a/bootstrap/build-unreal.sh b/bootstrap/build-unreal.sh index 9e443cf..d4ff93d 100644 --- a/bootstrap/build-unreal.sh +++ b/bootstrap/build-unreal.sh @@ -21,7 +21,7 @@ try echo "Download sources" cd /usr/src if [ ! -f /usr/src/unreal*.tar.gz ]; then - wget --no-check-certificate --trust-server-names https://www.unrealircd.org/unrealircd4/unrealircd-${UNREAL_VERSION}.tar.gz + wget -nv --no-check-certificate --trust-server-names https://www.unrealircd.org/unrealircd4/unrealircd-${UNREAL_VERSION}.tar.gz tar -zxvf unrealircd-*.tar.gz else echo "skipped..." diff --git a/bootstrap/setup-certbot.sh b/bootstrap/setup-certbot.sh index 9efa9d0..91bcd3f 100644 --- a/bootstrap/setup-certbot.sh +++ b/bootstrap/setup-certbot.sh @@ -19,7 +19,7 @@ try rm -rf ${LETS_ENCRYPT_PATH} mkdir -p ${LETS_ENCRYPT_PATH} cd ${LETS_ENCRYPT_PATH} - wget https://dl.eff.org/certbot-auto + wget -nv https://dl.eff.org/certbot-auto chmod a+x certbot-auto echo "Link executable in environment" diff --git a/bootstrap/setup-ffmpeg.sh b/bootstrap/setup-ffmpeg.sh index 4a389df..b503248 100644 --- a/bootstrap/setup-ffmpeg.sh +++ b/bootstrap/setup-ffmpeg.sh @@ -15,7 +15,7 @@ try echo "Add 'deb-multimedia' repository to Aptitude" cd /tmp - wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.3.7_all.deb + wget -nv http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.3.7_all.deb dpkg -i deb-multimedia-keyring_2016.3.7_all.deb echo "deb http://www.deb-multimedia.org jessie main non-free" >/etc/apt/sources.list.d/ffmpeg.list echo "deb http://www.deb-multimedia.org jessie-backports main" >>/etc/apt/sources.list.d/ffmpeg.list diff --git a/bootstrap/setup-jq.sh b/bootstrap/setup-jq.sh index f0e5e5c..69d2a77 100644 --- a/bootstrap/setup-jq.sh +++ b/bootstrap/setup-jq.sh @@ -17,7 +17,7 @@ try echo "Install binary" cd /tmp - wget https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 + wget -nv https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 chmod +x jq-linux64 mv jq-linux64 /usr/bin/jq diff --git a/bootstrap/setup-phpredis.sh b/bootstrap/setup-phpredis.sh index 36a671b..7747087 100644 --- a/bootstrap/setup-phpredis.sh +++ b/bootstrap/setup-phpredis.sh @@ -18,7 +18,7 @@ try echo "Download sources" cd /usr/src - wget https://github.com/phpredis/phpredis/archive/${PHPREDIS_TAG}.tar.gz -O phpredis-${PHPREDIS_VERSION}.tar.gz + wget -nv https://github.com/phpredis/phpredis/archive/${PHPREDIS_TAG}.tar.gz -O phpredis-${PHPREDIS_VERSION}.tar.gz tar -zxvf phpredis-${PHPREDIS_VERSION}.tar.gz echo "Build library" diff --git a/bootstrap/setup-xdebug.sh b/bootstrap/setup-xdebug.sh index 59c7134..520460f 100644 --- a/bootstrap/setup-xdebug.sh +++ b/bootstrap/setup-xdebug.sh @@ -18,7 +18,7 @@ try echo "Download sources" cd /usr/src - wget https://github.com/xdebug/xdebug/archive/XDEBUG_2_4_0.tar.gz -O xdebug-${XDEBUG_VERSION}.tar.gz + wget -nv https://github.com/xdebug/xdebug/archive/XDEBUG_2_4_0.tar.gz -O xdebug-${XDEBUG_VERSION}.tar.gz tar -zxvf xdebug-${XDEBUG_VERSION}.tar.gz echo "Build library" From 610dd14ffe046d31f99e78762f342ae26032c742 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 23:54:28 +0200 Subject: [PATCH 13/19] fixed vbguest installation --- Vagrantfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 41e45bf..2c8a779 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -37,6 +37,7 @@ Vagrant.configure(2) do |config| # VirtualBox Guest update node.vbguest.auto_update = true + node.vbguest.installer = DebianVbguest node.vbguest.no_remote = true # Digital Ocean provider @@ -69,3 +70,16 @@ Vagrant.configure(2) do |config| end end end + +class DebianVbguest < VagrantVbguest::Installers::Debian + def install(opts=nil, &block) + communicate.sudo('apt-get -y -q purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11', opts, &block) + @vb_uninstalled = true + super + end + + def running?(opts=nil, &block) + return false if @vb_uninstalled + super + end +end From dcd9fbe4946c296eeef93086e60edbceac2fb2c0 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 23:54:51 +0200 Subject: [PATCH 14/19] improved global Vagrantfile code style --- Vagrantfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 2c8a779..fcd5c15 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,24 +15,24 @@ Vagrant.configure(2) do |config| cpus = 2 end - config.vm.define "Neap Box" do |node| + config.vm.define 'Neap Box' do |node| # For a complete reference, please see the online documentation at # https://docs.vagrantup.com. # General configuration - node.vm.hostname = "box.neap.dev" - node.vm.box = "debian/contrib-jessie64" - node.vm.box_version = "= 8.5.2" + node.vm.hostname = 'box.neap.dev' + node.vm.box = 'debian/contrib-jessie64' + node.vm.box_version = '= 8.5.2' # Synced folder configuration - node.vm.synced_folder ".", "/vagrant" + node.vm.synced_folder '.', '/vagrant' # VirtualBox provider - node.vm.provider "virtualbox" do |provider| + node.vm.provider 'virtualbox' do |provider| # System configuration - provider.name = "Neap Box" + provider.name = 'Neap Box' provider.cpus = cpus - provider.memory = "1024" + provider.memory = '1024' end # VirtualBox Guest update @@ -41,7 +41,7 @@ Vagrant.configure(2) do |config| node.vbguest.no_remote = true # Digital Ocean provider - node.vm.provider "digital_ocean" do |provider, override| + node.vm.provider 'digital_ocean' do |provider, override| override.nfs.functional = false override.ssh.private_key_path = 'resources/digital-ocean/id_rsa' override.vm.box = 'digital_ocean' @@ -64,8 +64,8 @@ Vagrant.configure(2) do |config| end # Provisioning script - node.vm.provision "shell" do |s| - s.inline = "/vagrant/bootstrap.sh | tee /vagrant/bootstrap.log" + node.vm.provision 'shell' do |s| + s.inline = '/vagrant/bootstrap.sh | tee /vagrant/bootstrap.log' s.keep_color = true end end From dae3ce2e7309195a34c059be023e64f51cb6f4c2 Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 23:55:15 +0200 Subject: [PATCH 15/19] added missing package step from virtualbox build --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 820c0cd..e936b0e 100644 --- a/build.sh +++ b/build.sh @@ -17,12 +17,10 @@ build() { fi vagrant destroy --force vagrant up --provider=$1 --install-provider --destroy-on-error - echo } package() { rm -rf neap.box vagrant package --output neap.box - echo } # VirtualBox @@ -33,6 +31,7 @@ config_virtualbox() { build_virtualbox() { echo "Build VirtualBox" build virtualbox + package } # Digital Ocean From ec68492638c6334b25fb12eaa50c272b0d4d110f Mon Sep 17 00:00:00 2001 From: e7d Date: Tue, 12 Jul 2016 23:56:28 +0200 Subject: [PATCH 16/19] updated build instructions according to new build script --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c0cd8d..2e0f945 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,7 @@ In order to build the Neap Box effectively, you'll need to have a few tools inst 1. `git clone https://github.com/e7d/neap-box.git` to clone the latest version 2. Change into the directory `neap-box` -3. Run `vagrant up` -4. Run `vagrant package --output neap.box` +3. Run `build.sh` **Note**: Steps 3. and 4. can be replaced with a call to `build.sh` on bash available environments. From 8944269e472ce8182d9123e2c6348f011436d880 Mon Sep 17 00:00:00 2001 From: e7d Date: Wed, 13 Jul 2016 00:09:21 +0200 Subject: [PATCH 17/19] removed Digital Ocean related scripts --- .gitignore | 1 - Vagrantfile | 23 --------------- build.sh | 80 ++++++----------------------------------------------- 3 files changed, 8 insertions(+), 96 deletions(-) diff --git a/.gitignore b/.gitignore index 3d8006a..67d3881 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /.vagrant -/resources/digital-ocean/* *.box *.log !/resources/**/*.cache diff --git a/Vagrantfile b/Vagrantfile index fcd5c15..8e797e4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -40,29 +40,6 @@ Vagrant.configure(2) do |config| node.vbguest.installer = DebianVbguest node.vbguest.no_remote = true - # Digital Ocean provider - node.vm.provider 'digital_ocean' do |provider, override| - override.nfs.functional = false - override.ssh.private_key_path = 'resources/digital-ocean/id_rsa' - override.vm.box = 'digital_ocean' - override.vm.box_url = 'https://github.com/devopsgroup-io/vagrant-digitalocean/raw/master/box/digital_ocean.box' - - token = '' - begin - File.open('resources/digital-ocean/token', 'r') do |file| - while (line = file.gets) - token = line - break - end - end - rescue SystemCallError - end - provider.token = token - provider.image = 'debian-8-x64' - provider.region = 'lon1' - provider.size = '512mb' - end - # Provisioning script node.vm.provision 'shell' do |s| s.inline = '/vagrant/bootstrap.sh | tee /vagrant/bootstrap.log' diff --git a/build.sh b/build.sh index e936b0e..6f5914b 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Common vagrant_plugin_install() { echo "Install Vagrant plugin: $1" plugins=$(vagrant plugin list | grep $1) @@ -10,77 +9,14 @@ vagrant_plugin_install() { vagrant plugin update $1 fi } -build() { - if [ -z $1 ]; then - echo "No provider" - exit 1; - fi - vagrant destroy --force - vagrant up --provider=$1 --install-provider --destroy-on-error -} -package() { - rm -rf neap.box - vagrant package --output neap.box -} -# VirtualBox -config_virtualbox() { - echo "Configure VirtualBox" - vagrant_plugin_install vagrant-vbguest -} -build_virtualbox() { - echo "Build VirtualBox" - build virtualbox - package -} +echo "Configure Vagrant" +vagrant_plugin_install vagrant-vbguest -# Digital Ocean -setup_digital_ocean_token() { - echo "Setup Token for Digital Ocean" - if [[ ! -e resources/digital-ocean/token ]]; then - read -p "Token: " token - echo $token >resources/digital-ocean/token - else - token=$(cat resources/digital-ocean/token) - fi - - vagrant digitalocean-list images $token >/dev/null 2>&1 - if [[ 1 -eq $? ]]; then - echo "Invalid token for Digital Ocean!" - rm resources/digital-ocean/token - setup_digital_ocean_token - fi -} -setup_digital_ocean_keys() { - timestamp=`date +%Y%m%d-%H%M%S` - echo -e 'y\n' | ssh-keygen -t rsa -b 2048 -f resources/digital-ocean/id_rsa -N '' -C "neap-box@$timestamp" -} -config_digital_ocean() { - echo "Configure Digital Ocean" - vagrant_plugin_install vagrant-vbguest - vagrant_plugin_install vagrant-digitalocean - setup_digital_ocean_token - setup_digital_ocean_keys -} -build_digital_ocean() { - echo "Build Digital Ocean" - build digital_ocean -} +echo "Build box" +vagrant destroy --force +vagrant up --provider=virtualbox --install-provider --destroy-on-error -# Program -while true; do - echo "What provider do you want to use?" - echo "1. VirtualBox (local, default)" - echo "2. Digital Ocean (cloud)" - read -p "provider [1]: " choice - case "$choice" in - 1|v|"" ) - config_virtualbox - build_virtualbox - break;; - 2|d ) - config_digital_ocean - build_digital_ocean - break;; - esac -done +echo "Package box" +rm -rf neap.box +vagrant package --output neap.box From 87784eee47016571939e1dc78ee54114391266d8 Mon Sep 17 00:00:00 2001 From: e7d Date: Wed, 13 Jul 2016 00:10:19 +0200 Subject: [PATCH 18/19] revert "updated build instructions according to new build script" --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e0f945..4f9efcb 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ In order to build the Neap Box effectively, you'll need to have a few tools inst ### Windows-specific ### -1. Add the Git executables to your path +1. Add the Git binaries to your path ### Recommended @@ -37,7 +37,8 @@ In order to build the Neap Box effectively, you'll need to have a few tools inst 1. `git clone https://github.com/e7d/neap-box.git` to clone the latest version 2. Change into the directory `neap-box` -3. Run `build.sh` +3. Run `vagrant up` +4. Run `vagrant package --output neap.box` **Note**: Steps 3. and 4. can be replaced with a call to `build.sh` on bash available environments. From 3582aacb8664bffba0f2c6913bab6db09e538608 Mon Sep 17 00:00:00 2001 From: e7d Date: Wed, 13 Jul 2016 00:12:44 +0200 Subject: [PATCH 19/19] updated Neap Box to version 1.2.11 --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d66bf40..37dc728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ -## v1.2.11 (unreleased) +## v1.2.11 (2016-07-13) +* improved build script * updated nginx-rtmp-module to version 1.1.8 * updated NodeJS to version 6.3.0 * updated NPM to version 3.10.5 ## v1.2.10 (2016-07-04) * fixed Debian reference box to version 8.5.0 as 8.5.1 is not usable as is -* updated VirtualBox Gust additions to version 5.0.24 +* updated VirtualBox Guest additions to version 5.0.24 * updated NPM to version 3.10.3 * updated Newman to version 2.1.2