-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
48 lines (38 loc) · 911 Bytes
/
Rakefile
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
require 'rubygems'
require 'colorize'
namespace :nginx do
desc 'start nginx, default config is config/nginx.conf'
task :start do
`sudo /opt/nginx/sbin/nginx`
puts "nginx started".green
end
desc 'stop nginx'
task :stop do |t, args|
`sudo pkill nginx`
puts "nginx stopped".red
end
desc 'restart nginx'
task :restart => [:stop, :start]
desc 'show nginx processes'
task :show do
puts `ps -ef | grep nginx`
end
end
namespace :varnish do
desc 'start varnish'
task :start do
`sudo varnishd -f /etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:80`
puts "varnishd started".green
end
desc 'stop varnish'
task :stop do
`sudo pkill varnishd`
puts "varnishd stopped".red
end
desc 'restart varnish'
task :restart => [:stop, :start]
desc 'show varnish processes'
task :show do
puts `ps -ef | grep varnishd`
end
end