Class: Conjure::Provision::Postgres

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/provision/postgres.rb

Instance Method Summary collapse

Constructor Details

#initialize(platform) ⇒ Postgres

Returns a new instance of Postgres.



7
8
9
10
11
# File 'lib/conjure/provision/postgres.rb', line 7

def initialize(platform)
  @platform = platform
  @name = "conjure_db_#{SecureRandom.hex 8}"
  @password = new_password
end

Instance Method Details



28
29
30
# File 'lib/conjure/provision/postgres.rb', line 28

def container_link
  {container_name => container_name}
end

#rails_configObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/conjure/provision/postgres.rb', line 17

def rails_config
  {
    "adapter" => "postgresql",
    "database" => @name,
    "host" => container_name,
    "username" => "db",
    "password" => @password,
    "template" => "template0",
  }
end

#startObject



13
14
15
# File 'lib/conjure/provision/postgres.rb', line 13

def start
  @ip_address = server_template.build(@platform).start_daemon("/sbin/my_init", start_options)
end