hudson-to-pisswhistle 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/hudson_to_pisswhistle.rb +8 -1
  2. metadata +3 -3
@@ -17,6 +17,7 @@ class HudsonToPissWhistle
17
17
  raise "#{setting} was not set" unless ENV[setting]
18
18
  end
19
19
 
20
+ project_name = ENV["WORKSPACE"].split("/")[-2]
20
21
  build_directory = File.expand_path(File.join(ENV["WORKSPACE"], "..", "builds", ENV["BUILD_ID"]))
21
22
  build_log = File.join(build_directory, "build.xml")
22
23
 
@@ -33,7 +34,13 @@ class HudsonToPissWhistle
33
34
 
34
35
  data = change_dots_to_hyphens_in_keys(data)
35
36
 
36
- data["message"] = File.read(File.join(build_directory, "changelog.xml")).strip
37
+ data["changelog"] = File.read(File.join(build_directory, "changelog.xml")).strip
38
+ revision = data["changelog"].split(" ").last
39
+ data["message"] = if data["build"]["result"] == "SUCCESS"
40
+ "#{project_name} (#{revision}) built successfully"
41
+ else
42
+ "#{project_name} (#{revision}) failed!"
43
+ end
37
44
 
38
45
  # legacy CI message compatibility
39
46
  data["result"] = data["build"]["result"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hudson-to-pisswhistle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Adam