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
# I am trying out Ratchet.io and I want to add their deployment notification to my | |
# normal capistrano deployment process. Here is my first working attempt. | |
# Add this task to your deploy.rb | |
task :notify_ratchetio, :roles => :app do | |
set :revision, `git log -n 1 --pretty=format:"%H"` | |
set :local_user, `whoami` | |
set :ratchetio_token, YOUR_ACCESS_TOKEN | |
rails_env = fetch(:rails_env, "production") | |
run "curl https://submit.ratchet.io/api/1/deploy/ -F access_token=#{ratchetio_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user}", :once => true |
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
function ignoreRemoteUncaught(isUncaught, args, payload) { | |
try { | |
var filename = payload.data.body.trace.frames[0].filename; | |
if (isUncaught && !filename.match(/^https?:\/\/www\.mycompany\.com/)) { | |
// Ignore uncaught errors that are not from www.mycompany.com. | |
return true; | |
} | |
} catch (e) { | |
// Most likely there was no filename or the frame doesn't exist. | |
} |