Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update README.md

  • Loading branch information...
commit 45070ddf35bb4c4a647e9bdc3445ab727831798f 1 parent dbcb64d
@1602 authored
Showing with 90 additions and 0 deletions.
  1. +90 −0 README.md
View
90 README.md
@@ -0,0 +1,90 @@
+## Roco
+
+Command line tool allows you to execute commands on remote server(s) or locally.
+Useful for deployment, monitoring and other tasks.
+
+## Installation
+
+ npm install roco -g
+
+## Usage
+
+ roco deploy:setup # prepare deploy (create directories)
+ roco deploy # update code and restart server
+
+## Configuring
+
+### package.json
+
+roco looking for package.json in working directory and set these variables:
+
+- `pkg.name` as `application`
+- `pkg.repository.name` as `repository`
+- `pkg.repository.type` as `scm`
+
+### Roco.coffee
+
+roco looking for Roco.coffee file in `/etc/roco.coffee`, `~/.roco.coffee`, `./Roco.coffee`, `./config/Roco.coffee` paths
+
+This files can extend behavior of roco and configure variables. Checkout examples to learn how to use it
+
+### ENV vars
+
+- `HOSTS` - comma separated list of hosts
+- `APP` - name of application
+
+## Examples
+
+### my ~/.roco.coffee file
+
+```coffee-script
+namespace 'deploy', ->
+ # show status of running application
+ task 'status', ->
+ run "sudo status #{roco.application}"
+
+namespace 'git', ->
+ # setup remote private repo
+ task 'remote', ->
+ app = roco.application
+ run """
+ mkdir #{app}.git;
+ cd #{app}.git;
+ git --bare init;
+ true
+ """, (res) ->
+ localRun """
+ git remote add origin #{res[0].host}:#{app}.git;
+ git push -u origin master
+ """
+
+# some tasks for monitoring server state
+namespace 'i', ->
+ task 'disk', (done) -> run 'df -h', done
+ task 'top', (done) -> run 'top -b -n 1 | head -n 12', done
+ task 'who', (done) -> run 'who', done
+ task 'node', (done) -> run 'ps -eo args | grep node | grep -v grep', done
+ task 'free', (done) -> run 'free', done
+
+ task 'all', (done) ->
+ sequence 'top', 'free', 'disk', 'node', done
+```
+
+## Deploy
+
+Current deploy script allows you deploy upstart-controlled applications out of box, just run
+
+ roco deploy:setup:upstart
+
+to setup upstart script and create dirs, if you use another solution for node daemon management
+feel free to rewrite start/stop/restart scripts:
+
+```coffee-script
+namespace 'deploy', ->
+ task 'start', (done) -> run "cd #{roco.application}; forever start server.js"
+ task 'stop', (done) -> run "cd #{roco.application}; forever stop"
+```
+
+## License
+
+MIT
Please sign in to comment.
Something went wrong with that request. Please try again.