Skip to content

Commit

Permalink
Cleaned up rakefile a little.
Browse files Browse the repository at this point in the history
  • Loading branch information
icco committed Oct 13, 2010
1 parent d46f7c8 commit 96f667f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Rakefile
Expand Up @@ -6,29 +6,31 @@ end

desc "Deploy to Heroku."
task :deploy do
require 'heroku'
require 'heroku/command'
user, pass = File.read(File.expand_path("~/.heroku/credentials")).split("\n")
heroku = Heroku::Client.new(user, pass)
require 'rubygems'
require 'heroku'
require 'heroku/command'
user, pass = File.read(File.expand_path("~/.heroku/credentials")).split("\n")
heroku = Heroku::Client.new(user, pass)

cmd = Heroku::Command::BaseWithApp.new([])
remotes = cmd.git_remotes(File.dirname(__FILE__) + "/../..")
cmd = Heroku::Command::BaseWithApp.new([])
remotes = cmd.git_remotes(File.dirname(__FILE__) + "/../..")

remote, app = remotes.detect {|key, value| value == (ENV['APP'] || cmd.app)}
remote, app = remotes.detect {|key, value| value == (ENV['APP'] || cmd.app)}

if remote.nil?
raise "Could not find a git remote for the '#{ENV['APP']}' app"
end
if remote.nil?
raise "Could not find a git remote for the '#{ENV['APP']}' app"
end

`git push #{remote} master`
`git push #{remote} master`

heroku.restart(app)
heroku.restart(app)
end

desc "deploy to user.github.com/Resume"
task :github do
require 'git'
require 'resume'
require 'rubygems'
require 'git'
require 'rack/test'
require 'logger'

Expand Down

0 comments on commit 96f667f

Please sign in to comment.