Class: Eureka::Execute
- Inherits:
-
Object
- Object
- Eureka::Execute
- Defined in:
- lib/eureka/execute.rb
Class Method Summary collapse
- .app_port ⇒ Object
- .command ⇒ Object
- .eureka_url ⇒ Object
- .instance_id ⇒ Object
- .jar_path ⇒ Object
- .options ⇒ Object
- .run ⇒ Object
- .side_app_name ⇒ Object
- .sidecar_port ⇒ Object
Class Method Details
.app_port ⇒ Object
39 40 41 |
# File 'lib/eureka/execute.rb', line 39 def app_port "--app-port=#{Eureka.app_port}" end |
.command ⇒ Object
13 14 15 |
# File 'lib/eureka/execute.rb', line 13 def command "sh -c 'java -jar #{}'" end |
.eureka_url ⇒ Object
44 45 46 |
# File 'lib/eureka/execute.rb', line 44 def eureka_url "--eureka-url=#{File.join(Eureka.eureka_url, "")}" end |
.instance_id ⇒ Object
27 28 29 |
# File 'lib/eureka/execute.rb', line 27 def instance_id "--instance-id=#{Eureka.instance_id}" if Eureka.instance_id end |
.options ⇒ Object
17 18 19 20 21 |
# File 'lib/eureka/execute.rb', line 17 def %w[jar_path side_app_name eureka_url app_port sidecar_port instance_id].map do |option| send(option) end.select{ |option| !option.to_s.strip.empty? }.join(' ') end |
.run ⇒ Object
6 7 8 9 10 11 |
# File 'lib/eureka/execute.rb', line 6 def run Dir.chdir(File. '../../..', __FILE__) do p command exec command end end |
.side_app_name ⇒ Object
35 36 37 |
# File 'lib/eureka/execute.rb', line 35 def side_app_name "--side-app-name=#{Eureka.side_app_name}" end |
.sidecar_port ⇒ Object
31 32 33 |
# File 'lib/eureka/execute.rb', line 31 def sidecar_port "--sidecar-port=#{Eureka.sidecar_port}" end |