-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
Configuration is managed through a XML file called BuildStatusMonitor.settings.xml (or whatever is defined in the BuildStatusMonitor.exe.config file)
##Build Status Monitor.exe.config##
The BuildStatusMonitor.exe.config file is a standard .net configuration file which looks like this:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="BuildStatusMonitor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<applicationSettings>
<BuildStatusMonitor.Properties.Settings>
<setting name="LogFileName" serializeAs="String">
<value>C:\BuildStatusMonitor\BuildStatusMonitor.Log</value>
</setting>
<setting name="LogFileSize" serializeAs="String">
<value>25</value>
</setting>
<setting name="LogLevel" serializeAs="String">
<value>Warnining</value>
</setting>
<setting name="ConfigurationFile" serializeAs="String">
<value>C:\BuildStatusMonitor\BuildStatusMonitor.Settings.XML</value>
</setting>
</BuildStatusMonitor.Properties.Settings>
</applicationSettings>
</configuration>
###LogFileName### The LogFileName entry simply defines the name and location of the Log File for the application.
###LogFileSize### The LogFileSize entry is a size, in MB, of the maximum size for the log file before the log file is rolled and a new log file is created. Old log files are renamed with a date/time stamp.
###LogLevel### The LogLevel defines the amount of detail required in the file. Valid settings are:
- Verbose - Everything
- Information - Almost Everything
- Warning - Only Warning and Errors are reported
- Error - Only critical errors are reported
##ConfigurationFile## The name of the configuration file which contains the details of the Visualisers and Monitors.
#BuildStatusMonitor.settings.xml file# The BuildStatusMonitor.settings.xml file stores all the details about the management of the application. It defines Monitors, Visualisers, Settings, Combinations of Monitors and Visualisers and Polling information.
A typcial file is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<BuildStatusConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Settings>
<Setting Name="PollFrequency" Value="5" />
</Settings>
<Schedules DefaultState="OFF">
<Schedule DayOfWeek="Week" StartTime="6:00AM" FinishTime="8:00PM" State="ON" />
</Schedules>
<Controllers>
<Controller Name="Project 1 Lights" Monitor="P1Monitor" Visualiser="DelcomLight#1"/>
<Controller Name="Project 2 Lights" Monitor="P2Monitor" Visualiser="DelcomLight#2"/>
<Controller Name="Project 1 File" Monitor="P1Monitor" Visualiser="P1FileTrace"/>
<Controller Name="Project 2 File" Monitor="P2Monitor" Visualiser="P2FileTrace"/>
</Controllers>
<Monitors>
<Monitor Name="P1Monitor" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Monitors.TeamCityMonitor">
<Settings>
<Setting Name="Host" Value="<somehost>:8080" />
<Setting Name="User" Value="guest" />
<Setting Name="Password" Value="guest" />
<Setting Name="UseGuest" Value="true" />
<Setting Name="ProjectID" Value="project2" />
<Setting Name="ProjectID" Value="project6" />
<Setting Name="ProjectID" Value="project4" />
<!--
<Setting Name="BuildID" Value="Value1" />
<Setting Name="ProjectID" Value="Value1" />
<Setting Name="ProjectName" Value="Value1" />
-->
</Settings>
</Monitor>
<Monitor Name="P2Monitor" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Monitors.TeamCityMonitor">
<Settings>
<Setting Name="Host" Value="<somehost>:8080" />
<Setting Name="User" Value="guest" />
<Setting Name="Password" Value="guest" />
<Setting Name="UseGuest" Value="true" />
<Setting Name="BuildID" Value="bt13" />
<!--
<Setting Name="BuildID" Value="Value1" />
<Setting Name="ProjectID" Value="Value1" />
<Setting Name="ProjectName" Value="Value1" />
-->
</Settings>
</Monitor>
</Monitors>
<Visualisers>
<Visualiser Name="DelcomLight#1" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Visualisers.DelcomVisualiser">
<Settings>
<Setting Name="DeviceID" Value="\\?\hid#vid_0fc5&pid_b080#6&1cb2b5da&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" />
</Settings>
</Visualiser>
<Visualiser Name="DelcomLight#2" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Visualisers.DelcomVisualiser">
<Settings>
<Setting Name="DeviceID" Value="\\?\hid#vid_0fc5&pid_b080#6&78b522f&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" />
</Settings>
</Visualiser>
<Visualiser Name="P1FileTrace" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Visualisers.FileTraceVisualiser">
<Settings>
<Setting Name="File" Value="C:\BuildStatusMonitor\EBBuildStatus.Log" />
</Settings>
</Visualiser>
<Visualiser Name="P2FileTrace" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Visualisers.FileTraceVisualiser">
<Settings>
<Setting Name="File" Value="C:\BuildStatusMonitor\ESBuildStatus.Log" />
</Settings>
</Visualiser>
</Visualisers>
</BuildStatusConfig>
##Settings##
The settings section defines Key/Value pairs of settings. Currently the only valid setting is PollFrequency which is set to 5 seconds.
###Schedules### Schedules allows the configuration of when the visualisers are turned ON or OFF. This is to save power and not have lights on during the night when no one is at home.
The Schedules section contains one or more Schedule entries.
Each Schedule has the following attributes:
EG : DayOfWeek="Week" StartTime="6:00AM" FinishTime="8:00PM" State="ON"
- DayOfWeek - Can be Week, Weekend, Monday, Tuesday, Wednesday... It defines the DAY that the entry takes affect
- StartTime - defines the time this entry starts (eg: 6:00AM) which will set the state to that defined by State.
- FinishTime - defines the time this entry stops (eg: 8:00PM) which will toggle the state
- State - The state to set the visualisers when the time event occurs. This is either ON or OFF. In the example above, at 6:00AM the Visualisers will all be sent a ON message. At 8:00PM they will all be sent a OFF message.
###Controllers### Controllers define the combinations of Monitors and Visualisers. Simply they are named combinations and these are then created dynamically at run time. Any number of Controllers can be defined BUT a Visualiser can only be used once. You can use a Monitor more than once however.
EG:
In the example above, there are 4 Visualisers but only 2 Monitors and the same Monitors are used to control multiple Visualisers.
- Name - a Unique name for this Controller
- Monitor - Which monitor will this controller use
- Visualiser - Which visualiser will this controller use.
###Visualisers###
Visualisers define Visual things and the Visualisers section can have multiple Visualier entries. Each Visualiser entry defines a visualiser.
For example the following defines a Visualiser for a Delcom Light.
<Visualiser Name="DelcomLight#1" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Visualisers.DelcomVisualiser">
<Settings>
<Setting Name="DeviceID" Value="\\?\hid#vid_0fc5&pid_b080#6&1cb2b5da&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" />
</Settings>
</Visualiser>
The key data to know is:
- Name - A Unique name for this Visualiser
- Assembly - in what .net assembly is the Plugin Found (normally the current executing one)
- Class - what is the class that will be instatiated which meets the IVisualiser Interface.
- Settings - defines the settings as Key/Value pairs.
The following Settings are valid:
-
DelcomVisualiser: Name="DeviceID" Value="The ID of the Delcom light to be used. See Build Status Visualisers for more details"
-
FileTraceVisualiser: Name="File" Value="The file where the data will be output"
###Monitors###
Monitors monitor things and in the Monitors section multiple Monitor entries can be defined. Currently only the Team City monitor exist. To configure a monitor, the following settings are used.
<Monitor Name="ESMonitor" Assembly="BuildStatusMonitor" Class="BuildStatusMonitor.Monitors.TeamCityMonitor">
<Settings>
<Setting Name="Host" Value="<somehost>:8080" />
<Setting Name="User" Value="guest" />
<Setting Name="Password" Value="guest" />
<Setting Name="UseGuest" Value="true" />
<Setting Name="ProjectID" Value="project2" />
<Setting Name="ProjectID" Value="project6" />
<Setting Name="ProjectID" Value="project4" />
<!--
<Setting Name="BuildID" Value="Value1" />
<Setting Name="ProjectID" Value="Value1" />
<Setting Name="ProjectName" Value="Value1" />
-->
</Settings>
- Name - a Unique name for the monitor
- Assembly - the .net assembly in which the monitor code exists
- Class - the class name of the monitor that adheres to the IMonitor interface
The following Key/Value pairs are used :
- Host - the name and port of the Team City Server (do not include the http://)
- User - The user name to connect as (default guest)
- Password - the password to connect as
- UseGuest - use the guest connection (default true)
The build monitor works by allowing you to monitor 1 or more build configurations. The output is defined as:
- All configurations as sucessfull = OK
- Any configuration failed = FAILED
- Any configuration building = INPROGRESS
So the configuration allows you to add mutliple build configurations or individual builds to be monitored by this monitor. The settings are:
- ProjectID = the id of the project to monitor. ALL configurations defined in this project will be monitored
- BuildID = the id of a specific build configuration to monitor
- ProjectName = the name of the project to monitor rather than the ID but works like the ID
For example, if Project1 had 3 build configurations (IDs 1, 2, 3) and Project 2 has 2 configurations (4, 5) then you could add:
Name="ProjectID" Value="2" Name="BuildID" Value="1" Name="BuildID" Value="3"
In this example, the monitor would monitor the status of the build configurations 1, 3, 4 and 5 only.