smqacloud 0.0.6 → 0.0.7
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 +38 -49
- 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: ec7e98aa45de0626e486e79d59f90cbf83c8c22a
|
4
|
+
data.tar.gz: 548f14a9f4c4b2cfd419be4060c93c1e54e647b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dad6cf6415d5976ff672b45022ef56a6d70d1ca4c44cdebcebd365ddb19d8317c7fcf249304be6e03a4455944316c2ab46986a16e7f6419e2de2c8e3047e3267
|
7
|
+
data.tar.gz: dd72802e7d65dbdd7d21844f56f728675b800b7c9015fcc06c3cf599824425b7e73db35987791068efdca84f23c7d1093aa5539f9261567792a83ec7b4a55f28
|
data/lib/smqacloud.rb
CHANGED
@@ -1,31 +1,28 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rubygems'
|
3
3
|
require 'httparty'
|
4
|
-
require 'qacloud'
|
5
4
|
require 'smapisatqacloud'
|
6
|
-
|
5
|
+
require 'watir-webdriver'
|
7
6
|
|
8
|
-
# get playlistID or playlistID CI id from args::
|
9
7
|
|
10
|
-
# playlistID = ARGV[0]
|
11
|
-
# = "your token id"
|
12
|
-
# $add_variable = Hash.new
|
13
8
|
$fullTaskName = nil
|
9
|
+
@found = false
|
14
10
|
|
15
|
-
def self.req_all_scripts(path)
|
16
|
-
Dir.log("#{path}/**/*.rb") do |req_all|
|
17
|
-
require_relative req_all
|
18
|
-
end
|
19
|
-
end
|
20
11
|
|
21
|
-
def self.get_file_full_path(taskname)
|
22
|
-
Dir.
|
12
|
+
def self.get_file_full_path(path,taskname)
|
13
|
+
Dir.glob("#{path}/**/*.rb") do |rb_file|
|
23
14
|
filename = File.basename(rb_file,File.extname(rb_file))
|
24
15
|
if filename == taskname then
|
25
16
|
$fullTaskName = rb_file
|
26
|
-
|
27
|
-
|
28
|
-
|
17
|
+
@found = true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
if @found == false then
|
21
|
+
puts "\e[31m Script file for #{taskname} not found under path given in environment. \e[0m"
|
22
|
+
exit
|
23
|
+
else
|
24
|
+
@found = false
|
25
|
+
end
|
29
26
|
end
|
30
27
|
|
31
28
|
def self.playlist(playlistID)
|
@@ -46,30 +43,23 @@ $add_variable = Hash.new
|
|
46
43
|
task_id = taskhash["body"]["task_id"]
|
47
44
|
$var = taskhash["body"]["task_variables"]
|
48
45
|
$env = taskhash["body"]["environment"]
|
49
|
-
puts "\e[1mWorkflow:\e[0m #{$workflow_name}"
|
46
|
+
puts "\e[1mWorkflow:\e[0m \e[32m#{$workflow_name}\e[0m"
|
50
47
|
$workflow_status = taskhash["body"]["test"]
|
51
|
-
puts "\e[1mNow Starting Task:\e[0m #{$task_name}"
|
48
|
+
puts "\e[1mNow Starting Task:\e[0m \e[32m#{$task_name}\e[0m"
|
52
49
|
|
53
50
|
begin
|
54
51
|
|
55
|
-
if $var.has_key?("path") == true then
|
56
|
-
if $var["path"].empty? == false then
|
57
|
-
path = $var["path"]
|
58
|
-
end
|
59
|
-
else
|
60
|
-
path = $env["path"]
|
61
|
-
end
|
62
|
-
req_all_scripts(path)
|
63
52
|
dur1 = Time.now
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
53
|
+
get_file_full_path($env["path"],$task_name)
|
54
|
+
begin
|
55
|
+
load "#{$fullTaskName}"
|
56
|
+
rescue => e
|
57
|
+
puts e
|
58
|
+
end
|
69
59
|
|
70
60
|
rescue Exception => e
|
71
61
|
|
72
|
-
puts "\e[
|
62
|
+
puts "\e[31mException occured, Checkpoint should have more info.\e[0m"
|
73
63
|
@erro_line = e.backtrace[0].split(":")
|
74
64
|
@error_line = @erro_line[1]
|
75
65
|
@error_message = "#{$!}"
|
@@ -113,26 +103,25 @@ $add_variable = Hash.new
|
|
113
103
|
# else
|
114
104
|
# $get_variable.merge!($add_variable)
|
115
105
|
# end
|
116
|
-
puts "\e[1mWorkflow:\e[0m #{$workflow_name}"
|
117
|
-
|
106
|
+
puts "\e[1mWorkflow:\e[0m \e[32m#{$workflow_name}\e[0m"
|
107
|
+
# $workflow_status = taskhash["body"]["test"]
|
108
|
+
puts "\e[1mNow Starting Task:\e[0m \e[32m#{$task_name}\e[0m"
|
118
109
|
begin
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
load "#{task_to_load}"
|
132
|
-
# send($task_name)
|
110
|
+
|
111
|
+
dur1 = Time.now
|
112
|
+
begin
|
113
|
+
get_file_full_path($env["path"],$task_name)
|
114
|
+
rescue => e
|
115
|
+
puts e
|
116
|
+
end
|
117
|
+
begin
|
118
|
+
load "#{$fullTaskName}"
|
119
|
+
rescue => e
|
120
|
+
puts e
|
121
|
+
end
|
133
122
|
|
134
123
|
rescue Exception => e
|
135
|
-
puts "\e[
|
124
|
+
puts "\e[31mException occured, Checkpoint should have more info.\e[0m"
|
136
125
|
@erro_line = e.backtrace[0].split(":")
|
137
126
|
@error_line = @erro_line[1]
|
138
127
|
@error_message = "#{$!}"
|