Hudson -CI屏幕保护程序设置 [英] Hudson -CI Screen saver setup

查看:122
本文介绍了Hudson -CI屏幕保护程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,有没有我可以设置一个屏幕保护程序与运行在hudson的项目列表,指示项目的状态。说明屏幕保护程序的部分对于项目已成功显示为绿色,如果项目无法构建则显示为红色。

HI , Is there any I can setup a screen saver with the list of projects running in hudson which indicates the status of the project. Say the part of the screen saver indicates green for projects got succeded , and shows the red if the project is failed to build.

可能必须将屏幕保护程序分区为多个项目!!!

Probably the screen saver must be partitioned to multiple projects !!!

推荐答案

您可以在任何合适的环境Flex / AS3。可以读取XML并生成所需的屏幕保护程序设计和可执行文件(取决于您的目标平台)

You can create something in any suitable environment e.g. Flex / AS3. that can read XML and also generate the sort of screensaver design and executable you need (depending on your target platform)

您可以创建一个简单的网页并使用哈德森数据通过AJAX,并以HTML / CSS渲染您的显示,这是由你决定,但它是相当微不足道的做。

You could just create to a straightforward webpage and consume the hudson data over AJAX, and render your display in HTML/CSS, it's up to you, but it's fairly trivial to do.

Hudson将提供当前的工作列表及其

Hudson will provide the current list of jobs and their status color over it's basic API (XML in this example)

http://hostname:8080/api/xml 

会产生类似...

 <hudson>
   <assignedLabel></assignedLabel>
   <mode>NORMAL</mode>
   <nodeDescription>the master Hudson node</nodeDescription>
   <nodeName></nodeName>
   <numExecutors>5</numExecutors>
   <job>
     <name>JobOne</name>
     <url>http://hostname:8080/job/JobOne/</url>
     <color>blue</color>
   </job>
   <job>
     <name>JobTwo</name>
     <url>http://hostname:8080/job/JobTwo/</url>
     <color>blue</color>
   </job>
   <job>
     <name>JobThree</name>
     <url>http://hostname:8080/job/JobThree/</url>
     <color>blue</color>
   </job>
   <overallLoad></overallLoad>
   <primaryView>
     <name>All</name>
     <url>http://hostname:8080/</url>
   </primaryView>
   <slaveAgentPort>0</slaveAgentPort>
   <useCrumbs>false</useCrumbs>
   <useSecurity>true</useSecurity>
   <view>
     <name>All</name>
     <url>http://hostname:8080/</url>
   </view>
   <view>
     <name>Dashboard</name>
     <url>http://hostname:8080/view/Dashboard/</url>
   </view>
 </hudson>

您会对这些节点感兴趣...

You'd be interested in these nodes...

   <job>
     <name>JobOne</name>
     <url>http://hostname:8080/job/JobOne/</url>
     <color>blue</color>
   </job>
   <job>
     <name>JobTwo</name>
     <url>http://hostname:8080/job/JobTwo/</url>
     <color>blue</color>
   </job>
   <job>
     <name>JobThree</name>
     <url>http://hostname:8080/job/JobThree/</url>
     <color>blue</color>
   </job>

这将很容易选择并获得所需的颜色(构建状态为红色或蓝色)名称。如果你想要更多的信息,我会很乐意把一些基本的东西放在一起。

Which would be easy to select and get the required color (build status is red or blue) and job name. If you want more info I'd be happy to throw something basic together.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns="*" creationComplete="start()">

    <!-- The HTTPService request -->
    <mx:HTTPService id="jobsRequest" url="http://localhost:8080/api/xml" useProxy="false" method="POST">
        <mx:request xmlns="">
        </mx:request>
    </mx:HTTPService>

    <!-- basic timer to trigger the data request from Hudson -->
    <mx:Script>
        <![CDATA[
            import flash.utils.Timer;
            import flash.events.TimerEvent;

            private var t:Timer = new Timer(5000, 0); // repeat every 5 seconds;

            private function start():void {
              t.addEventListener(TimerEvent.TIMER, getHudsonStatus);
              t.start();
            }

            private function getHudsonStatus(e:TimerEvent):void {
                jobsRequest.send();
            }
        ]]>
    </mx:Script>

    <!-- the view -->
    <mx:DataGrid id="hudsonJobsDataGrid" x="22" y="128" dataProvider="{jobsRequest.lastResult.hudson.job}">
        <mx:columns>
            <mx:DataGridColumn headerText="Name" dataField="status"/>
            <mx:DataGridColumn headerText="Status" dataField="color"/>
        </mx:columns>
    </mx:DataGrid>

</mx:Application>

这是非常糟糕的,但它正在做你需要的数据检索,Flex 4或Silverlight会给你更好的数据驱动列表,使用ItemRenders(Flex4 Spark)或DataTemplates(Silverlight),我认为Flex4路由将需要更少的代码,如果它必须是一个屏幕保护程序,将SWF转换为屏幕保护程序是相当简单,并且很多工具

This is pretty crappy, but it's doing the data retrieval you need, Flex 4 or Silverlight will give you better data driven lists, with ItemRenders (Flex4 Spark) or DataTemplates (Silverlight), I think the Flex4 route will require less code, and if it MUST be a screensaver, it's fairly simple to convert SWF's to Screensavers, and a lot of tools are available to automate the process.

创建了一个更好的视图作为使用Spark组件(DataGroup + ItemRenderer)的Flex 4全屏AIR应用程序,它在这里 http:// gist .github.com / 623167 作为来源。需要Flashbuilder4或AIR SDK才能构建它。它不是一个成品!

I've created a nicer view as a fullscreen AIR Application with Flex 4 using Spark components (DataGroup + ItemRenderer) it's here http://gist.github.com/623167 as source. Flashbuilder4 or the AIR SDK is required to build it. It's not a finished product of course!

它看起来像这样...: http://i.stack.imgur.com/8I92U.png - 当它监视 http://deadlock.netbeans.org/hudson

It looks like this... : http://i.stack.imgur.com/8I92U.png - when it was monitoring http://deadlock.netbeans.org/hudson

这篇关于Hudson -CI屏幕保护程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆