Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 61 lines (48 sloc) 1.388 kb
41e2c2c Initial commit
Cloud Foundry Engineer authored
1 # Copyright (c) 2009-2011 VMware, Inc.
2 $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
3 $:.unshift(File.dirname(__FILE__))
4
5 require 'optparse'
6 require 'yaml'
7
8 require 'rubygems'
9 require 'bundler/setup'
10
11 require 'dea/agent'
12
431b79c Improve process for adding runtimes and frameworks
Jennifer Hickey authored
13 cfg_path = ENV["CLOUD_FOUNDRY_CONFIG_PATH"]
14 cfg_overrides = {}
15 cfg_overrides['config_file'] = File.join(cfg_path, 'dea.yml') if cfg_path
41e2c2c Initial commit
Cloud Foundry Engineer authored
16
17 options = OptionParser.new do |opts|
18 opts.banner = 'Usage: dea [OPTIONS]'
19 opts.on("-c", "--config [ARG]", "Configuration File") do |opt|
20 cfg_overrides['config_file'] = opt
21 end
22 opts.on("-s", "--secure", "Secure Application Environment") do |opt|
23 cfg_overrides['secure'] = true
24 end
25 opts.on("--disable_dir_cleanup", "Don't cleanup App directories") do |opt|
26 cfg_overrides['disable_dir_cleanup'] = true
27 end
28 opts.on("-h", "--help", "Help") do
29 puts opts
30 exit
31 end
32 end
33 options.parse!(ARGV.dup)
34
431b79c Improve process for adding runtimes and frameworks
Jennifer Hickey authored
35 unless cfg_overrides['config_file']
36 puts "Config file location not specified. Please run with --config argument " +
37 "or set CLOUD_FOUNDRY_CONFIG_PATH"
38 exit 1
39 end
40
41e2c2c Initial commit
Cloud Foundry Engineer authored
41 begin
42 config = File.open(cfg_overrides['config_file']) do |f|
43 YAML.load(f)
44 end
45 rescue => e
46 puts "Could not read configuration file: #{e}"
47 exit 1
48 end
49
50 config.update(cfg_overrides)
51
52 config['config_file'] = File.expand_path(config['config_file'])
53
54 EM.epoll
bb684bb @derekcollison Fail fast on NATS disconnects and reconnect timeouts
derekcollison authored
55
41e2c2c Initial commit
Cloud Foundry Engineer authored
56 EM.run {
57 agent = DEA::Agent.new(config)
58 agent.run()
59 }
60
Something went wrong with that request. Please try again.