Code Monkey home page Code Monkey logo

noveku's Introduction

Noveku

A collection of aliases we use when interacting with heroku. This gem was inspired by a collection of thoughtbot aliases.

Prerequisites

Ruby 1.9+ only. This gem depends on novelys/gomon. However, the presence of the command heroku (either via the gem, or the toolbelt) is assumed

Installation

gem install noveku. Since it will not be part of your application, only of your workflow, you should install it globally, not via bundler and your project's Gemfile.

Usage

noveku ENV commands...: will execute the given commands for the ENV remote.

We strongly suggest adding shell aliases for convenience :

alias nvp='noveku production'
alias nvs='noveku staging'

Heroku commands

Supported commands and their equivalent :

  • rake : heroku run rake ARGS --remove ENV
  • console: heroku run console --remote ENV
  • migrate: heroku run rake db:migrate --remote ENV && heroku restart --remote ENV
  • tail: heroku logs --tail --remote ENV

When giving a command that is not specifically supported, it will be passed to heroku : heroku ARGS --remote ENV.
This makes several other commands available, such as restart, releases, ps, open...

Advanced commands

  • mongodump: Dumps the mongo database. Shortcut for both mongolab_dump and mongohq_dump: tries mongolab first, then mongohq.
  • mongolab_dump: Dumps the mongo database. Look in the config keys of ENV to find MONGOLAB_URI.
  • mongohq_dump: Dumps the mongo database. Look in the config keys of ENV to find MONGOHQ_URL.

Those commands put the dump in the dump dir, relatively to where you executed it.

Since the restoration of the database does not involve any interaction with heroku, it is out of the scope of this gem at the moment. However, this gem depends on novelys/gomon, which includes a class wrapping mongodump/restore, making it very easy to use in a rake task.

What's next

I plan on adding a command allowing you to create a heroku app, setup your addons, update your git config, create a local branch if needed.. all that in one step. We're still thinking about what the command api will look like. This will probably be the last feature before tagging 1.0.0.

Contributions

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. In the first case, please include a use-case.
  2. Fork the repository on Github, make a feature branch, work on this branch.
  3. If necessary, write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and annoy us until we notice it. :)

Changelog

  • 0.5: Test coverage, check the presence of environment & that it matches a heroku app, that pwd is a heroku app, the presence of mongohq/lab uri.
  • 0.4: Require gomon for mongodump, changed executable names, internal refactoring.
  • 0.3: Added mongodump, mongolab_dump, mongohq_dump.
  • 0.2: Added rake command.
  • 0.1: First version. Available commands : console, migrate, tail.

noveku's People

Contributors

ksol avatar alpmestan avatar

Watchers

Yann Klis avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.