Skip to content

Instantly share code, notes, and snippets.

@xdite xdite/Rakefile
Created Apr 20, 2013

Embed
What would you like to do?
require 'rubygems'
require 'bundler'
Bundler.require(:default)
@config = YAML::load_file('config.yml')
def send_deploying_message(rev)
send("#{human} is deploying bot (revision #{rev}) to production.")
end
def send_finished_deploy_message(rev)
send("#{human} finished deploying bot (revision #{rev}) to production.", "yellow")
end
def send(message, color = "green")
api_token = @config['hipchat']['token']
client = HipChat::Client.new(api_token)
client['Rocodev Log'].send('Deploy', message, :color => color)
end
def human
`git config user.name`
end
def revision
version = `git ls-remote git@github.com:rocodev/Your-repo.git master`
version[0..7]
end
task :deploy do
rev = revision
send_deploying_message(rev)
system "gitploy production"
send_finished_deploy_message(rev)
puts "done!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.