assemblyline-cli 0.0.7 → 0.0.8
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 +4 -4
- data/lib/assemblyline/cli.rb +9 -4
- data/lib/assemblyline/cli/version.rb +1 -1
- 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: edd099b797138ae441122b355e03c4b1f1469d1c
|
|
4
|
+
data.tar.gz: 0090fba2a2f7a4d5ba762b8eae3a1e3168caff77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1c778e8371bb90bf7a1799c724ce1370325e7251ffd92f531e0ba7d1e9decc55a1943b925820849982ec57785cd534168b704e86147e0d1bfb80a78b7a2fa6e
|
|
7
|
+
data.tar.gz: d7e30c6d05ac6ba2d00cfc7171e060fb76b2ccc2fa52faabe5e31007431b9dd47ca1173d929ae0fbf3b546a05d9e5070367fe665c0c77b54bbff662b41aa50fd
|
data/lib/assemblyline/cli.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Assemblyline
|
|
|
10
10
|
option :dev, type: :string, desc: 'use a local dev checkout of assemblyline-builder', banner: 'PATH'
|
|
11
11
|
def build(url_or_path)
|
|
12
12
|
init_local_mount url_or_path
|
|
13
|
-
exec "docker run --rm #{bind_mounts} #{env_flags} #{debug_flags} #{local_mount} #{assemblyline_builder} bin/build #{build_command(url_or_path)}" # rubocop:disable Metrics/LineLength
|
|
13
|
+
exec "docker run --rm #{bind_mounts} #{env_flags} #{debug_flags} #{dev_mount} #{local_mount} #{assemblyline_builder} bin/build #{build_command(url_or_path)}" # rubocop:disable Metrics/LineLength
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
desc 'update', 'update assemblyline'
|
|
@@ -48,18 +48,23 @@ module Assemblyline
|
|
|
48
48
|
|
|
49
49
|
def init_local_mount(path)
|
|
50
50
|
return unless dir?(path)
|
|
51
|
-
@local_mount = "-v #{File.expand_path(Dir.pwd
|
|
51
|
+
@local_mount = "-v #{File.expand_path(path, Dir.pwd)}:/usr/assemblyline/local"
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def dir?(path)
|
|
55
|
-
File.directory?(File.expand_path(Dir.pwd
|
|
55
|
+
File.directory?(File.expand_path(path, Dir.pwd))
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def debug_flags
|
|
59
|
-
return unless options[:debug]
|
|
59
|
+
return unless options[:debug] || options[:dev]
|
|
60
60
|
'-ti'
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
def dev_mount
|
|
64
|
+
return unless options[:dev]
|
|
65
|
+
"-v #{File.expand_path(options[:dev], Dir.pwd)}:/usr/src"
|
|
66
|
+
end
|
|
67
|
+
|
|
63
68
|
def env_flags
|
|
64
69
|
env.map { |var, val| "-e #{var}=#{val}" }.join(' ')
|
|
65
70
|
end
|