Skip to content

Commit

Permalink
http: pass GRN_* environment variables to nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 26, 2015
1 parent 4a9a730 commit 51f1be5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/grntest/test-runner.rb
Expand Up @@ -359,7 +359,7 @@ def create_config_file(context, host, port, pid_file_path)
config_file_path =
context.temporary_directory_path + "groonga-httpd.conf"
config_file_path.open("w") do |config_file|
config_file.puts(<<EOF)
config_file.puts(<<-GLOBAL)
daemon off;
master_process off;
worker_processes 1;
Expand All @@ -369,7 +369,16 @@ def create_config_file(context, host, port, pid_file_path)
events {
worker_connections 1024;
}
GLOBAL

ENV.each do |key, value|
next unless key.start_with?("GRN_")
config_file.puts(<<-ENV)
env #{key};
ENV
end

config_file.puts(<<-HTTP)
http {
server {
access_log groonga-httpd-access.log;
Expand All @@ -382,7 +391,7 @@ def create_config_file(context, host, port, pid_file_path)
}
}
}
EOF
HTTP
end
config_file_path
end
Expand Down

0 comments on commit 51f1be5

Please sign in to comment.