10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/kaiser/databases/mysql.rb', line 10
def options_hash
testpass = @options[:root_password] || 'testpassword'
parameters = @options[:parameters] || ''
port = @options[:port] || 3306
{
port: port,
data_dir: '/var/lib/mysql',
params: "-e MYSQL_ROOT_PASSWORD=#{testpass}",
commands: parameters,
waitscript_params: "
-e MYSQL_ADDR=<%= db_container_name %>
-e MYSQL_PORT=#{port}
-e MYSQL_ROOT_PASSWORD=#{testpass}",
waitscript: " #!/bin/bash\n\n echo \"Waiting for mysql to start.\"\n until mysql -h\"$MYSQL_ADDR\" -P\"$MYSQL_PORT\" -uroot -p\"$MYSQL_ROOT_PASSWORD\" -e \"SELECT 1\"\n do\n printf \".\"\n sleep 1\n done\n\n echo -e \"\\nmysql started.\"\n SCRIPT\n }\nend\n"
|