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
- QA_CONTAINER_WORKDIR =
'/home/gitlab/qa'.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
16 17 18 19 20 21 22 23 |
# File 'lib/gitlab/qa/docker/volumes.rb', line 16 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 |