• Stars
    star
    584
  • Rank 76,554 (Top 2 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 15 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Helpful stuffs for Heroku.

Heroku San

Helpful rake tasks for Heroku.

Build Status Code Climate Gemnasium

Install

Rails 3+

Add this to your Gemfile:

  group :development do
    gem 'heroku_san'
  end

Rails 2

To install add the following to config/environment.rb:

  config.gem 'heroku_san'

Rake tasks are not automatically loaded from gems, so you’ll need to add the following to your Rakefile:

  begin
    require 'heroku_san/tasks'
  rescue LoadError
    STDERR.puts "Run `rake gems:install` to install heroku_san"
  end

Sinatra

Update your Gemfile:

  group :development do
    gem 'heroku_san'
  end

Update your Rakefile:

  require "bundler/setup"
  begin
    require "heroku_san"
    config_file = File.join(File.expand_path(File.dirname(__FILE__)), 'config', 'heroku.yml')
    HerokuSan.project = HerokuSan::Project.new(config_file, :deploy => HerokuSan::Deploy::Sinatra)
    load "heroku_san/tasks.rb"
  rescue LoadError
    # The gem shouldn't be installed in a production environment
  end

Configure

In config/heroku.yml you will need to add the Heroku apps that you would like to attach to this project. You can generate this file by running:

Rails 3+

  rails generate heroku_san

Everything else

  rake heroku:create_config

Customize the file for your project. If this is a fresh project, heroku_san can create all the applications for you, and set each one's RACK_ENV.

  rake all heroku:create heroku:rack_env

Configure your Heroku apps according to config/heroku.yml by running:

  rake all heroku:config

Usage

After configuring your Heroku apps you can use rake tasks to control the apps.

  rake production deploy

A rake task with the shorthand name of each app is now available and adds that server to the list that subsequent commands will execute on. Because this list is additive, you can easily select which servers to run a command on.

  rake demo staging restart

A special rake task 'all' is created that causes any further commands to execute on all Heroku apps.

  rake all restart

Need to add remotes for each app?

rake all heroku:remotes

A full list of tasks provided:

  rake heroku:addons                # Install addons for the application.
  rake heroku:addons:local          # List configured addons, without installing them
  rake heroku:apps                  # Lists configured apps
  rake heroku:apps:local            # Lists configured apps without hitting heroku
  rake heroku:config                # Add config:vars to each application.
  rake heroku:config:list           # Lists config variables as set on Heroku
  rake heroku:config:list:local     # Lists local config variables without setting them
  rake heroku:config:rack_env       # Add proper RACK_ENV to each application
  rake heroku:console               # Opens a remote console
  rake heroku:create                # Creates the Heroku app
  rake heroku:create_config         # Creates an example configuration file
  rake heroku:db:migrate            # Migrates and restarts remote servers
  rake heroku:db:pull               # Pull database from stage to local dev database
  rake heroku:deploy[commit]        # Pushes the given commit, migrates and restarts (default: HEAD)
  rake heroku:deploy:after          # Callback after deploys
  rake heroku:deploy:before         # Callback before deploys
  rake heroku:deploy:force[commit]  # Force-pushes the given commit, migrates and restarts (default: HEAD)
  rake heroku:logs                  # Shows the Heroku logs
  rake heroku:logs:tail             # Tail the Heroku logs (requires logging:expanded)
  rake heroku:maintenance           # Enable maintenance mode
  rake heroku:maintenance_off       # Disable maintenance mode
  rake heroku:maintenance_on        # Enable maintenance mode
  rake heroku:push[commit]          # Pushes the given commit (default: HEAD)
  rake heroku:push:force[commit]    # Force-pushes the given commit (default: HEAD)
  rake heroku:rake[task]            # Runs a rake task remotely
  rake heroku:remotes               # Add git remotes for all apps in this project
  rake heroku:restart               # Restarts remote servers
  rake heroku:shell                 # Opens a bash shell within app
  rake heroku:stage:all             # Select all Heroku apps for later command

Frequently used tasks are aliased into the global namespace:

  task :all           => 'heroku:stage:all'
  task :deploy        => 'heroku:deploy'
  task 'deploy:force' => 'heroku:deploy:force'
  task :before_deploy => 'heroku:deploy:before'
  task :after_deploy  => 'heroku:deploy:after'
  task :console       => 'heroku:console'
  task :restart       => 'heroku:restart'
  task :migrate       => 'heroku:db:migrate'
  task :logs          => 'heroku:logs:default'
  task 'logs:tail'    => 'heroku:logs:tail'
  task 'shell'        => 'heroku:shell'

Links

Homepage: http://github.com/fastestforward/heroku_san

Issue Tracker: http://github.com/fastestforward/heroku_san/issues

Contributors

License

Copyright (c) 2008-2012 Elijah Miller mailto:[email protected], released under the MIT license.

More Repositories

1

php-serialize

Use PHP's serialization methods from Ruby.
Ruby
126
star
2

dotfiles

Super bad-ass dotfiles for any Ruby/Rails/Git/OSX user.
Shell
58
star
3

achievement_maker

Generate your own achievements
Ruby
48
star
4

jqr.github.io

My jekyll based blog
JavaScript
24
star
5

typed_serialize

Typed serialize makes sure your serialized attribute is always the specified type.
Ruby
19
star
6

simple_column_search

Quick and dirty multi column LIKE searches.
Ruby
17
star
7

has_one_autocreate

A Rails plugin for automatic creation and building for has_one relationships
Ruby
16
star
8

easyjour

Super simple access to service announcing and discovery using Bonjour aka DNSSD.
Ruby
11
star
9

centipede

A clone of the the popular Centipede arcade game, produced at Indy.rb's first gosu hackfest.
Ruby
10
star
10

static_pages

Provides an area to store your static pages that still need to be rendered with the application layout.
Ruby
8
star
11

negative_named_scope

A Rails plugin to automatically generate the NOT'd version of your named scope.
Ruby
6
star
12

usernamecheck

Checks username availability on many populer sites.
Ruby
6
star
13

postgres_sequence_support

Support for manipulating PostgreSQL sequences from ActiveRecord.
Ruby
5
star
14

super_range

Support for open ended ranges in Ruby.
Ruby
5
star
15

air_speakers

A simple interface to Airport Express speakers using Net::RAOP::Client
Ruby
5
star
16

tower

A simple Tower Defense game written in Ruby with Gosu.
Ruby
5
star
17

lolcodr

An exploration of Treetop via a simple LOLCode interpreter.
Ruby
5
star
18

stale_object_destroyer

An easy way to handle stale object errors in Rails by retrying the entire request.
Ruby
4
star
19

dnssd

C
4
star
20

versionable

Simple versioning for Ruby objects using only the Rails cache.
Ruby
3
star
21

hyrarchy

Gem and Rails plugin for working with hierarchic data in ActiveRecord
Ruby
3
star
22

log_methods

Log methods shows you exactly what arguments a method was called with and what it returned.
2
star
23

thor_tasks

2
star
24

github_playground

Scripts and such to play with github.
Ruby
2
star
25

vimtips

A Merb app for inputting Vim tips that are <= 140 characters, for posting to Twitter.
Ruby
1
star
26

processing_playground

Just some hacks related to the Processing language.
1
star
27

elixir-playground

Elixir
1
star
28

status

Ruby
1
star