Skip to content

Commit

Permalink
removed node-app, information about deploying to heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Wnętrzak committed Jul 20, 2011
1 parent 07e4e71 commit 0a62690
Show file tree
Hide file tree
Showing 832 changed files with 30 additions and 238,958 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ db/*.rdb

config/redis.yml
config/database.yml
app-node/config.json
60 changes: 29 additions & 31 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,29 @@ If you are using rvm, create new gemset to not mess with your default gems

cp config/redis.yml.example config/redis.yml
cp config/database.yml.example config/database.yml
cp app-node/config.json.example app-node/config.json

3. Setup Redis

Run redis (download from http://redis.io/download) - tested on 2.0 and 2.2 stable releases

4. Run node server (download from http://nodejs.org/#download) - tested on (v0.4.3, v0.4.7-v.0.5.0)
4. Run node server

Go to app-node directory directly (this is necessary to load configuraion file using relative path see https://github.com/joyent/node/issues/1326)
Instructions for installing node can be found at https://github.com/wolfgangihloff/peergroup-node

cd app-node && node server.js
Clone peergroup-node repository:

Tip: You can also use nvm https://github.com/creationix/nvm
git clone git://github.com/wolfgangihloff/peergroup-node.git

You can run node as root user (sudo node ...) or with `authbind` (authbind node ...), so socket.io could bind to low port to serve xml policy file for Flash.
Run node server

node server.js

5. Run the application

bundle exec rails server

6. Open http://localhost:3000

== Development

Node packages are managed by http://npmjs.org/, however it is not neccessary to run node
server. When you want to update packages, change file app-node/package.json and run npm
update.

== Running tests

=== BIG WARNING:
Expand All @@ -66,17 +61,12 @@ You have been warned!

3. Run Node server instance
REDIS_DB should be number that you specified in config/redis.yml
NODE_ENV should be set to test

REDIS_DB=1 NODE_ENV=test node app-node/server.js

Above command can be run as:

rake spec:start_node
REDIS_DB=1 PGS_PORT=3666 node app-node/server.js

Eventually you can connect to separate instace of redis server (if running)

REDIS_DB=1 REDIS_PORT=6380 NODE_ENV=test node app-node/server.js
REDIS_DB=1 REDIS_PORT=6380 node app-node/server.js

4. Run tests:

Expand Down Expand Up @@ -113,24 +103,32 @@ Selenium::WebDriver::Error::ObsoleteElementError, try to use wait_until method.

== Deploying

If you are having problems with compiling sass files, try this:
It's possible to run application on heroku.

To have your own instance on heroku:

1. Install heroku client

gem install heroku

2. Create application

heroku create --stack cedar my-peergroup-app-name

bundle exec compass compile -e production --force
3. Setup configuration variables

On production server mysql database is used.
heroku config:add NODE_PORT=80 NODE_USERNAME=node NODE_PASSWORD=secret NODE_PROTOCOL=http

Credentials are stored in non tracked file config/database.yml
* NODE_USERNAME/NODE_PASSWORD - credentials that will allow node server to connect

If you have problems with installing mysql2 gem, check this: http://stackoverflow.com/questions/3608287/installing-mysql2-gem-for-rails-3
4. Add redis addon

If you don't have mysql database at all, you can bundle gems by: bundle install --without production
heroku addons:add redistogo:nano

Node server is managed by init script placed in /etc/init.d/node-peergroup
5. Deploy code

Deployment is done by Capistrano.
git push heroku master

Deployment process:
Refer to heroku [docs](http://devcenter.heroku.com/articles/rails31_heroku_cedar) for more informations.

* make changes, commit and push to github server
* from your local machine, type: cap deploy
* That's all
6. Setup node server using REDISTOGO_URL - https://github.com/wolfgangihloff/peergroup-node#readme
22 changes: 0 additions & 22 deletions app-node/config.json.example

This file was deleted.

Loading

0 comments on commit 0a62690

Please sign in to comment.