conjur-debify 0.4.0 → 0.4.1

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: 5bba7f110cbbeb17cad3b1a7aaa9723bbbfaa508
4
- data.tar.gz: 29cb740a691ceefa03960e68208b01c37439448d
3
+ metadata.gz: 24d8fe10e0486db7bb2507eb4437011c7b604553
4
+ data.tar.gz: 74d13c5b2998e96664c704b1f3e25e4d913c776d
5
5
  SHA512:
6
- metadata.gz: a96de1aad2fe69616b94854ef6ae8f870a8065a706ef582bd02427b44ea49f84f3d34bdbb8565f1a7c1b620160e530ccec8e61933b1e43976ffdf27786bc4db8
7
- data.tar.gz: 0509aeec7d1fef0005a3ca69e44ba4ce7f5f7f210c6e761cf56481a0ddb96ae9d61e1298a100c91d58a28e8fd6ccf08754f0edabfa6036d8901392cd15bded28
6
+ metadata.gz: 8cc53a5458f5dc85665a6a58b5fe15b0b373834645504fe2e9bc1a80caafddbbd8987f0939e45e111e14565bd00d9839307e7716d9f53c5cb3db30a4ce0d363b
7
+ data.tar.gz: 4d651e1ba3026f937ce23474e4710df624415416860cc814d4e272447fd3e33b063abf8cc998995e4c1cf22623d7cca3fbe6c5eeb898e991e08c563836dc0fcb
@@ -1,5 +1,5 @@
1
1
  module Conjur
2
2
  module Debify
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
data/lib/conjur/debify.rb CHANGED
@@ -122,19 +122,9 @@ command "package" do |c|
122
122
 
123
123
  DebugMixin.debug_write "Built fpm image '#{image.id}' for project #{project_name}\n"
124
124
 
125
- # Make it under HOME so that Docker can map the volume on MacOS
126
- tempdir = File.expand_path((0...50).map { ('a'..'z').to_a[rand(26)] }.join, ENV['HOME'])
127
- FileUtils.mkdir tempdir
128
- at_exit do
129
- FileUtils.rm_rf tempdir
130
- end
131
-
132
125
  options = {
133
126
  'Cmd' => [ project_name, version ] + fpm_args,
134
- 'Image' => image.id,
135
- 'Binds' => [
136
- [ tempdir, '/dist' ].join(':')
137
- ]
127
+ 'Image' => image.id
138
128
  }
139
129
 
140
130
  container = Docker::Container.create options
@@ -144,15 +134,16 @@ command "package" do |c|
144
134
  status = container.wait
145
135
  raise "Failed to package #{project_name}" unless status['StatusCode'] == 0
146
136
 
147
- deb_file = nil
148
- Dir.chdir(tempdir) do
149
- deb_file = Dir["*.deb"]
150
- raise "Expected one deb file, got #{deb_file.join(', ')}" unless deb_file.length == 1
151
- deb_file = deb_file[0]
152
- FileUtils.cp deb_file, dir
137
+ require 'rubygems/package'
138
+ deb = StringIO.new
139
+ container.copy("/src/#{package_name}") { |chunk| deb.write(chunk) }
140
+ deb.rewind
141
+ tar = Gem::Package::TarReader.new deb
142
+ tar.first.tap do |entry|
143
+ open(entry.full_name, 'wb') {|f| f.write(entry.read)}
144
+ FileUtils.ln_sf entry.full_name, entry.full_name.gsub(version, "latest")
145
+ puts entry.full_name
153
146
  end
154
- FileUtils.ln_sf deb_file, deb_file.gsub(version, "latest")
155
- puts File.basename(deb_file)
156
147
  ensure
157
148
  container.delete(force: true)
158
149
  end
@@ -46,5 +46,3 @@ fpm -s dir -t deb -n conjur-$project_name -v $version -C . \
46
46
  "$@"
47
47
 
48
48
  ls -al *.deb
49
-
50
- cp *.deb /dist/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-debify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin