forked from appelier/bigtuna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for CCMenu (resp. CCTray) by generating a CruiseControl
XmlStatusReport. Code was heavily influenced by https://github.com/thoughtworks/cruisecontrol.rb
- Loading branch information
Gerrit Riessen
committed
Jul 6, 2011
1 parent
091c537
commit 63f3d11
Showing
7 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module ProjectsHelper | ||
def format_time(time, format = :iso) | ||
I18n.l time, :format => format | ||
end | ||
|
||
# Re-map our project statuses to match the project statuses recognized | ||
# by CCTray.Net | ||
def map_to_cctray_build_status(project_status) | ||
case project_status.to_s | ||
when Build::STATUS_OK then 'Success' | ||
when Build::STATUS_FAILED then 'Failure' | ||
else 'Unknown' | ||
end | ||
end | ||
|
||
# Re-map our build activities to match the build activities recognized | ||
# by CCTray.Net | ||
def map_to_cctray_project_activity(builder_state) | ||
case builder_state.to_s | ||
when Build::STATUS_IN_QUEUE then 'CheckingModifications' | ||
when Build::STATUS_PROGRESS then 'Building' | ||
when Build::STATUS_OK then 'Sleeping' | ||
else 'Unknown' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# List of projects and their state in XML - to be consumed by CruiseControl.NET tray. | ||
|
||
xml.Projects do | ||
@projects.each do |project| | ||
last_build = project.last_complete_build | ||
|
||
xml.Project( | ||
:name => project.name, | ||
:category => project.vcs_branch, | ||
:activity => map_to_cctray_project_activity(project.status), | ||
|
||
:lastBuildStatus => (last_build ? map_to_cctray_build_status(last_build.status) : "Unknown"), | ||
:lastBuildLabel => (last_build ? last_build.display_name : 'Unknown'), | ||
:lastBuildTime => (last_build ? format_time(last_build.finished_at, :round_trip_local) : '1970-01-01T00:00:00.000000-00:00'), | ||
:nextBuildTime => '1970-01-01T00:00:00.000000-00:00', | ||
:webUrl => url_for(:only_path => false, :controller => 'projects', :action => 'show', :id => project)) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters