update docs for npm integration

This commit is contained in:
Devin Howard 2016-08-01 08:54:03 +08:00
parent ad2814b14e
commit 2085460c91
5 changed files with 30 additions and 5 deletions

View file

@ -15,9 +15,10 @@ Now install homebrew.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then install nodejs
Then install nodejs and frontend code
brew install nodejs
(cd frontend && npm install && npm run build)
And postgresql:

View file

@ -50,6 +50,12 @@ Install the specific version of ruby needed this will take some time
rvm install $(cat metamaps/.ruby-version)
While that is running, you can open another terminal and install the npm frontend code
cd frontend
npm install
npm run build
Now we also need to copy .example-env to a new file named .env. Review the
configuration in here to see if you need any changes.

View file

@ -20,6 +20,13 @@ Now you are ready to clone the Metamaps git repository:
The third `bundle install` command downloads and installs the rubygem
dependencies of Metamaps.
You also need to install the Javascript frontend code from the nodejs repositories:
cd frontend
npm install
npm run build
cd ..
At this point you should be in C:\git\metamaps, or whatever equivalent
directory you've chosen. The next step is to set up your database
configuration. From the metamaps directory, run

View file

@ -55,12 +55,23 @@ Run this in the metamaps directory, still as metamaps:
# Set up environment variables in your current session
source .env
export RAILS_ENV=production
export NODE_ENV=production
# create, load schema, seed
rake db:setup
Now set up nginx - config stored on Linode, including relevant environment
variables.
#### Install js frontend code
sudo aptitude install nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd frontend
npm install
npm run build
#### Nginx and SSL
Now set up nginx - config stored on Linode, including relevant
environment variables.
Get an SSL certificate and encrypt it for the realtime video.
@ -75,8 +86,6 @@ server to see what problems show up:
#### Realtime server:
sudo aptitude install nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g forever
(crontab -u metamaps -l 2>/dev/null; echo "@reboot $(which forever) --append -l /home/metamaps/logs/forever.realtime.log start /home/metamaps/metamaps/realtime/realtime-server.js") | crontab -u metamaps -

View file

@ -19,9 +19,11 @@ OR
Now that you have the code, run these commands:
export RAILS_ENV=production
export NODE_ENV=production
source .env
bundle install
(cd frontend && npm install && npm run build)
rake db:migrate
rake assets:precompile
rake perms:fix