New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont Install node.js from source #36

Merged
merged 12 commits into from Jan 29, 2015

Conversation

Projects
None yet
3 participants
@leonelgalan
Contributor

leonelgalan commented Jan 27, 2015

There has to be a better way of installing the latest version of node and npm that doesn't involve building from source.

@BrandonMathis BrandonMathis added this to the 0.3.0 milestone Jan 26, 2015

@leonelgalan

This comment has been minimized.

Contributor

leonelgalan commented Jan 27, 2015

Why?

  • Ok, this started with me trying to get the FE running (revising: how we install node, it's not from source; update npm and build a FE app), but I had to "fix" (encoding issue) PostgreSQL to successfully run my app.
  • smashing-dev-tool wasn't ready for prime time.
  • I found an issue related to dependencies (See #34)

What Changed?

  • Installer: Now installs requirements (external/vendor roles) globally, no need for vendor/roles/
  • PostgreSQL: Is now installed with ansible-galaxy's role: ANXS.postgresql. Encoding is now default to 'UTF8'
  • Node is now installed with my own recipe, which uses nodesource.node to install node, upgrades npm and installs packages specified on variables.
  • Steps back and doesn't uses smashing-dev-tool to build FE, it simply does gulp. Apps still using grunt build my break

@leonelgalan leonelgalan added ready and removed in progress labels Jan 27, 2015

leonelgalan added some commits Jan 27, 2015

Changes the way we handle vendor roles.
Remove your local `vendor/roles`, it’s no longer used, therefore there
is no need to ignore it.
Fixes rbenv
- zzet.rbenv includes a “rbenv rehash” handler. It seems that having an
empty _backend_install_essentials/handlers/main.yml_ is needed in order
to “inheirt” the handler from dependencies.
- zzet.rbenv installs ruby 2.1.5 by default, which is a better default
(latest patch), because we are installing rbenv system-wide, there is
no need (it’s ignored) to set `rbenv_users`.
Builds FE apps with Gulp
- Uses leonelgalan.node (😊, that’s me) recipe to install the
latest node, npm and install global npm packages: coffee-script, bower
and gulp
Removes unnecessary node installations
Node and necessary packages are installed in general
Uses vendor role to install PostgreSQL
- Previous setup left LATIN1 as the encoded which is very limited.
Housekeeping commit: minor changes 🚿
- Installer: Prevents overriding existing files/folders.
- Installer: Makes failures red
- Whitespacing
- Removes state=present (default) from general/base_packages
Restores deployment: `tape ansible deploy`
Renaming the roles broke it, @BrandonMathis and @iandonovan  please
review. I put back everything I thought was needed, but you know the
rename better than I do.

@leonelgalan leonelgalan force-pushed the chore/changes_needed_for_weaveup branch from 59124da to 50ae98f Jan 28, 2015

@leonelgalan

This comment has been minimized.

Contributor

leonelgalan commented Jan 28, 2015

⚠️ Don't merge yet ⚠️

@BrandonMathis

This comment has been minimized.

Contributor

BrandonMathis commented Jan 28, 2015

🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨 🚨

@iandonovan

This comment has been minimized.

Contributor

iandonovan commented on 05f4c63 Jan 28, 2015

@leonelgalan I can't tell too much from context here, but was your deploy error by any chance the one I hit yesterday? It's this:

I, [2015-01-27T19:53:51.871222 #5424]  INFO -- : Refreshing Gem list
/home/deployer/vanilla-rails-app/vendor/bundle/ruby/2.1.0/gems/execjs-2.2.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

If that's the case, then it has something to do with the way we install Node and then NPM. The version of Node we get via apt is old, and then it can't install NPM. Or maybe it's the other way around. But it's something there.

This comment has been minimized.

Contributor

leonelgalan replied Jan 28, 2015

No, the error was that before_deploy, web, and app_server roles where gone. The node issue is fixed by using my role.

This comment has been minimized.

Contributor

iandonovan replied Jan 28, 2015

mic_drop

@BrandonMathis

This comment has been minimized.

Contributor

BrandonMathis commented Jan 29, 2015

im gonna review this now

Magic 🌟
* Omnibox: Deploy worked, so I just reorder everything like Deploy had
it.
* _zzet.rbenv 2.0.0_ include my contributions so it’s cool!
* _ANXS.postgresql_ broke on Tuesday, so I fix it. PR is pending merge.
* Backend checkout didn’t need to “execute” _zzet.rbenv_ again! Also…No
need to install all the plugins, just _ruby-build_ and no need to
symlink anything.
* We were installing _build-essential_ and _git_, just for _rbenv_, but
that role takes care of itself!
* Install _bundle_r manually, _rbenv-default-gems_ only work with user
installs.
* Uses `rbenv_root` instead of hardcoded path in upstart scripts.
@leonelgalan

This comment has been minimized.

Contributor

leonelgalan commented Jan 29, 2015

Ready for review! Do not merge until my build finishes. I want to make sure bundle exec tape ansible everything works as advertised!

Changes fe_app build directory
Weave is using `/dist`, we might need to make this a parameter. Same
goes for using gulp, grunt or smashing dev tool. Oops forgot the last
change!
@leonelgalan

This comment has been minimized.

Contributor

leonelgalan commented Jan 29, 2015

We are good! It took may vagrant 42s to boot and 27m 50s to run ansible (28m 22s total)

date && vagrant destroy --force && vagrant up && date && bundle exec tape ansible everything -l vagrant && date && open "http://localhost:8080/" && date && say -v "Good News" "Deployed"

BrandonMathis added a commit that referenced this pull request Jan 29, 2015

@BrandonMathis BrandonMathis merged commit 27bc496 into master Jan 29, 2015

@BrandonMathis BrandonMathis removed the ready label Jan 29, 2015

@leonelgalan leonelgalan deleted the chore/changes_needed_for_weaveup branch Feb 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment