cide 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/cide.gemspec +1 -1
- data/lib/cide/cli.rb +17 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ade361f4711d1dbb93055c6a1877cdd72b14de85
|
4
|
+
data.tar.gz: e4cad913efd19e87397c4ba10ee82a4ca25be701
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47d3acc50632780d3cd87dc1bdff7ee08b2388d0e4fa2df63239df2e18965f3e8f33072a2b3a79a5fef7f2fa62bcd332c1b3ec30d60eb4d90209a78463c9c084
|
7
|
+
data.tar.gz: 4b702e34ac5ecb06f1437332418ec942cf99c4b85af972834c45dbf975aa9799d6496ea98abca24d744942e4e5aa06b18b21f779cc649d3cb28150b6d2bf3369
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/cide.gemspec
CHANGED
data/lib/cide/cli.rb
CHANGED
@@ -33,9 +33,14 @@ module CIDE
|
|
33
33
|
aliases: %w(-o --host_export_dir),
|
34
34
|
default: nil
|
35
35
|
|
36
|
+
method_option 'guest_export_dir',
|
37
|
+
desc: 'Change the ouput directory on the host',
|
38
|
+
aliases: %w(-i),
|
39
|
+
default: nil
|
40
|
+
|
36
41
|
method_option 'run',
|
37
42
|
desc: 'Override the script to run',
|
38
|
-
type: :
|
43
|
+
type: :string,
|
39
44
|
aliases: ['-r'],
|
40
45
|
default: []
|
41
46
|
|
@@ -58,10 +63,8 @@ module CIDE
|
|
58
63
|
banner 'Config'
|
59
64
|
build = Build::Config.load(Dir.pwd)
|
60
65
|
exit 1 if build.nil?
|
61
|
-
export_dir = options.export_dir
|
62
|
-
export_dir ||= File.dirname(build.export_dir) if build.export_dir
|
63
66
|
ssh_key = File.expand_path(options.ssh_key)
|
64
|
-
build.run = options.run unless options.run.empty?
|
67
|
+
build.run = ['sh', '-e', '-c', options.run] unless options.run.empty?
|
65
68
|
name = CIDE::Docker.id options.name
|
66
69
|
tag = "cide/#{name}"
|
67
70
|
say_status :config, build.inspect
|
@@ -120,10 +123,17 @@ module CIDE
|
|
120
123
|
## Export ##
|
121
124
|
return unless options.export
|
122
125
|
banner 'Export'
|
123
|
-
fail 'export flag set but no export_dir given' if build.export_dir.nil?
|
124
126
|
|
125
|
-
|
126
|
-
|
127
|
+
source_export_dir = options.guest_export_dir || build.export_dir
|
128
|
+
fail 'export flag set but no export_dir given' if source_export_dir.nil?
|
129
|
+
|
130
|
+
target_export_dir = options.export_dir || source_export_dir
|
131
|
+
|
132
|
+
target_export_dir = File.dirname(target_export_dir)
|
133
|
+
|
134
|
+
guest_export_dir = File.expand_path(source_export_dir, CIDE_SRC_DIR)
|
135
|
+
host_export_dir = File.expand_path(target_export_dir, Dir.pwd)
|
136
|
+
|
127
137
|
docker :cp, [id, guest_export_dir].join(':'), host_export_dir
|
128
138
|
rescue Docker::Error => ex
|
129
139
|
say_status :status, 'ERROR', :red
|