{"id":16981953,"url":"https://github.com/1602/roco","last_synced_at":"2025-06-26T10:33:09.977Z","repository":{"id":2395397,"uuid":"3361900","full_name":"1602/roco","owner":"1602","description":"Deploy app to remote server via ssh, inspired by capistrano","archived":false,"fork":false,"pushed_at":"2014-09-11T14:47:20.000Z","size":270,"stargazers_count":83,"open_issues_count":5,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-21T11:48:03.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1602.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-05T20:19:49.000Z","updated_at":"2023-12-11T07:56:55.000Z","dependencies_parsed_at":"2022-09-09T15:42:44.354Z","dependency_job_id":null,"html_url":"https://github.com/1602/roco","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/1602/roco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Froco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Froco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Froco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Froco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1602","download_url":"https://codeload.github.com/1602/roco/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1602%2Froco/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261668993,"owners_count":23192362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T02:06:55.667Z","updated_at":"2025-06-26T10:33:09.935Z","avatar_url":"https://github.com/1602.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stories in Ready](https://badge.waffle.io/1602/roco.png?label=ready)](https://waffle.io/1602/roco)\n## Roco\n\nCommand line tool allows you to execute commands on remote server(s) or locally.\nUseful for deployment, monitoring and other tasks.\n\n## Installation\n\n    npm install roco -g\n\n## Usage\n\n    roco deploy:setup   # prepare deploy (create directories)\n    roco deploy         # update code and restart server\n\n## Configuring\n\nUse one of three ways for configuring your app: package.json, roco.coffee or ENV vars\n\n### package.json\n\nroco looking for package.json in working directory and set these variables:\n\n- `pkg.name` as `application`\n- `pkg.repository.name` as `repository`\n- `pkg.repository.type` as `scm`\n\n### Roco.coffee\n\nroco looking for Roco.coffee file in `/etc/roco.coffee`, `~/.roco.coffee`, `./Roco.coffee`, `./config/Roco.coffee` paths\n\nThis files can extend behavior of roco and configure variables. Checkout examples to learn how to use it\n\n### ENV vars\n\n- `HOSTS` - comma separated list of hosts\n- `APP` - name of application\n\n## Examples\n\n### my ~/.roco.coffee file\n\n```coffee-script\nnamespace 'deploy', -\u003e\n    # show status of running application\n    task 'status', -\u003e\n        run \"sudo status #{roco.application}\"\n\nnamespace 'git', -\u003e\n    # setup remote private repo\n    task 'remote', -\u003e\n        app = roco.application\n        run \"\"\"\n        mkdir #{app}.git;\n        cd #{app}.git;\n        git --bare init;\n        true\n        \"\"\", (res) -\u003e\n            localRun \"\"\"\n            git remote add origin #{res[0].host}:#{app}.git;\n            git push -u origin master\n            \"\"\"\n\n# some tasks for monitoring server state\nnamespace 'i', -\u003e\n    task 'disk', (done) -\u003e run 'df -h', done\n    task 'top',  (done) -\u003e run 'top -b -n 1 | head -n 12', done\n    task 'who',  (done) -\u003e run 'who', done\n    task 'node', (done) -\u003e run 'ps -eo args | grep node | grep -v grep', done\n    task 'free', (done) -\u003e run 'free', done\n\n    task 'all', (done) -\u003e\n        sequence 'top', 'free', 'disk', 'node', done\n\n    # display last 100 lines of application log\n    task 'log', -\u003e\n        run \"tail -n 100 #{roco.sharedPath}/log/#{roco.env}.log\"\n```\n\n## Deploy\n\nCurrent deploy script allows you deploy upstart-controlled applications out of box, just run\n\n    roco deploy:setup:upstart\n\nto setup upstart script and create dirs, if you use another solution for node daemon management\nfeel free to rewrite start/stop/restart scripts:\n\n```coffee-script\nnamespace 'deploy', -\u003e\n    task 'start', (done) -\u003e run \"cd #{roco.currentPath}; forever start server.js\"\n    task 'stop', (done) -\u003e run \"cd #{roco.currentPath}; forever stop\"\n```\n\n## Another snippets\n\n### Update nodejs on server(s)\n\n~/.roco.coffee:\n\n```coffee-script\nset 'nodever', '0.8.10'\nnamespace 'node', -\u003e\n  task 'update', (done) -\u003e sequence 'download', 'unpack', 'compile', 'install', done\n  task 'rebuild', (done) -\u003e sequence 'unpack', 'compile', 'install', done\n  task 'download', (done) -\u003e\n    run \"cd /tmp \u0026\u0026 wget http://nodejs.org/dist/v#{roco.nodever}/node-v#{roco.nodever}.tar.gz\", done\n  task 'unpack', (done) -\u003e\n    run \"cd /tmp \u0026\u0026 tar xfv node-v#{roco.nodever}.tar.gz\", done\n  task 'compile', (done) -\u003e\n    run \"cd /tmp/node-v#{roco.nodever} \u0026\u0026 ./configure \u0026\u0026 make\", done\n  task 'install', (done) -\u003e\n    run \"cd /tmp/node-v#{roco.nodever} \u0026\u0026 sudo make install\", done\n```\n\nExample: update nodejs on `localhost` and `railwayjs.com` hosts\n\n    HOSTS=localhost,railwayjs.com roco node:update\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1602%2Froco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1602%2Froco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1602%2Froco/lists"}