smqacloud 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smqacloud.rb +20 -8
- 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: 863f963a39be4083e8e11e91eb29e9268127c126
|
4
|
+
data.tar.gz: 1e753e9b9905039ee85c802687e4e9d34767a834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fbec3da936a9fb67da332fcbb3a11f21977534632c3f5954da43c92b642c26792658958cf8024dc4b9140ae01354ecd2251f7871bd1175e16e1284a8be070c1
|
7
|
+
data.tar.gz: d72fac33538270f74c477bc8f70b8bed648d4e083f1c9dc08ef646e7ec226e406a56cfb000da51d6f38b8e35c352664bfcf6db1b39e25179d1eb483bf27aecff
|
data/lib/smqacloud.rb
CHANGED
@@ -10,6 +10,7 @@ require 'smapisatqacloud'
|
|
10
10
|
# playlistID = ARGV[0]
|
11
11
|
# = "your token id"
|
12
12
|
# $add_variable = Hash.new
|
13
|
+
$fullTaskName = nil
|
13
14
|
|
14
15
|
def self.req_all_scripts(path)
|
15
16
|
Dir.log("#{path}/**/*.rb") do |req_all|
|
@@ -17,6 +18,13 @@ def self.req_all_scripts(path)
|
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
21
|
+
def self.get_file_full_path(taskname)
|
22
|
+
Dir.log("#{path}/**/*.rb") do |rb_file|
|
23
|
+
filename = File.basename(rb_file,File.extname(rb_file))
|
24
|
+
if filename == taskname then
|
25
|
+
$fullTaskName = rb_file
|
26
|
+
end
|
27
|
+
end
|
20
28
|
|
21
29
|
def self.playlist(playlistID)
|
22
30
|
$add_variable = Hash.new
|
@@ -36,9 +44,9 @@ $add_variable = Hash.new
|
|
36
44
|
task_id = taskhash["body"]["task_id"]
|
37
45
|
$var = taskhash["body"]["task_variables"]
|
38
46
|
$env = taskhash["body"]["environment"]
|
39
|
-
puts "
|
47
|
+
puts "\e[1mWorkflow:\e[0m #{$workflow_name}"
|
40
48
|
$workflow_status = taskhash["body"]["test"]
|
41
|
-
puts "
|
49
|
+
puts "\e[1mNow Starting Task:\e[0m #{$task_name}"
|
42
50
|
|
43
51
|
begin
|
44
52
|
|
@@ -52,12 +60,14 @@ $add_variable = Hash.new
|
|
52
60
|
req_all_scripts(path)
|
53
61
|
dur1 = Time.now
|
54
62
|
taskName = $task_name
|
55
|
-
|
63
|
+
get_file_full_path(taskName)
|
64
|
+
task_to_load = $fullTaskName
|
65
|
+
load "#{task_to_load}"
|
56
66
|
# send($task_name)
|
57
67
|
|
58
68
|
rescue Exception => e
|
59
69
|
|
60
|
-
puts "
|
70
|
+
puts "\e[31Exception occured, Checkpoint should have more info.\e[0m"
|
61
71
|
@erro_line = e.backtrace[0].split(":")
|
62
72
|
@error_line = @erro_line[1]
|
63
73
|
@error_message = "#{$!}"
|
@@ -101,8 +111,8 @@ $add_variable = Hash.new
|
|
101
111
|
# else
|
102
112
|
# $get_variable.merge!($add_variable)
|
103
113
|
# end
|
104
|
-
puts "
|
105
|
-
puts "
|
114
|
+
puts "\e[1mWorkflow:\e[0m #{$workflow_name}"
|
115
|
+
puts "\e[1mNow Starting Task:\e[0m #{$task_name}"
|
106
116
|
begin
|
107
117
|
if $var.has_key?("path") == true then
|
108
118
|
if $var["path"].empty? == false then
|
@@ -114,11 +124,13 @@ $add_variable = Hash.new
|
|
114
124
|
req_all_scripts(path)
|
115
125
|
dur1 = Time.now
|
116
126
|
taskName = $task_name
|
117
|
-
|
127
|
+
get_file_full_path(taskName)
|
128
|
+
task_to_load = $fullTaskName
|
129
|
+
load "#{task_to_load}"
|
118
130
|
# send($task_name)
|
119
131
|
|
120
132
|
rescue Exception => e
|
121
|
-
puts "
|
133
|
+
puts "\e[31Exception occured, Checkpoint should have more info.\e[0m"
|
122
134
|
@erro_line = e.backtrace[0].split(":")
|
123
135
|
@error_line = @erro_line[1]
|
124
136
|
@error_message = "#{$!}"
|