capistrano-scm-bamboo 1.4.3 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Scm
3
3
  module Bamboo
4
- VERSION = "1.4.3"
4
+ VERSION = "1.4.4"
5
5
  end
6
6
  end
7
7
  end
@@ -14,7 +14,7 @@ module Capistrano
14
14
  end
15
15
 
16
16
  def load_result
17
- response = Typhoeus::Request.get("#{repository}/result/#{plan_key}/#{variable(:build_number)}.json?expand=artifacts", :username => variable(:scm_username), :password => variable(:scm_passphrase))
17
+ response = Typhoeus::Request.get("#{repository}/result/#{plan_key}/#{variable(:build_number)}.json?expand=artifacts", :userpwd => "#{variable(:scm_username)}:#{variable(:scm_passphrase)}")
18
18
  result = JSON.parse(response.body)
19
19
  end
20
20
 
@@ -49,12 +49,14 @@ module Capistrano
49
49
 
50
50
  # now do clever hackiness to detect whether this is a directory to be synced, or a single inline file/attachment
51
51
  artifact_headers = Typhoeus::Request.head(artifactUrl).headers_hash
52
- # if there's a content disposition of attachment, downolad the file directly. if inline, then ?. if no content disposition, then wget the whole directory.
53
- artifact_content_disposition = artifact_headers["Content-Disposition"]
54
- if (artifact_content_disposition.empty?)
52
+
53
+ if (!artifact_headers.include?("Content-Disposition"))
55
54
  @artifact_name = variable(:artifact)
56
55
  %Q{TMPDIR=`mktemp -d -t tmp.XXXXXXXXXX` && cd $TMPDIR && wget -m -nH -q #{artifactUrl} && mv artifact/#{plan_key}/shared/build-#{build_actual}/#{variable(:artifact)}/ "#{destination}" && rm -rf "$TMPDIR"}
57
56
  else
57
+ # if there's a content disposition of attachment, downolad the file directly. if inline, then ?. if no content disposition, then wget the whole directory.
58
+ artifact_content_disposition = artifact_headers["Content-Disposition"]
59
+
58
60
  # get the filename
59
61
  @artifact_name = artifact_content_disposition.match(/filename="(.*?)"/)[1]
60
62
  %Q{TMPDIR=`mktemp -d -t tmp.XXXXXXXXXX` && cd $TMPDIR && wget -m -nH -q #{artifactUrl} -O #{@artifact_name} && mkdir #{destination} && mv #{@artifact_name} "#{destination}/" && rm -rf "$TMPDIR"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-scm-bamboo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: