forked from shortcutmedia/query-server-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
62 lines (43 loc) · 1.46 KB
/
Rakefile
File metadata and controls
62 lines (43 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require 'rake'
NGINX_ENV = ENV['NGINX_ENV'] ||= 'development'
###############################################################################
# Building
NGINX_VERSION = '1.7.11'
desc 'Bootstraps the local development environment'
task :bootstrap do
sh "NGINX_VERSION=#{NGINX_VERSION} script/bootstrap.sh"
end
desc 'Configures nginx build'
task :configure do
sh "NGINX_VERSION=#{NGINX_VERSION} script/configure_build.sh"
end
desc 'Builds nginx'
task :build do
sh "NGINX_VERSION=#{NGINX_VERSION} script/build.sh"
end
###############################################################################
# Running
NGINX_PIDFILE = File.join File.dirname(__FILE__), 'build/nginx-query-server-proxy/logs/nginx-query-server-proxy.pid'
NGINX_CONF_FILE = File.join File.dirname(__FILE__), "config/#{ENV['NGINX_ENV']}.conf"
desc "Starts nginx"
task :start do
raise 'Already running' if File.exist?(NGINX_PIDFILE)
`build/nginx-query-server-proxy/bin/nginx-query-server-proxy -c #{NGINX_CONF_FILE}`
sleep 1
end
desc "Stops nginx"
task :stop do
`build/nginx-query-server-proxy/bin/nginx-query-server-proxy -s stop` if File.exist?(NGINX_PIDFILE)
sleep 1
end
desc "Restarts nginx"
task :restart => [:stop, :start]
###############################################################################
# Tests
desc "Runs all tests in ./test/*_test.rb"
task :test do
$: << 'test'
Dir[File.join(File.dirname(__FILE__), 'test/*_test.rb')].each do |test_file|
load test_file
end
end