Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define :notify_airbrake, :name=>nil, :environment=>nil, :repository=>nil do
- script "notifying airbrake of deploy" do
- interpreter "ruby"
- user "deployer"
- cwd params[:name]
- code <<-EOS
- require 'rubygems'
- unless File.exist?("#{params[:name]}/config/initializers/airbrake.rb")
- puts "!!! airbrake.rb not found. Not notifying Airbrake of the deploy !!!"
- exit 0
- end
- # Setup the airbrake api_key
- require 'airbrake'
- require 'airbrake_tasks'
- require "#{params[:name]}/config/initializers/airbrake.rb"
- revision = `cd #{params[:name]} && git rev-parse HEAD`.chomp
- print "Airbrake : "
- AirbrakeTasks.deploy(:rails_env => '#{params[:environment]}',
- :scm_revision => revision,
- :scm_repository => '#{params[:repository]}',
- :local_username => 'chef')
- EOS
- end
- end
Add Comment
Please, Sign In to add comment