mina-extras 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mina-extras/auto-repository.rb +1 -1
- data/lib/mina-extras/git.rb +1 -1
- data/lib/mina-extras/puma.rb +10 -12
- data/lib/mina-extras/rvm.rb +2 -2
- data/lib/mina-extras/unicorn.rb +14 -19
- data/lib/mina-extras/whenever.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3c534503b80e236a0194f9de6441875fa1a6151
|
4
|
+
data.tar.gz: 352858159ab06ff9850686002eb75acddfdab94d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388899fd2a3d3ddc4a96b1df88bae8847698626ecceaa443fd5960ed135298cb02d6b640f555e7a08c1e288de7955a678077371f071c5231dfbb581413a480ef
|
7
|
+
data.tar.gz: 2527d59396f6ba6c21eabdcba9e98a28de66fcbec4907349e4c4c7050824690dc7dbbc5734302011a7f82d65517fae302b6803d0926c0e933b4c240973ab3ff3
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
set_default :repository, %x[git config --get remote.origin.url].strip
|
data/lib/mina-extras/git.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
set_default :current_git_branch, %x[git rev-parse --abbrev-ref HEAD].strip
|
data/lib/mina-extras/puma.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
set :puma_stop_cmd, "bundle exec pumactl -S #{puma_sock_dir}/puma.state stop"
|
8
|
-
set :puma_restart_cmd, "bundle exec pumactl -S #{puma_sock_dir}/puma.state phased-restart"
|
9
|
-
end
|
1
|
+
set_default :puma_cmd_prefix, lambda { "cd #{deploy_to}/#{current_path} ; RAILS_ENV=#{rails_env!}" }
|
2
|
+
set_default :puma_pid_path, lambda { "#{deploy_to}/#{shared_path}/pids/puma.pid" }
|
3
|
+
set_default :puma_sock_dir, lambda { "#{deploy_to}/#{shared_path}/sockets" }
|
4
|
+
set_default :puma_start_cmd, lambda { "bundle exec puma -C #{File.join(deploy_to,current_path,'config','puma.rb')}" }
|
5
|
+
set_default :puma_stop_cmd, lambda { "bundle exec pumactl -S #{puma_sock_dir}/puma.state stop" }
|
6
|
+
set_default :puma_restart_cmd, lambda { "bundle exec pumactl -S #{puma_sock_dir}/puma.state phased-restart" }
|
10
7
|
|
8
|
+
namespace :puma do
|
11
9
|
desc 'Start puma'
|
12
|
-
task :start => [:
|
10
|
+
task :start => [:environment] do
|
13
11
|
queue %{
|
14
12
|
echo "-----> Starting puma"
|
15
13
|
#{echo_cmd "#{puma_cmd_prefix} #{puma_start_cmd}"}
|
@@ -17,7 +15,7 @@ namespace :puma do
|
|
17
15
|
end
|
18
16
|
|
19
17
|
desc 'Stop puma'
|
20
|
-
task :stop => [:
|
18
|
+
task :stop => [:environment] do
|
21
19
|
queue %{
|
22
20
|
echo "-----> Stopping puma"
|
23
21
|
#{echo_cmd "#{puma_cmd_prefix} #{puma_stop_cmd}"}
|
@@ -25,7 +23,7 @@ namespace :puma do
|
|
25
23
|
end
|
26
24
|
|
27
25
|
desc 'Restart puma'
|
28
|
-
task :restart => [:
|
26
|
+
task :restart => [:environment] do
|
29
27
|
queue %{
|
30
28
|
PUMA_PID=$(cat "#{puma_pid_path}")
|
31
29
|
kill -0 $PUMA_PID > /dev/null 2>&1
|
data/lib/mina-extras/rvm.rb
CHANGED
@@ -6,8 +6,8 @@ if File.exist?("#{app_root}/.ruby-gemset")
|
|
6
6
|
else
|
7
7
|
version, gemset = version.split("@")
|
8
8
|
end
|
9
|
-
|
10
|
-
|
9
|
+
set_default :current_ruby, version
|
10
|
+
set_default :current_gemset, gemset
|
11
11
|
|
12
12
|
task :'rvm:use:current' do
|
13
13
|
invoke :"rvm:use[#{current_ruby!}@#{current_gemset!}]"
|
data/lib/mina-extras/unicorn.rb
CHANGED
@@ -1,19 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
set :unicorn_start_cmd, "#{cmd_prefix} unicorn -c #{config_file_path} -D -E production"
|
10
|
-
set :unicorn_stop_cmd, "kill -s QUIT `cat #{pid_file}`"
|
11
|
-
set :unicorn_terminate_cmd, "kill -s TERM `cat #{pid_file}`"
|
12
|
-
set :unicorn_setup_cmd, "mkdir -p #{pid_path}"
|
13
|
-
end
|
1
|
+
config_file_path = "#{File.join(deploy_to,current_path,'config','unicorn.rb')}"
|
2
|
+
pid_path = "#{File.join(deploy_to,current_path,'tmp','pids')}"
|
3
|
+
pid_file = "#{File.join(pid_path,'unicorn.pid')}"
|
4
|
+
|
5
|
+
set_default :unicorn_start_cmd, lambda { "cd #{deploy_to}/#{current_path} ; RAILS_ENV=#{rails_env!} bundle exec unicorn -c #{config_file_path} -D -E production" }
|
6
|
+
set_default :unicorn_stop_cmd, lambda { "kill -s QUIT `cat #{pid_file}`" }
|
7
|
+
set_default :unicorn_terminate_cmd, lambda { "kill -s TERM `cat #{pid_file}`" }
|
8
|
+
set_default :unicorn_setup_cmd, lambda { "mkdir -p #{pid_path}" }
|
14
9
|
|
10
|
+
namespace :unicorn do
|
15
11
|
desc 'Start Unicorn'
|
16
|
-
task :start => [:
|
12
|
+
task :start => [:environment] do
|
17
13
|
queue %{
|
18
14
|
echo "------> Starting Unicorn"
|
19
15
|
#{echo_cmd unicorn_start_cmd}
|
@@ -21,7 +17,7 @@ namespace :unicorn do
|
|
21
17
|
end
|
22
18
|
|
23
19
|
desc 'Stop Unicorn'
|
24
|
-
task :stop => [:
|
20
|
+
task :stop => [:environment] do
|
25
21
|
queue %{
|
26
22
|
echo "------> Stopping Unicorn"
|
27
23
|
#{echo_cmd unicorn_stop_cmd}
|
@@ -29,7 +25,7 @@ namespace :unicorn do
|
|
29
25
|
end
|
30
26
|
|
31
27
|
desc 'Stop Unicorn'
|
32
|
-
task 'force-stop' => [:
|
28
|
+
task 'force-stop' => [:environment] do
|
33
29
|
queue %{
|
34
30
|
echo "------> Force stopping Unicorn"
|
35
31
|
#{echo_cmd unicorn_terminate_cmd}
|
@@ -37,7 +33,7 @@ namespace :unicorn do
|
|
37
33
|
end
|
38
34
|
|
39
35
|
desc 'Restart Unicorn'
|
40
|
-
task :restart => [:
|
36
|
+
task :restart => [:environment] do
|
41
37
|
queue %{
|
42
38
|
echo "------> Stopping Unicorn"
|
43
39
|
#{echo_cmd unicorn_stop_cmd}
|
@@ -47,11 +43,10 @@ namespace :unicorn do
|
|
47
43
|
end
|
48
44
|
|
49
45
|
desc 'Setup paths'
|
50
|
-
task :setup => [:
|
46
|
+
task :setup => [:environment] do
|
51
47
|
queue %{
|
52
48
|
echo "------> creating pid folder"
|
53
49
|
#{echo_cmd unicorn_setup_cmd}
|
54
50
|
}
|
55
51
|
end
|
56
|
-
|
57
52
|
end
|
data/lib/mina-extras/whenever.rb
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
# Add in "to :launch do"
|
4
4
|
# invoke :'whenever:update_crontab'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
set_default :whenever_environment, lambda { rails_env! }
|
7
|
+
set_default :whenever_variables, lambda { "environment=#{whenever_environment!}" }
|
8
|
+
set_default :whenever_command, "bundle exec whenever"
|
9
|
+
set_default :whenever_update_flags, lambda { "--update-crontab #{whenever_identifier!} --set #{whenever_variables!}" }
|
10
|
+
set_default :whenever_clear_flags, lambda { "--clear-crontab #{whenever_identifier!}" }
|
11
11
|
|
12
12
|
namespace :whenever do
|
13
13
|
desc "Update application's crontab entries using Whenever"
|