Skip to content

Commit e97c83a

Browse files
authored
Merge pull request #117 from jasonheecs/2.0
Added installation of npm, gulp and grunt by default
2 parents fa8fa27 + d126f82 commit e97c83a

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3535
- Tests configuration files are generated during project initialization
3636
- Sample data support
3737
- ElasticSearch support
38+
- NodeJS, NPM, Gulp and Grunt are installed as part of the provisioning process
3839

3940
## [v2.1.0] - 2016-06-22
4041

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ It is easy to [install multiple Magento instances](#multiple-magento-instances)
4848
1. Configures all software necessary for Magento 2 using [custom Ubuntu vagrant box](https://atlas.hashicorp.com/paliarush/boxes/magento2.ubuntu) (Apache 2.4, PHP 7.0 (or 5.6), MySQL 5.6, Git, Composer, XDebug, Rabbit MQ, Varnish)
4949
1. Installs Magento 2 from Git repositories or Composer packages (can be configured via `checkout_source_from` option in [etc/config.yaml](etc/config.yaml.dist))
5050
1. Configures PHP Storm project (partially at the moment)
51+
1. Installs NodeJS, NPM, Grunt and Gulp for front end development
5152

5253
## How to install
5354

scripts/provision/configure_environment_recurring.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ function isServiceAvailable() {
3939
fi
4040
}
4141

42+
function isNodeJsInstalled() {
43+
nodejs_status="$(dpkg -s nodejs | grep Status 2> >(log))"
44+
npm_status="$(dpkg -s npm | grep Status 2> >(log))"
45+
[[ ${npm_status} == "Status: install ok installed" && ${nodejs_status} == "Status: install ok installed" ]]
46+
}
47+
4248
guest_magento_dir=$2
4349
use_php7=$4
4450
vagrant_dir="/vagrant"
@@ -124,4 +130,14 @@ if [[ ${php_config_content} =~ ${pattern} ]]; then
124130
service apache2 restart 2> >(logError) > >(log)
125131
fi
126132

133+
if ! isNodeJsInstalled; then
134+
status "Installing js build tools"
135+
{
136+
apt-get install -y nodejs npm
137+
ln -s /usr/bin/nodejs /usr/bin/node
138+
npm install -g grunt-cli
139+
npm install gulp -g
140+
} 2> >(logError) > >(log)
141+
fi
142+
127143
decrementNestingLevel

0 commit comments

Comments
 (0)