Showing posts with label Heroku. Show all posts
Showing posts with label Heroku. Show all posts

Friday, April 30, 2010

List of heroku commands

Hi,
Below are the list of available list of heroku commands

help # show this usage
version # show the gem version

list # list your apps
create [] # create a new app

keys # show your user's public keys
keys:add [] # add a public key
keys:remove # remove a key by name (user@host)
keys:clear # remove all keys

info # show app info, like web url and
open # open the app in a web browser
rename # rename the app

dynos # scale to qty web processes
workers # scale to qty background processe

sharing:add # add a collaborator
sharing:remove # remove a collaborator
sharing:transfer # transfers the app ownership

domains:add # add a custom domain name
domains:remove # remove a custom domain name
domains:clear # remove all custom domains

ssl:add # add SSL cert to the app
ssl:remove # removes SSL cert from the app do

rake # remotely execute a rake command
console # remotely execute a single consol
console # start an interactive console to

restart # restart app servers
logs # fetch recent log output for debu
logs:cron # fetch cron log output

maintenance:on # put the app into maintenance mod
maintenance:off # take the app out of maintenance

config # display the app's config vars (e
config:add key=val [...] # add one or more config vars
config:remove key [...] # remove one or more config vars
config:clear # clear user-set vars and reset to

stack # show current stack and list of a
stack:migrate # prepare migration of this app to

db:pull [] # pull the app's database into a l
db:push [] # push a local database into the a
ase
db:reset # reset the database for the app

bundles # list bundles for the app
bundles:capture [] # capture a bundle of the app's co
bundles:download # download most recent app bundle
bundles:download # download the named bundle
bundles:animate # animate a bundle into a new app
bundles:destroy # destroy the named bundle

addons # list installed addons
addons:info # list all available addons
addons:add name [key=value] # install addon (with zero or more
addons:remove name # uninstall an addons
addons:clear # uninstall all addons

destroy # destroy the app permanently

=== Plugins

plugins # list installed plugins
plugins:install # install the plugin from the spec
plugins:uninstall # remove the specified plugin

=== Example:

rails myapp
cd myapp
git init
git add .
git commit -m "my new app"
heroku create
git push heroku master

Thursday, April 29, 2010

Rails application deployment with heroku

Install git
Generate RSA public and Private keys in your system
Required Gems
Heroko
Taps - By default heroku uses postgreSQL as the database, so use this gem to convert your database from mysql to postgresql.

First create an account in heroku.com website.
Open terminal and CD to the application you want to deploy
#git init
#git add .
#git commit -m 'First submit'
Till now one empty git repository (.git) created in your local application folder and save the changes in the local repository.

#heroku create appname
It will ask you the email and password which you have already signup in heroku.com and create the appname in heroku as subdomain. i.e appname.heroku.com

#git push heroku master
This command will transfer all your files from local repo to the heroku application.

Process for Database Push and Pull
#heroku rake db:migrate
This will migrate all your local db to heroku, Make sure to maintain migrations clearly
#heroku rake db:push

Sometimes you may face many problems in db migrations, so take care of db migrations. If you face problems, just us heroku db:push without heroku rake db:migrate.

#Other commands
#heroku db:pull
to pull the db from heroku
#heroku db:open
to c all heroku commands


Repeate the above process when you change any modification to the files.