Skip to content

Prevent queue method to display output #268

@jmuheim

Description

@jmuheim

I have Rollbar exception tracking enabled for my project.

I want to notify Rollbar when I have deployed a new version. This can be done with the following code:

desc "Notifies rollbar."
task :notify_rollbar do
  revision = `git log -n 1 --pretty=format:"%H"`
  local_user = `whoami`
  rollbar_token = '???' # TODO: Store rollbar token at one single place!
  rails_env = 'production'
  queue "curl https://api.rollbar.com/api/1/deploy/ -F access_token=#{rollbar_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user} >/dev/null 2>&1"
end

I then do a invoke :'notify_rollbar' before the to :launch do ... end block.

This works well, but the output from the CURL command is displayed during deployment:

-----> DB migrations unchanged; skipping DB migration        
-----> Skipping asset precompilation        
       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       Dload  Upload   Total   Spent    Left  Speed
109   549    0    16  106   533     21    711 --:--:-- --:--:-- --:--:--  2123    0
       { 
         "data": {} 
       }-----> Build finished 
-----> Moving build to releases/35        
-----> Updating the current symlink 

This is nasty. Is there a way to prevent this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions