############################################################################### # Copyright (c) 2005, 2006 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### # properties for RSSFeedWatcherTask.java # one of 0|1|2 debug=2 # if file does not exist, it will be created; if it does, it will be modified file=../data/builds-emf-2.3.xml # required URL for the feed to check feedURL=http://www.eclipse.org/emf/feeds/builds-emf-2.3.xml # Feed Watch Actions - must be defined as triplets of [xpath0]; [script0]; [commandline0]; [xpath1]; [script1]; [commandline1]; ... # must be separated by semi-colons. Line breaks are permitted for clarity and will be String.trim()'d feedWatchActions=/*[name() = 'feed']/*[name() = 'updated']/text(); null; null # PASSING ANT TASK RESULTS TO EXTERNAL SCRIPT AS COMMANDLINE ARGUMENTS ###################################################################### # The <exec> task that is run within RSSFeedWatcherTask.java, eg. # <exec executable="/path/to/executable"><arg line="-somearg value -someotherarg anothervalue"/></exec> # will be passed some default commandline arguments BEFORE any you might want to specify as well (so that you can override them if you wish). # For example, if you have these properties set in this file: # debug=1 # feedWatchActions=//*[name() = 'entry'][1]/*[name() = 'updated']/text(); ../scripts_rss/sendEmailAlert.sh; -debug 0 # you will execute the following under the covers of the org.eclipse.releng.services.RSSFeedWatcherTask: # <exec executable="../scripts_rss/sendEmailAlert.sh"> # <arg line="-debug 1 -feedURL http://www.eclipse.org/emf/feeds/builds.xml # -xpath "/*[name() = 'feed']/*[name() = 'updated']/text()" # -oldvalue "2006-05-04T12:14:33Z" -newvalue "2006-05-11T12:14:33Z" -debug 0"/> # </exec> # Therefore, you can use these values in the script that you execute (be it sending an email or starting a build or whatever). # If you do NOT want to pass arguments to your executable, use the word "null" instead. This will NOT be passed to your script. # CHECKING ANT TASK RESULTS WITHIN ANT SCRIPT ############################################# # If you want to run some <exec> and then check the results of that execution, you can do so in the ant script that calls RSSFeedWatcherTask. # The following properties will be set after you run the task: # feedWatchAction.Result.0 - The result returned from the <exec> task; if set, something bad happened # feedWatchAction.Error.0 - Details about the error that occurred, if set, something bad happened # feedWatchAction.Output.0 - Console output from your <exec>, if any; # this will depend on what you run in response to a feed change, and if that process produces console output # feedWatchAction.OldValue.0 - The original value of the node you asked for, from the previous cached version of the feed # feedWatchAction.NewValue.0 - The changed value of the node you asked for, from the latest version of the feed; # if you asked for changes to the test status for performance tests, this could be "PASS"; # if you asked for any changes to the feed, this will be the XML datestamp of the last update, eg: 2006-05-04T12:14:33Z # # If you are watching for more than one condition, you can check for feedWatchAction.Result.0, feedWatchAction.Result.1, feedWatchAction.Result.2, etc. # RUNNING NO EXTERNAL <exec> ############################################# # If you only want to check for changes to the feed and handle the response yourself within Ant instead of an <exec>, # simply pass in the executable as "null" to prevent any shell execution from occurring. For example: # feedWatchActions=//*[name() = 'entry'][1]/*[name() = 'updated']/text(); null; null # If the node is found and the feed has been changed, the property feedWatchAction.NewValue.0 # (and/or feedWatchAction.NewValue.1, feedWatchAction.NewValue.2, etc.) will be set to the new changed value. ## XPATH EXAMPLES - SAMPLE NODES TO WATCH FOR CHANGES #################################################### # 1. to watch for ANY change in the feed, check the <feed>'s <updated> node (and respond with an email, passing -debug 1 to the mail script) # feedWatchActions=/*[name() = 'feed']/*[name() = 'updated']/text(); ../scripts_rss/sendEmailAlert.sh; -debug 1 # 2. to watch for ANY changes in the current build, check the first <entry>'s <updated> node (and respond with an email, no commandline flags) # feedWatchActions=//*[name() = 'entry'][1]/*[name() = 'updated']/text(); ../scripts_rss/sendEmailAlert.sh; null # 3a. to watch for coordinated status changes, check the first <entry>'s <build> node's coordinated="" attribute (and respond using some custom Ant script) # feedWatchActions=//*[name() = 'entry'][1]/*/*/*[name() = 'coordinated']/@status; null; null # 3b. to watch for jar signing status changes, check the first <entry>'s <build> node's jars="" attribute (and respond using some custom Ant script) # feedWatchActions=//*[name() = 'entry'][1]/*/*[name() = 'build']/@jars; null; null # 3c. to watch for changes in the current build's performance test results on linux-gtk (and respond using some custom Ant script) # feedWatchActions=//*[name() = 'entry'][1]/*/*/*/*[@type = 'performance']/*[name() = 'result'][@os = 'linux'][@ws = 'gtk']/text(); null; null