Class: Mobilis::PostgresqlInstance
Instance Method Summary
collapse
#children, #display, #docker_image_name, #generate_build_sh, #git_commit_all, #initialize, #linked_to_rails_project, #links, #name, #options, #parents, #set_links, #type
#append_line, #oblivious_run_command, #run_command, #run_docker, #set_file_contents, #set_second_line, #write_file
Instance Method Details
#child_env_vars ⇒ Object
12
13
14
|
# File 'lib/mobilis/postgresql_instance.rb', line 12
def child_env_vars
[ ]
end
|
#data_dir ⇒ Object
27
28
29
|
# File 'lib/mobilis/postgresql_instance.rb', line 27
def data_dir
"./data/#{ name }"
end
|
#env_vars ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/mobilis/postgresql_instance.rb', line 16
def env_vars
vars = []
if linked_to_rails_project
vars << "POSTGRES_DB=#{ linked_to_rails_project.name }_production"
end
vars.concat [
"POSTGRES_USER=#{ name }",
"POSTGRES_PASSWORD=#{ password }"
]
end
|
#generate ⇒ Object
8
9
10
|
# File 'lib/mobilis/postgresql_instance.rb', line 8
def generate
FileUtils.mkdir_p data_dir
end
|
#has_local_build ⇒ Object
31
32
33
|
# File 'lib/mobilis/postgresql_instance.rb', line 31
def has_local_build
false
end
|
#password ⇒ Object
43
44
45
|
# File 'lib/mobilis/postgresql_instance.rb', line 43
def password
"#{name}_password"
end
|
#url ⇒ Object
35
36
37
|
# File 'lib/mobilis/postgresql_instance.rb', line 35
def url
"postgres://#{ username }:#{ password }@#{ name }:5432/"
end
|
#username ⇒ Object
39
40
41
|
# File 'lib/mobilis/postgresql_instance.rb', line 39
def username
name
end
|