Class: BuildMaster::CI::Server
- Inherits:
-
Object
- Object
- BuildMaster::CI::Server
- Defined in:
- lib/buildmaster/ci/server.rb
Overview
A CI (Continuous Integration) server that does the following loop
-
check for modifications
-
if modification set found,
** update ** make ** publish (update site, email notification)
Instance Method Summary collapse
-
#initialize ⇒ Server
constructor
A new instance of Server.
- #serve ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Server
Returns a new instance of Server.
14 15 16 17 |
# File 'lib/buildmaster/ci/server.rb', line 14 def initialize @modification_checker = Array.new @updator = Array.new end |
Instance Method Details
#serve ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/buildmaster/ci/server.rb', line 19 def serve pid = fork {start} if (pid) ['INT', 'TERM'].each { |signal| trap(signal){Process.kill('break', pid)} } end end |
#start ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/buildmaster/ci/server.rb', line 28 def start puts "server started" until @stopped if check_modifications build_loop end sleep 30 end end |
#stop ⇒ Object
38 39 40 41 |
# File 'lib/buildmaster/ci/server.rb', line 38 def stop @stopped = true Thread.current.raise 'shutting down' end |