Sha256: 1949cf18f1b8fad3a1204add182ac5c94a6f24aa2ca217aab9b67f0178314839
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
module Jack module EbConfig # Abstract Class # Concrete classes should implement methods: platform and app_name class Base include Util attr_reader :eb_config_path def initialize(options={}) @options = options @root = options[:root] || '.' @env_name = options[:env_name] @eb_config_path = "#{@root}/.elasticbeanstalk/config.yml" ensure_folder_exist(@eb_config_path) end def sync ensure_eb_init write_eb_config_yml end def ensure_eb_init unless File.exist?(eb_config_path) do_cmd(%Q|eb init -p "#{platform}" "#{app_name}"|, @options) end end def write_eb_config_yml data = YAML.load_file(eb_config_path) data['global']['application_name'] = app_name data['global']['default_platform'] = platform dump = YAML.dump(data).gsub("!ruby/object:Hash", '') dump = dump.split("\n")[1..-1].join("\n") # strip first line File.write(eb_config_path, dump) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jack-eb-0.0.4 | lib/jack/eb_config/base.rb |