dapp 0.12.6 → 0.12.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d1e9d464c7b24a1359245aed3b9b49d4eb606fd
4
- data.tar.gz: 203871c1836df77f375baf8322edfff1306cb5f7
3
+ metadata.gz: 0ae33ea300290cdf11a46bab9e8432d2c71f3433
4
+ data.tar.gz: 32c5e1589de895853f62dfbd9d62bd811264662f
5
5
  SHA512:
6
- metadata.gz: 4b29e0ed69188e7172a0c540166aa29e2303f25150e7bb6a86df4dbe2deeeaaa86dc01e45699dee163fbcb4f7b0b3f0228526dc0954d7c70e112d177045e1742
7
- data.tar.gz: 44ae5e00c9c1f6c5256010723e383546235a6778ece650177d0e3c6d8649bb15ebb7764ef92075fce71fa9c6c552cfd17358be2fe9fec4a85c62ba65bbf22aa8
6
+ metadata.gz: 0096daae7f8e449896e3d498f93c89cb694df5ccd6c3693d39744bfb5f3bbfa962fac02177999101066ffa37eccb6887ee2737968e3b7e8caa3eb788d04d521d
7
+ data.tar.gz: 1977267b13a8c8035877c3c204491f0ec8f5841cbc360c321b44baebac0dc5212e4709532dc5d03b67c05e9d28fd974893cdf3775127c00676c58ac46a9a3bbd
@@ -17,7 +17,7 @@ module Dapp
17
17
  group = artifact[:options][:group]
18
18
  to = artifact[:options][:to]
19
19
 
20
- command = safe_cp(cwd, artifact_dimg.container_tmp_path(artifact_name).to_s, Process.uid, Process.gid, include_paths, exclude_paths)
20
+ command = safe_cp(cwd, artifact_dimg.container_tmp_path(artifact_name).to_s, nil, nil, include_paths, exclude_paths)
21
21
  run_artifact_dimg(artifact_dimg, artifact_name, command)
22
22
 
23
23
  command = safe_cp(dimg.container_tmp_path('artifact', artifact_name).to_s, to, owner, group, include_paths, exclude_paths)
@@ -163,7 +163,18 @@ module Dapp
163
163
  end
164
164
 
165
165
  def cleanup_tmp
166
- FileUtils.rm_rf(tmp_path)
166
+ # В tmp-директории могли остаться файлы, владельцами которых мы не являемся.
167
+ # Такие файлы могут попасть туда при экспорте файлов артефакта.
168
+ # Чтобы от них избавиться — запускаем docker-контейнер под root-пользователем
169
+ # и удаляем примонтированную tmp-директорию.
170
+ cmd = "".tap do |cmd|
171
+ cmd << "docker run --rm"
172
+ cmd << " --volume #{tmp_base_dir}:#{tmp_base_dir}"
173
+ cmd << " ubuntu:16.04"
174
+ cmd << " rm -rf #{tmp_path}"
175
+ end
176
+ dapp.shellout! cmd
177
+
167
178
  artifacts.each(&:cleanup_tmp)
168
179
  end
169
180
 
@@ -6,8 +6,12 @@ module Dapp
6
6
  make_path(dapp.path, *path).expand_path
7
7
  end
8
8
 
9
+ def tmp_base_dir
10
+ File.expand_path(dapp.options[:tmp_dir_prefix] || '/tmp')
11
+ end
12
+
9
13
  def tmp_path(*path)
10
- @tmp_path ||= Dir.mktmpdir('dapp-', dapp.options[:tmp_dir_prefix] || '/tmp')
14
+ @tmp_path ||= Dir.mktmpdir('dapp-', tmp_base_dir)
11
15
  make_path(@tmp_path, *path).expand_path.tap { |p| p.parent.mkpath }
12
16
  end
13
17
 
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = '0.12.6'.freeze
3
- BUILD_CACHE_VERSION = 12
2
+ VERSION = '0.12.7'.freeze
3
+ BUILD_CACHE_VERSION = 13
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.6
4
+ version: 0.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-26 00:00:00.000000000 Z
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout