Class: ContinuousIntegration::Server
- Inherits:
-
Object
- Object
- ContinuousIntegration::Server
- Defined in:
- lib/continuous_integration/server.rb
Overview
class to perform the server operations
Instance Attribute Summary collapse
-
#root ⇒ Object
Perform Continuous Integration operations!.
-
#server ⇒ Object
Perform Continuous Integration operations!.
Class Method Summary collapse
- .create_server ⇒ Object
- .dir_mount ⇒ Object
- .dir_unmount ⇒ Object
-
.setup_server ⇒ Object
setup the CI server config.
- .shutdown_server ⇒ Object
- .start_server ⇒ Object
Instance Attribute Details
#root ⇒ Object
Perform Continuous Integration operations!
Example:
>> server = ContinuousIntegration.setup_server
>> ContinuousIntegration.start_server server
=> INFO WEBrick x.x.x
Arguments:
server: (Object)
24 25 26 |
# File 'lib/continuous_integration/server.rb', line 24 def root @root end |
#server ⇒ Object
Perform Continuous Integration operations!
Example:
>> server = ContinuousIntegration.setup_server
>> ContinuousIntegration.start_server server
=> INFO WEBrick x.x.x
Arguments:
server: (Object)
24 25 26 |
# File 'lib/continuous_integration/server.rb', line 24 def server @server end |
Class Method Details
.create_server ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/continuous_integration/server.rb', line 55 def self.create_server WEBrick::HTTPServer.new( Port: PORT_NUM, DocumentRoot: @root, DirectoryIndex: [] ) end |
.dir_mount ⇒ Object
63 64 65 |
# File 'lib/continuous_integration/server.rb', line 63 def self.dir_mount @server.mount SUB_URI, DockerEndpoint end |
.dir_unmount ⇒ Object
67 68 69 |
# File 'lib/continuous_integration/server.rb', line 67 def self.dir_unmount @server.unmount SUB_URI end |
.setup_server ⇒ Object
setup the CI server config
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/continuous_integration/server.rb', line 32 def self.setup_server # path for the web server to serve the test results @root = File. "#{API_SPECS_PATH}/logs" # create the server @server = self.create_server # mount the dir dir_mount # shut server down on any interrupt trap('INT') do shutdown_server end end |
.shutdown_server ⇒ Object
48 49 50 51 |
# File 'lib/continuous_integration/server.rb', line 48 def self.shutdown_server dir_unmount @server.shutdown end |
.start_server ⇒ Object
26 27 28 29 |
# File 'lib/continuous_integration/server.rb', line 26 def self.start_server self.setup_server @server.start end |