Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent queue method to display output #268

Closed
jmuheim opened this issue Jan 25, 2015 · 3 comments
Closed

Prevent queue method to display output #268

jmuheim opened this issue Jan 25, 2015 · 3 comments

Comments

@jmuheim
Copy link

jmuheim commented Jan 25, 2015

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?

@d4be4st
Copy link
Member

d4be4st commented Jan 25, 2015

you can try adding this to your curl call:

-s, --silent
Silent or quiet mode. Don't show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.

@jmuheim
Copy link
Author

jmuheim commented Jan 25, 2015

It seems that adding this option somehow makes the thing fail.

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} --silent >/dev/null 2>&1"

Output when deploying:

-----> Skipping asset precompilation        
       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       Dload  Upload   Total   Spent    Left  Speed
109   549    0    16  106   533     20    679 --:--:-- --:--:-- --:--:--  2011    0
       { 
         "data": {} 
       }! ERROR: Deploy failed. 
-----> Cleaning up build

@d4be4st
Copy link
Member

d4be4st commented Jan 26, 2015

Sorry, this is a curl bug/problem and not mina. There is nothing more we can do for you :(

@d4be4st d4be4st closed this as completed Mar 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants