ci-go-nfo 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG +5 -0
- data/README +1 -1
- data/bin/ci-go-nfo +3 -3
- data/lib/ci-go-nfo.rb +20 -26
- data/lib/ci-go-nfo/version.rb +1 -1
- metadata +2 -2
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Ci-Go-Nfo CHANGLEOG
|
2
2
|
++++++++++++++++++++++++++++++++++++++++++++++++++
|
3
3
|
|
4
|
+
v0.0.2 => v0.0.3
|
5
|
+
6) fixing nil argument case, some code cleanup
|
6
|
+
|
7
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
8
|
+
|
4
9
|
v0.0.1 => v0.0.2
|
5
10
|
5) get summary of total/passed/failed Go CI pipelines and the names of failed
|
6
11
|
|
data/README
CHANGED
data/bin/ci-go-nfo
CHANGED
@@ -3,7 +3,9 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
|
3
3
|
|
4
4
|
require 'ci-go-nfo'
|
5
5
|
|
6
|
-
if ARGV.size ===
|
6
|
+
if ARGV.size === 0
|
7
|
+
Ci::Go::Nfo.builds
|
8
|
+
elsif ARGV.size === 1
|
7
9
|
case ARGV[0]
|
8
10
|
when 'help', '-h', '--help', '?'
|
9
11
|
puts <<-HELP
|
@@ -30,8 +32,6 @@ if ARGV.size === 1
|
|
30
32
|
Ci::Go::Nfo.builds 'fail'
|
31
33
|
when 'summary'
|
32
34
|
Ci::Go::Nfo.summary
|
33
|
-
else
|
34
|
-
Ci::Go::Nfo.builds nil, ARGV[0]
|
35
35
|
end
|
36
36
|
|
37
37
|
elsif ARGV.size === 2
|
data/lib/ci-go-nfo.rb
CHANGED
@@ -14,12 +14,11 @@ module Ci
|
|
14
14
|
go_all = Ci::Go::Cctray.data_from_xml
|
15
15
|
failed_builds, passed_builds = [], []
|
16
16
|
go_all['names'].each_with_index do |name, idx|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
17
|
+
next unless name.split('::').size == 3
|
18
|
+
if go_all['lastBuildStatus'][idx] === 'Failure'
|
19
|
+
failed_builds << name.split('::')[0]
|
20
|
+
elsif go_all['lastBuildStatus'][idx] === 'Success'
|
21
|
+
passed_builds << name.split('::')[0]
|
23
22
|
end
|
24
23
|
end
|
25
24
|
Ci::Go::Print.summary passed_builds.uniq, failed_builds.uniq
|
@@ -29,19 +28,11 @@ module Ci
|
|
29
28
|
go = Ci::Go::Cctray.data_from_xml
|
30
29
|
go['names'].each_with_index do |name, idx|
|
31
30
|
next if name.split('::').size < 3
|
32
|
-
build =
|
33
|
-
'name' => name,
|
34
|
-
'last_status' => go['lastBuildStatus'][idx],
|
35
|
-
'last_label' => go['lastBuildLabels'][idx],
|
36
|
-
'last_time' => go['lastBuildTimes'][idx],
|
37
|
-
'weburl' => go['weburls'][idx]
|
38
|
-
}
|
31
|
+
build = build_nfo(go, idx)
|
39
32
|
|
40
|
-
if status.nil?
|
41
|
-
|
42
|
-
|
43
|
-
Ci::Go::Print.build_status build
|
44
|
-
elsif status === 'pass' && build['last_status'] === 'Success'
|
33
|
+
if status.nil? or
|
34
|
+
build['last_status'].match(/#{status}/i) or
|
35
|
+
( status === 'pass' && build['last_status'] === 'Success' )
|
45
36
|
Ci::Go::Print.build_status build
|
46
37
|
end
|
47
38
|
end
|
@@ -51,15 +42,18 @@ module Ci
|
|
51
42
|
go = Ci::Go::Cctray.data_from_xml
|
52
43
|
build_name = go['names'].select{|gname| gname.split(/::/)[0] === pipeline}
|
53
44
|
idx = go.index build_name
|
54
|
-
build = {
|
55
|
-
'name' => go['names'][idx],
|
56
|
-
'last_status' => go['lastBuildStatus'][idx],
|
57
|
-
'last_label' => go['lastBuildLabels'][idx],
|
58
|
-
'last_time' => go['lastBuildTimes'][idx],
|
59
|
-
'weburl' => go['weburls'][idx]
|
60
|
-
}
|
61
45
|
|
62
|
-
Ci::Go::Print.build_status
|
46
|
+
Ci::Go::Print.build_status build_nfo(go, idx)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.build_nfo(goXML, index)
|
50
|
+
{
|
51
|
+
'name' => goXML['names'][index],
|
52
|
+
'last_status' => goXML['lastBuildStatus'][index],
|
53
|
+
'last_label' => goXML['lastBuildLabels'][index],
|
54
|
+
'last_time' => goXML['lastBuildTimes'][index],
|
55
|
+
'weburl' => goXML['weburls'][index]
|
56
|
+
}
|
63
57
|
end
|
64
58
|
|
65
59
|
end
|
data/lib/ci-go-nfo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci-go-nfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xml-motor
|