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

#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" => @ip_address,
    "username" => "db",
    "password" => @password,
    "template" => "template0",
  }
end

#startObject



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

def start
  @ip_address = dockerfile.build(@platform).start("/sbin/my_init")
end