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

Add optional installs of Node and Ruby #227

Closed
5 tasks done
geerlingguy opened this issue Sep 4, 2015 · 9 comments
Closed
5 tasks done

Add optional installs of Node and Ruby #227

geerlingguy opened this issue Sep 4, 2015 · 9 comments

Comments

@geerlingguy
Copy link
Owner

Alrighty... enough people have asked for this feature specifically, and as long as I document it, it doesn't have to add much to the kludge factor. Since every FE dev has his own preferred concoction of FE asset management and dev/build tools (grunt, gulp, gasp, broccoli, fettucini, bundler, oh my!), I figure allowing for Node + npm modules and/or Ruby + gems would at least hit the 80% use case.

This would also somewhat reduce the urgency of fixing #174, which seems pretty gnarly at least with the current state of Ansible's includes.

The geerlingguy.nodejs and geerlingguy.ruby roles both install the base requirement, plus allow users to define npm modules or gems to add in... that kind of thing. And that would at least help dev teams standardize the tooling. Then they could (until #174 is done) add a command to install their local dependencies/bundle configs inside their own projects.

@geerlingguy
Copy link
Owner Author

This has one upstream dependency so far, on the geerlingguy.nodejs role; I thought I had a simple nodejs_npm_packages variable already, but it must've just been my imagination.

See: geerlingguy/ansible-role-nodejs#5

@geerlingguy
Copy link
Owner Author

Default versions installed with no extra config in Ubuntu 14.04:

vagrant@drupalvm:~$ ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
vagrant@drupalvm:~$ node --version
v0.10.37
vagrant@drupalvm:~$ npm --version
1.4.28

@geerlingguy
Copy link
Owner Author

Issue geerlingguy/ansible-role-nodejs#5 has been fixed, adding an example in the example config file, will add documentation later.

@sarahjean
Copy link

So I tried this out with my project, and I got these versions of node and npm:

vagrant@d8-readiness:/var/www/themes/thunder$ node -v
v0.10.37
vagrant@d8-readiness:/var/www/themes/thunder$ npm -v
1.4.28

I'm not really sure what the 'proper' way to get the latest node version is via ansible, but this version of node is too old for several of the packages that we are using. I found a stack exchange post with several options for doing this manually.

I do think this could be pretty useful, I had it install bower as well and that actually grabbed the latest version and 'just worked'.

@geerlingguy
Copy link
Owner Author

@sarahjean - I think I'll add a configurable option for this via the Node.js role, see: geerlingguy/ansible-role-nodejs#4

@geerlingguy
Copy link
Owner Author

@sarahjean - I've added the ability to specify a node.js version in the installation, and it defaults to 0.10 right now. You can add nodejs_version: 0.12 to get the latest version of the 0.12 branch. There's no 4.0.0 available yet through nodesource, but it should be sooner or later.

Do you think I should default this to nodejs_version: 0.12 instead of 0.10 for Drupal VM's purposes?

@sarahjean
Copy link

Yeah, I think that using the latest stable version available is probably a better default.

@geerlingguy
Copy link
Owner Author

Fun story: I've actually started using node inside the VM for a project this week, so it's a happy coincidence I had already laid the groundwork earlier :)

I'll take an initial stab at adding documentation for common scenarios soon (mine is around testing with Selenium + Behat + PhantomJS), if nobody else does.

@geerlingguy
Copy link
Owner Author

I've documented node.js usage, but left out any detailed documentation of Ruby usage. Fewer and fewer projects are using Ruby/Compass/etc. these days, so those devs can figure it out on their own. It's about as simple as the Node.js integration anyways...

ravbaba pushed a commit to ravbaba/drupal-vm that referenced this issue Sep 23, 2015
ravbaba pushed a commit to ravbaba/drupal-vm that referenced this issue Sep 23, 2015
ravbaba pushed a commit to ravbaba/drupal-vm that referenced this issue Sep 23, 2015
ravbaba pushed a commit to ravbaba/drupal-vm that referenced this issue Sep 23, 2015
ravbaba pushed a commit to ravbaba/drupal-vm that referenced this issue Sep 23, 2015
joestewart pushed a commit to joestewart/drupal-vm that referenced this issue Jun 27, 2016
joestewart pushed a commit to joestewart/drupal-vm that referenced this issue Jun 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants