Created
May 18, 2009 03:01
-
-
Save squeejee/113292 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after :deploy, :tweet_presently | |
after "deploy:migrations", :tweet_presently | |
desc "Tweet into the present.ly group for this project" | |
task :tweet_presently, :roles => :app do | |
build_environment = (ENV['cap_server'].nil? ? "DEV" : ENV['cap_server']) | |
presently_user_name = ENV['PRESENTLY_USER'] | |
presently_user_name = "@#{presently_user_name.to_s.downcase}" unless presently_user_name.nil? | |
presently_user_name = ENV['USER'].capitalize if presently_user_name.blank? | |
message = "b tweetcongress #{presently_user_name} deployed a build to #{stage.to_s.upcase}" | |
url = URI.parse("https://squeejee.presentlyapp.com/api/twitter/statuses/update.xml") | |
req = Net::HTTP::Post.new(url.path) | |
req.basic_auth('user', 'pass') | |
req.set_form_data('status' => message, 'source' => 'capistrano') | |
net_http = Net::HTTP.new(url.host, url.port) | |
net_http.use_ssl = true | |
net_http.start { |http| http.request(req) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment