mina-rails-tools 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51bfa5a2614813f6107da6717c0c6471f8e41e3d
4
- data.tar.gz: ee25ca4274b61b1c47c3b078fb41a7fa9e08e0b8
3
+ metadata.gz: 57bc809c36e0c5c0e575e7305821862a1a43f541
4
+ data.tar.gz: 943a70c57c53406e6ab080c02fb7c96bbd01de3d
5
5
  SHA512:
6
- metadata.gz: a38ad90ffb511a8e1278a776109c3bd57f0629bd1a15bc8d0bc0cdeab0a45340a971619513c1c6bfd9f28c6960e24f2fdfedac5c144eb69970d827c841c6784f
7
- data.tar.gz: 2c7edbba97477d93ad6245933e6026395cc57a89b0af2342bb4ffd3a94222d7d831fda2c2ae86c52ab489db4213dfb4e3262e1ce02e86c8056a2d0cbee80bc82
6
+ metadata.gz: 1412f8f892658516babb9026f72aac6c065695272edfb5f7b26bf30c99b16f71c889b9859716e49cc42ab6e5f23ac00803d5a9e93b31f4441ea64689b443f9c9
7
+ data.tar.gz: 4b2f5f6a85567f4f586330c63190338d2bb037212d45e23c6fa814703eff290b7f198e8b71dceaadc4f3f7386d9b999a055e5bd2b2a855936d555686b23b3f89
@@ -19,7 +19,7 @@ namespace :nginx do
19
19
  invoke :sudo
20
20
  extra_echo("Nginx: Symlink config file")
21
21
 
22
- command echo_cmd %{sudo ln -fs "#{deploy_to}/shared/nginx.conf" "#{nginx_conf_path}/#{app!}.conf"}
22
+ command echo_cmd %{sudo ln -fs "#{deploy_to}/shared/nginx.conf" "#{nginx_conf_path}/#{fetch(:app)}.conf"}
23
23
  # command check_symlink nginx_conf_path
24
24
  end
25
25
 
@@ -28,8 +28,8 @@ namespace :nginx do
28
28
  invoke :sudo
29
29
 
30
30
  command_echo("#"*80)
31
- command_echo("# File: #{nginx_conf_path}/#{app!}.conf")
32
- command %{sudo cat "#{nginx_conf_path}/#{app!}.conf"}
31
+ command_echo("# File: #{nginx_conf_path}/#{fetch(:app)}.conf")
32
+ command %{sudo cat "#{nginx_conf_path}/#{fetch(:app)}.conf"}
33
33
  command_echo("#"*80)
34
34
  end
35
35
 
@@ -20,9 +20,9 @@ namespace :rainbows do
20
20
  desc "Unicron: startup"
21
21
  task :defaults do
22
22
  invoke :sudo
23
- command echo_cmd %{sudo chown root:root /etc/init.d/rainbows-#{app!}}
24
- command echo_cmd %{sudo chmod u+x /etc/init.d/rainbows-#{app!}}
25
- command echo_cmd "sudo update-rc.d rainbows-#{app!} defaults"
23
+ command echo_cmd %{sudo chown root:root /etc/init.d/rainbows-#{fetch(:app)}}
24
+ command echo_cmd %{sudo chmod u+x /etc/init.d/rainbows-#{fetch(:app)}}
25
+ command echo_cmd "sudo update-rc.d rainbows-#{fetch(:app)} defaults"
26
26
  end
27
27
 
28
28
  task :log do
@@ -37,7 +37,7 @@ namespace :rainbows do
37
37
  task :link do
38
38
  invoke :sudo
39
39
  extra_echo("Rainbows: Link script file")
40
- command echo_cmd %{sudo cp '#{deploy_to}/shared/config/rainbows_init.sh' '/etc/init.d/rainbows-#{app!}'}
40
+ command echo_cmd %{sudo cp '#{deploy_to}/shared/config/rainbows_init.sh' '/etc/init.d/rainbows-#{fetch(:app)}'}
41
41
 
42
42
  invoke :"rainbows:defaults"
43
43
  end
@@ -45,19 +45,19 @@ namespace :rainbows do
45
45
  desc "Start rainbows"
46
46
  task :start do
47
47
  extra_echo("Rainbows: Start")
48
- command echo_cmd "/etc/init.d/rainbows-#{app!} start"
48
+ command echo_cmd "/etc/init.d/rainbows-#{fetch(:app)} start"
49
49
  end
50
50
 
51
51
  desc "Stop rainbows"
52
52
  task :stop do
53
53
  extra_echo("Rainbows: Stop")
54
- command echo_cmd "/etc/init.d/rainbows-#{app!} stop"
54
+ command echo_cmd "/etc/init.d/rainbows-#{fetch(:app)} stop"
55
55
  end
56
56
 
57
57
  desc "Restart rainbows using 'upgrade'"
58
58
  task :restart do
59
59
  extra_echo("Rainbows: Restart")
60
- command echo_cmd "/etc/init.d/rainbows-#{app!} upgrade"
60
+ command echo_cmd "/etc/init.d/rainbows-#{fetch(:app)} upgrade"
61
61
  end
62
62
 
63
63
  end
@@ -1,5 +1,5 @@
1
1
  upstream unicorn-<%= app %> {
2
- server unix:/tmp/unicorn.<%= app! %>.socket fail_timeout=0;
2
+ server unix:/tmp/unicorn.<%= fetch(:app) %>.socket fail_timeout=0;
3
3
  }
4
4
 
5
5
  # <%= app %> Server
@@ -15,7 +15,7 @@ server {
15
15
 
16
16
  try_files $uri/index.html $uri @unicorn;
17
17
  location @unicorn {
18
- proxy_pass http://unicorn-<%= app! %>;
18
+ proxy_pass http://unicorn-<%= fetch(:app) %>;
19
19
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20
20
  proxy_set_header X-Real-IP $remote_addr;
21
21
  proxy_set_header Host $http_host;
@@ -8,7 +8,7 @@ unicorn_pid = "<%= "#{deploy_to!}/#{shared_path!}/pids/unicorn.pid" %>"
8
8
 
9
9
  # God.pid_file_directory = File.join("<%= deploy_to! %>", "shared", "pids")
10
10
  God.watch do |w|
11
- w.name = "unicorn_<%= "#{app!}" %>"
11
+ w.name = "unicorn_<%= "#{fetch(:app)}" %>"
12
12
  w.interval = 30.seconds # default
13
13
 
14
14
  w.start = "cd #{rails_root} && /usr/local/bin/bundle exec unicorn_rails -D -c #{config} -E #{rails_env}"
@@ -1,7 +1,7 @@
1
1
  rails_root = "<%= "#{deploy_to!}/#{current_path!}" %>"
2
2
  rails_env = "<%= rails_env || "production" %>"
3
3
  pid_file = "<%= "#{deploy_to!}/#{shared_path}" %>/pids/unicorn.pid"
4
- socket_file= "/tmp/unicorn.<%= app! %>.socket"
4
+ socket_file= "/tmp/unicorn.<%= fetch(:app) %>.socket"
5
5
  log_file = "<%= "#{deploy_to!}/#{shared_path}" %>/log/unicorn.log"
6
6
  err_log = "<%= "#{deploy_to!}/#{shared_path}" %>/log/unicorn.error.log"
7
7
  old_pid = pid_file + '.oldbin'
@@ -3,84 +3,84 @@ require "mina/extras"
3
3
  set :use_unicorn, true
4
4
 
5
5
  namespace :unicorn do
6
-
6
+
7
7
  desc "Unicorn: Parses config file and uploads it to server"
8
8
  task :upload => [:'upload:config', :'upload:script']
9
-
9
+
10
10
  namespace :upload do
11
11
  desc "Parses Unicorn config file and uploads it to server"
12
12
  task :config do
13
13
  upload_shared_file("unicorn.rb")
14
14
  end
15
-
15
+
16
16
  desc "Parses Unicorn control script file and uploads it to server"
17
17
  task :script do
18
18
  upload_shared_file("unicorn_init.sh")
19
19
  end
20
20
  end
21
-
21
+
22
22
  desc "Unicron: startup"
23
23
  task :defaults do
24
24
  invoke :sudo
25
- command echo_cmd "sudo update-rc.d unicorn-#{app!} defaults"
25
+ command echo_cmd "sudo update-rc.d unicorn-#{fetch(:app)} defaults"
26
26
  end
27
-
27
+
28
28
  namespace :god do
29
29
  task :upload do
30
30
  upload_shared_file("unicorn.god")
31
31
  end
32
-
32
+
33
33
  task :link do
34
34
  invoke :sudo
35
- command echo_cmd %{sudo cp -rf #{deploy_to}/#{shared_path}/unicorn.god #{god_path}/conf/unicorn-#{app!}.god}
35
+ command echo_cmd %{sudo cp -rf #{deploy_to}/#{shared_path}/unicorn.god #{god_path}/conf/unicorn-#{fetch(:app)}.god}
36
36
  invoke :"god:restart"
37
37
  end
38
-
38
+
39
39
  task :start do
40
40
  invoke :sudo
41
- command echo_cmd %{sudo god start unicorn_#{app!}}
41
+ command echo_cmd %{sudo god start unicorn_#{fetch(:app)}}
42
42
  end
43
-
43
+
44
44
  task :stop do
45
45
  invoke :sudo
46
- command echo_cmd %{sudo god stop unicorn_#{app!}}
47
- end
46
+ command echo_cmd %{sudo god stop unicorn_#{fetch(:app)}}
47
+ end
48
48
  end
49
-
49
+
50
50
  task :log do
51
- command %{tail -f "#{deploy_to!}/#{shared_path}/log/unicorn.log" -n 200}
51
+ command %{tail -f "#{deploy_to!}/#{shared_path}/log/unicorn.log" -n 200}
52
52
  end
53
-
53
+
54
54
  task :err_log do
55
- command %{tail -f "#{deploy_to!}/#{shared_path}/log/unicorn.error.log" -n 200}
55
+ command %{tail -f "#{deploy_to!}/#{shared_path}/log/unicorn.error.log" -n 200}
56
56
  end
57
57
 
58
58
  desc "Unicorn: Link script files"
59
59
  task :link do
60
60
  invoke :sudo
61
61
  extra_echo("Unicorn: Link script file")
62
- command echo_cmd %{sudo cp '#{deploy_to}/shared/unicorn_init.sh' '/etc/init.d/unicorn-#{app!}'}
63
- command echo_cmd %{sudo chown #{user!}:#{group!} /etc/init.d/unicorn-#{app!}}
64
- command echo_cmd %{sudo chmod u+x /etc/init.d/unicorn-#{app!}}
62
+ command echo_cmd %{sudo cp '#{deploy_to}/shared/unicorn_init.sh' '/etc/init.d/unicorn-#{fetch(:app)}'}
63
+ command echo_cmd %{sudo chown #{user!}:#{group!} /etc/init.d/unicorn-#{fetch(:app)}}
64
+ command echo_cmd %{sudo chmod u+x /etc/init.d/unicorn-#{fetch(:app)}}
65
65
  # invoke :"unicorn:defaults"
66
66
  end
67
67
 
68
68
  desc "Start unicorn"
69
69
  task :start do
70
70
  extra_echo("Unicorn: Start")
71
- command echo_cmd "/etc/init.d/unicorn-#{app!} start"
71
+ command echo_cmd "/etc/init.d/unicorn-#{fetch(:app)} start"
72
72
  end
73
73
 
74
74
  desc "Stop unicorn"
75
75
  task :stop do
76
76
  extra_echo("Unicorn: Stop")
77
- command echo_cmd "/etc/init.d/unicorn-#{app!} stop"
77
+ command echo_cmd "/etc/init.d/unicorn-#{fetch(:app)} stop"
78
78
  end
79
79
 
80
80
  desc "Restart unicorn using 'upgrade'"
81
81
  task :restart do
82
82
  extra_echo("Unicorn: Restart")
83
- command echo_cmd "/etc/init.d/unicorn-#{app!} upgrade"
83
+ command echo_cmd "/etc/init.d/unicorn-#{fetch(:app)} upgrade"
84
84
  end
85
85
 
86
86
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Extras
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-rails-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Lin