32 lines
		
	
	
		
			848 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			848 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| 
 | |
| module Devops
 | |
|   module Version2_0
 | |
|     module Routes
 | |
|       module DeployRoutes
 | |
| 
 | |
|         def self.registered(app)
 | |
| 
 | |
|           # Run chef-client on reserved server
 | |
|           #
 | |
|           # * *Request*
 | |
|           #   - method : POST
 | |
|           #   - headers :
 | |
|           #     - Content-Type: application/json
 | |
|           #   - body :
 | |
|           #     {
 | |
|           #       "names": [],  -> array of servers names to run chef-client
 | |
|           #       "tags": [],   -> array of tags to apply on each server before running chef-client
 | |
|           #       "trace": true -> return output in stream
 | |
|           #     }
 | |
|           #
 | |
|           # * *Returns* : text stream
 | |
|           app.post_with_headers "/deploy", :headers => [:content_type], &Devops::Version2_0::Handler::Deploy.deploy
 | |
| 
 | |
|           puts "Deploy routes initialized"
 | |
|         end
 | |
| 
 | |
|       end
 | |
|     end
 | |
|   end
 | |
| end
 | 
