Permalink
Browse files

only show progress if stdout is a tty

It's nice to see progess via the mixlib-shellout live stream when
running release.rb by hand, but it's a big hassle when looking at the
jenkins logs. Test if STDOUT is a tty to turn progress on or off.
  • Loading branch information...
1 parent 9d27b76 commit 8cfca36c17eccd45a84dc3dd14dc519b4fa5da4a @danielsdeleo danielsdeleo committed Mar 27, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 jenkins/release.rb
View
@@ -285,11 +285,19 @@ def shellout_opts
{:timeout => 1200, :live_stream => STDOUT}
end
+ def progress
+ if STDOUT.tty?
+ "--progress"
+ else
+ "--no-progress"
+ end
+ end
+
def upload_package(local_path, s3_path)
s3_cmd = ["s3cmd",
"-c #{options[:package_s3_config_file]}",
"put",
- "--progress",
+ progress,
"--acl-public",
local_path,
"s3://#{options[:bucket]}#{s3_path}"].join(" ")

0 comments on commit 8cfca36

Please sign in to comment.