Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 20th, 2012  |  syntax: None  |  size: 1.58 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Ruote.process_definition :name => 'handle_sr' do
  2.   sequence do
  3.     request_handler :action => 'review'
  4.     cursor :break_if => '${status} == FAILED' do
  5.       check_process    
  6.       check_quality
  7.     end
  8.  
  9.     _if => '${status} == FAILED' do
  10.       sequence do
  11.         request_handler :action => 'reject'
  12.         notify
  13.         cancel_process
  14.       end
  15.     end
  16.  
  17.     # grant sequential access to the builder
  18.     # Waits in a queue until OBS is free
  19.     get_OBS_ticket
  20.  
  21.     build_packages # This copies packages in request to Trunk:Testing
  22.  
  23.     # This will block until the built_Trunk:Testing
  24.     # participant is called by robogrator
  25.     # There will be a built_* participant acting as a 'sink'
  26.     listen :to => 'built_${project}'
  27.  
  28.     _if '${build_status} == SUCCESS' do
  29.       sequence do
  30.         build_ks
  31.         build_image
  32.         test_image
  33.         _if '${test_success}' do
  34.           subprocess 'do_updates'
  35.           subprocess 'do_revert'
  36.         end
  37.       end
  38.       subprocess 'do_revert' # build not SUCCESSful
  39.     end
  40.     release_OBS_ticket
  41.   end
  42.  
  43.   define 'do_updates' do
  44.     sequence do
  45.       iterator :on_field => 'packages', :to_field => 'package' do
  46.         sequence do
  47.           get_changelog
  48.           concurrence do
  49.             bz
  50.             swpro
  51.             revs_update
  52.           end
  53.         end
  54.       end
  55.       request_handler :action => 'accept'
  56.       notify :msg => "Promoted pkg:${package} tested successfully in Trunk"
  57.     end
  58.   end
  59.   define 'do_revert' do
  60.     sequence do
  61.       revert
  62.       listen :to => 'built_${project}'
  63.     end
  64.   end
  65. end