Class: Gitlab::QA::Docker::Volumes
- Inherits:
-
Object
- Object
- Gitlab::QA::Docker::Volumes
- Defined in:
- lib/gitlab/qa/docker/volumes.rb
Constant Summary collapse
- VOLUMES =
{ 'config' => '/etc/gitlab', 'data' => '/var/opt/gitlab' }.freeze
Instance Method Summary collapse
-
#initialize(volumes = VOLUMES) ⇒ Volumes
constructor
A new instance of Volumes.
- #with_temporary_volumes ⇒ Object
Constructor Details
Instance Method Details
#with_temporary_volumes ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/gitlab/qa/docker/volumes.rb', line 14 def with_temporary_volumes # macOS's tmpdir is a symlink /var/folders -> /private/var/folders # but Docker on macOS exposes /private and disallow exposing /var/ # so we need to get the real tmpdir path Dir.mktmpdir('gitlab-qa-', File.realpath(Dir.tmpdir)).tap do |dir| yield Hash[@volumes.map { |k, v| ["#{dir}/#{k}", v] }] end end |