zillabyte-cli 0.1.29 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zillabyte/cli/flows.rb +30 -1
- data/lib/zillabyte-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: e9e56f44ff01e3417f093c4c67b5da5bb015ecaf
|
4
|
+
data.tar.gz: e93688302a3f84c692fca0e25cf5f99407415267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a74eb133a070285150df3f401215d1ac52b6bdfe0cf6925efebe6cd08eee769ee35069c0aa1eb56e89da7f2e20bbe172072e2a44c94c9c635aecb118edd782a
|
7
|
+
data.tar.gz: 4e0fc742cb3396d2f3ac9164898055247cb4e7c7a698782dafa9396545bd0b3a74d7a4be3a523d6d3e293404a7df3d329397382cb6b5f44cc4ddb036af8799a9
|
data/lib/zillabyte/cli/flows.rb
CHANGED
@@ -58,7 +58,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
|
|
58
58
|
# flows:push [DIR]
|
59
59
|
#
|
60
60
|
# Uploads a flow.
|
61
|
-
#
|
61
|
+
# --force # Don't ask for confirmation
|
62
62
|
# --config CONFIG_FILE # Use the given config file
|
63
63
|
# --directory DIR # Flow directory
|
64
64
|
# --output_type OUTPUT_TYPE # Specify an output type i.e. json #HIDDEN
|
@@ -73,6 +73,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
|
|
73
73
|
end
|
74
74
|
options[:directory] = dir
|
75
75
|
type = options[:output_type]
|
76
|
+
forced = options[:force]
|
76
77
|
|
77
78
|
# Get the meta info
|
78
79
|
require('zillabyte/api/flows')
|
@@ -87,6 +88,34 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
|
|
87
88
|
end
|
88
89
|
|
89
90
|
flow_type = hash["flow_type"]
|
91
|
+
flow_name = hash["name"]
|
92
|
+
|
93
|
+
# Before killing live flow (with same name), ask for confirmation before push unless force flag is on
|
94
|
+
if !forced
|
95
|
+
if flow_type == "app"
|
96
|
+
flows = api.app.list
|
97
|
+
else
|
98
|
+
flows = api.component.list
|
99
|
+
end
|
100
|
+
flows.each do |flow|
|
101
|
+
if flow_name == flow["name"]
|
102
|
+
if flow["state"] == "RUNNING"
|
103
|
+
display "An app/component with this name is already running. If you continue to push, the running app/component with this name will be terminated. Would you like to continue to push?[y/N]", false
|
104
|
+
|
105
|
+
input = ask
|
106
|
+
|
107
|
+
if !(input.downcase == "y" || input.downcase == "yes")
|
108
|
+
return
|
109
|
+
|
110
|
+
end
|
111
|
+
end
|
112
|
+
break
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
|
90
119
|
|
91
120
|
res = api.flows.push_directory dir, hash, session, options
|
92
121
|
|