From a84b6ec7852b496feb9c095ca8e94c65eb235fa2 Mon Sep 17 00:00:00 2001 From: Dominic Jodoin Date: Thu, 18 Oct 2018 07:38:08 -0400 Subject: [PATCH 1/4] Print name of created cache archive (#36) * Print name of created cache archive --- bin/casher | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/casher b/bin/casher index 45b2b90..80f93f1 100755 --- a/bin/casher +++ b/bin/casher @@ -62,7 +62,7 @@ class Casher msg "attempting to download cache archive" archive_found = false urls.each do |url| - msg "fetching #{%r(([^/]+?/[^/]+?)(\?.*)?$).match(url)[1]}" + msg "fetching #{cache_archive_name(url)}" @fetch_tar = File.expand_path('fetch.tgz', @casher_dir) if path_ext(url) == 'tgz' @@ -130,18 +130,20 @@ class Casher return end - msg "changes detected, packing new archive" - @push_tar = File.expand_path('push.tgz', @casher_dir) if path_ext(url) == 'tgz' + msg "changes detected, packing new archive" + tar(:c, @push_tar, *cached_directories) do @counter += 1 puts "." if @counter % 5 == 0 sleep 1 end - msg "uploading archive" - unless system "curl -T %p %p -f -v >#{@casher_dir}/push.log 2>#{@casher_dir}/push.err.log" % [@push_tar, url] + msg "uploading #{cache_archive_name(url)}" + if system "curl -T %p %p -f -v >#{@casher_dir}/push.log 2>#{@casher_dir}/push.err.log" % [@push_tar, url] + msg "cache uploaded" + else msg "failed to upload cache", :red puts filter_http_params(File.read("#{@casher_dir}/push.err.log")), filter_http_params(File.read("#{@casher_dir}/push.log")) end @@ -207,6 +209,10 @@ class Casher [stdout, errors] end + def cache_archive_name(url) + %r(([^/]+?\/[^/]+?)(\?.*)?\?).match(url)[1] + end + def path_ext(url) path = URI.split(url)[5] path.split('.').last From 80107bbff5dc88572173f532dfa3218aff748d83 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Tue, 4 Dec 2018 15:54:18 -0500 Subject: [PATCH 2/4] Remove from curl's STDERR lines starting with 'PUT' This probably contains signed URL that we want to hide from plain view. --- bin/casher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/casher b/bin/casher index 80f93f1..1d08e9e 100755 --- a/bin/casher +++ b/bin/casher @@ -203,7 +203,7 @@ class Casher if !status.success? && flag.to_s != 'x' msg "FAILED: #{cmd}", :red - puts errors, output + puts errors.delete_if {|l| l.start_with? 'PUT'}, output end [stdout, errors] From 02c9572b3313eccdf71c4d62fe23eef4bccf0b95 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Mon, 17 Dec 2018 09:15:29 -0500 Subject: [PATCH 3/4] Split STDERR for filtering We need an Array for `#delete_if`. --- bin/casher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/casher b/bin/casher index 1d08e9e..df7b132 100755 --- a/bin/casher +++ b/bin/casher @@ -203,7 +203,7 @@ class Casher if !status.success? && flag.to_s != 'x' msg "FAILED: #{cmd}", :red - puts errors.delete_if {|l| l.start_with? 'PUT'}, output + puts errors.split.delete_if {|l| l.start_with? 'PUT'}, output end [stdout, errors] From 0d95b954b954fc4df116b79f80cffff0b5cf1684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20de=20Ant=C3=B3n?= Date: Thu, 14 Mar 2019 12:49:54 +0100 Subject: [PATCH 4/4] remove sudo key since it's been deprecated Travis CI uses a single linux infrastructure https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e08c48f..1523a5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: ruby -sudo: false - rvm: - 1.9.3 - 2.1.5