dockdev 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dockdev/context/rubygems.rb +13 -2
- data/lib/dockdev/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae98215aa8c67bca833b8a6d1c6845ba371a9585292b3ae655ebe3e9abc39ed8
|
4
|
+
data.tar.gz: b59ed76855649a092a037e556fd790372d75d17a8212a12f9f855e2462d7bcfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8bba3afd72d45475389856f6e2284a9163c4ee6312ec344cb972091abb95d1598f27f2e8f3221e53ea6d5daa5decdb4deedf274499d03bb9efa08b8305854b5
|
7
|
+
data.tar.gz: 389d29a2e8f6bb00e1f5ca80ae7b6be2b8b42919e7e857912df7f1640ff4c2cdce1250d893c865a5b7e5bdbbeb59071e9538147de83be5474f8b39798b0cef77
|
@@ -21,10 +21,13 @@ module Dockdev
|
|
21
21
|
Dir.glob(File.join(@path,"Gemfile"))
|
22
22
|
end
|
23
23
|
|
24
|
-
def process_mount(mount_hash)
|
24
|
+
def process_mount(mount_hash, dir_inside_docker = "/opt")
|
25
25
|
|
26
26
|
if not mount_hash.nil? and mount_hash.is_a?(Hash)
|
27
27
|
|
28
|
+
script = ["#!/bin/bash"]
|
29
|
+
script << "alias be > /dev/null 2>&1 && echo 'alias be=bundle exec' >> ~/.bashrc"
|
30
|
+
|
28
31
|
#
|
29
32
|
# looking at source code
|
30
33
|
# https://github.com/rubygems/rubygems/blob/master/bundler/lib/bundler/shared_helpers.rb#L246
|
@@ -35,12 +38,20 @@ module Dockdev
|
|
35
38
|
if not d.source.nil?
|
36
39
|
src = d.source
|
37
40
|
if src.path.to_s != "."
|
38
|
-
|
41
|
+
pathInsideDocker = File.join(dir_inside_docker, d.name)
|
42
|
+
mount_hash[src.path.expand_path.to_s] = pathInsideDocker
|
43
|
+
script << "bundle config --global local.#{d.name} #{pathInsideDocker}"
|
39
44
|
#res[d.name] = src.path.expand_path.to_s
|
40
45
|
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
|
49
|
+
scriptOut = File.join(@path,"to_be_executed_inside_docker.sh")
|
50
|
+
File.open(scriptOut,"w") do |f|
|
51
|
+
f.write script.join("\n")
|
52
|
+
end
|
53
|
+
`chmod +x #{scriptOut}`
|
54
|
+
|
44
55
|
end
|
45
56
|
|
46
57
|
mount_hash
|
data/lib/dockdev/version.rb
CHANGED