dapp 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dapp +9 -1
- data/config/en/net_status.yml +0 -1
- data/lib/dapp/builder/chef/berksfile.rb +1 -1
- data/lib/dapp/project/shellout/base.rb +1 -1
- data/lib/dapp/project/shellout/system.rb +17 -6
- data/lib/dapp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a647be59d32b6991038c53294f960aaf15030cb
|
4
|
+
data.tar.gz: 2eb63c5bd2b5e6a216a9d126265b5ce73787abc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3c7db9cf1cb215c5b6971b2be5be767296d83c744c9b93bf749ec39c32b6035d13d460562f1fcd8ece95a6d23af3568080d8c81879450b8c21a966b530b48a6
|
7
|
+
data.tar.gz: 56e0c351bb05e9dce18598755a53f96f2f82784290fced28e0735d0e15da94a8bf943e1d04dcf16cfba555f2bedb4f728fb95246310c87f61a9a2194d10b49c6
|
data/bin/dapp
CHANGED
@@ -6,7 +6,15 @@ require 'rubygems'
|
|
6
6
|
require 'dapp'
|
7
7
|
|
8
8
|
begin
|
9
|
-
|
9
|
+
begin
|
10
|
+
Dapp::CLI.new.run
|
11
|
+
rescue ::Exception => e
|
12
|
+
::File.open('/tmp/dapp-stacktrace.out', 'a') do |dapp_stacktrace|
|
13
|
+
dapp_stacktrace.write [*e.backtrace, "\n"].join("\n")
|
14
|
+
end
|
15
|
+
$stderr.puts "\033[1m\033[31mStacktrace dumped to /tmp/dapp-stacktrace.out\033[0m"
|
16
|
+
raise
|
17
|
+
end
|
10
18
|
rescue Dapp::Error::Shellout => e
|
11
19
|
$stderr.puts(Dapp::Helper::NetStatus.message(e))
|
12
20
|
exit 1
|
data/config/en/net_status.yml
CHANGED
@@ -3,7 +3,6 @@ en:
|
|
3
3
|
missing_translation: "Missing translation for code: '%{code}'!"
|
4
4
|
shellout:
|
5
5
|
shell_command_failed: ">>> START STREAM\n%{stream}\n>>> END STREAM"
|
6
|
-
system_shell_command_failed: ">>> START STREAM\n%{stream}\n>>> END STREAM%{backtrace}"
|
7
6
|
application:
|
8
7
|
application_not_built: "Application hasn't been built yet!"
|
9
8
|
application_not_run: "Application run failed!"
|
@@ -65,7 +65,7 @@ module Dapp
|
|
65
65
|
|
66
66
|
yield(**kwargs)
|
67
67
|
rescue ::Mixlib::ShellOut::ShellCommandFailed => e
|
68
|
-
raise Error::Shellout, code: class_to_lowercase(e.class), data: { stream: stream.show
|
68
|
+
raise Error::Shellout, code: class_to_lowercase(e.class), data: { stream: stream.show }
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -15,6 +15,8 @@ module Dapp
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def system_shellout_container
|
18
|
+
do_livecheck = false
|
19
|
+
|
18
20
|
@system_shellout_container ||= begin
|
19
21
|
lock(system_shellout_container_name) do
|
20
22
|
if shellout("docker inspect #{system_shellout_container_name}").exitstatus.nonzero?
|
@@ -35,8 +37,13 @@ module Dapp
|
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
40
|
+
do_livecheck = true
|
38
41
|
system_shellout_container_name
|
39
42
|
end
|
43
|
+
|
44
|
+
system_shellout_livecheck! if do_livecheck
|
45
|
+
|
46
|
+
@system_shellout_container
|
40
47
|
end
|
41
48
|
|
42
49
|
def system_shellout(command, raise_error: false, **kwargs)
|
@@ -45,12 +52,6 @@ module Dapp
|
|
45
52
|
else
|
46
53
|
shellout _to_system_shellout_command(command), **kwargs
|
47
54
|
end
|
48
|
-
rescue Error::Shellout => err
|
49
|
-
$stderr.puts "\033[1m\033[31mWARNING: System shellout container failure, " +
|
50
|
-
"try to remove if error persists: " +
|
51
|
-
"docker rm -f #{system_shellout_container_name}\033[0m"
|
52
|
-
|
53
|
-
raise Error::Shellout.new(code: :system_shell_command_failed, **err.net_status)
|
54
55
|
end
|
55
56
|
|
56
57
|
def system_shellout!(command, **kwargs)
|
@@ -59,6 +60,16 @@ module Dapp
|
|
59
60
|
|
60
61
|
private
|
61
62
|
|
63
|
+
def system_shellout_livecheck!
|
64
|
+
# This is stupid container "live check" for now
|
65
|
+
system_shellout! 'true'
|
66
|
+
rescue Error::Shellout
|
67
|
+
$stderr.puts "\033[1m\033[31mSystem shellout container failure, " +
|
68
|
+
"try to remove if error persists: " +
|
69
|
+
"docker rm -f #{system_shellout_container_name}\033[0m"
|
70
|
+
raise
|
71
|
+
end
|
72
|
+
|
62
73
|
def _to_system_shellout_command(command)
|
63
74
|
cmd = shellout_pack ["cd #{Dir.pwd}", command].join(' && ')
|
64
75
|
"docker exec #{system_shellout_container} chroot /.system_shellout_root #{bash_path} -ec '#{[
|
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|