jara 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 390cfe77cedd54e751195bd87e096ec44193abc3
4
- data.tar.gz: e542f1569f3cead1ee7011fccc25e1fd60d21d5a
3
+ metadata.gz: ce788b9e5d1533e6c4e79b70ec143fdbeec85f7e
4
+ data.tar.gz: d718a9cbc873b371ed2ba12d9b1f6c3fe0f3debd
5
5
  SHA512:
6
- metadata.gz: 80991601f90b3add850a67a91bf3ff85347fcb5a36ef29e155262d439730a3705a4cb1e6baa37aa4a5fae0e47c5db12938dca1cf6028ab0a58dfa97c958b581a
7
- data.tar.gz: f7009d68e0f8c71b1f932cddb28c8f652d9d0c48b06d319ea903f3b4a55047f462aa103d2499c809252d9239ea32d2506032c9639a12066e3b604f12f20d29ef
6
+ metadata.gz: 92c63984645cf24220f20ba95e009e284074ab4d2831e45d0916bbc3327607429b55a07f5792cf614d1ad89e215bfd4509fb8c4adfe4a56187495183f2f2a0a8
7
+ data.tar.gz: c266fc7c5efdbf9a3de77cd180e60ff824acd31713b4d2287369b5eb2ba691a6250686b117bc33ae70e47341935a661cc94171c6096a2fc4f1b0c2c30993b4d8
data/lib/jara/releaser.rb CHANGED
@@ -18,8 +18,10 @@ module Jara
18
18
  @re_release = options.fetch(:re_release, false)
19
19
  @extra_metadata = options[:metadata] || {}
20
20
  @build_command = options[:build_command]
21
+ @app_name = options[:app_name]
21
22
  @shell = options[:shell] || Shell.new
22
23
  @archiver = create_archiver(options[:archiver])
24
+ @archiver_options = options[:archiver_options] || {}
23
25
  @file_system = options[:file_system] || FileUtils
24
26
  @s3 = options[:s3]
25
27
  @logger = options[:logger] || IoLogger.new($stderr)
@@ -30,7 +32,7 @@ module Jara
30
32
  if @environment.nil?
31
33
  archive_name = "#{app_name}.#{@archiver.extension}"
32
34
  Dir.chdir(project_dir) do
33
- @archiver.create(archive_name: archive_name)
35
+ @archiver.create(@archiver_options.merge(archive_name: archive_name))
34
36
  end
35
37
  @logger.info('Created test artifact')
36
38
  File.join(project_dir, 'build', archive_name)
@@ -54,7 +56,7 @@ module Jara
54
56
  @shell.exec(@build_command)
55
57
  end
56
58
  end
57
- @archiver.create(archive_name: archive_name)
59
+ @archiver.create(@archiver_options.merge(archive_name: archive_name))
58
60
  @file_system.mkdir_p(destination_dir)
59
61
  @file_system.cp("build/#{archive_name}", destination_dir)
60
62
  @logger.info('Created artifact %s' % archive_name)
@@ -84,7 +86,7 @@ module Jara
84
86
  end
85
87
 
86
88
  def app_name
87
- File.basename(project_dir)
89
+ @app_name || File.basename(project_dir)
88
90
  end
89
91
 
90
92
  def project_dir
@@ -131,7 +133,7 @@ module Jara
131
133
 
132
134
  def find_local_artifact
133
135
  candidates = Dir[File.join(project_dir, 'build', @environment, "*.#{@archiver.extension}")]
134
- candidates.select! { |path| path.include?(branch_sha[0, 8]) }
136
+ candidates.select! { |path| path.match(/#{app_name}-\w+-\d{14}-#{branch_sha[0, 8]}/) }
135
137
  candidates.sort.last
136
138
  end
137
139
 
@@ -171,7 +173,11 @@ module Jara
171
173
  create_archiver(:tgz)
172
174
  end
173
175
  else
174
- archiver
176
+ if archiver.respond_to?(:new)
177
+ archiver.new(@shell)
178
+ else
179
+ archiver
180
+ end
175
181
  end
176
182
  end
177
183
 
data/lib/jara/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Jara
4
- VERSION = '2.0.1'.freeze
4
+ VERSION = '2.1.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burt Platform Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement