mina-stack 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 470020d1489487d0f24517e70f74ec54a3bc50bf
4
- data.tar.gz: ce29d2ba7bf8a14a7d91bd4c1c82337ea0aea228
3
+ metadata.gz: 9ffe5afb2ea9a6b8add5e16e8efe59589a17fe48
4
+ data.tar.gz: 4ff7368f353dc9be2488e038b713f666048e3c98
5
5
  SHA512:
6
- metadata.gz: 52b87909371f4d6feca79de9e4b1b713c4d0bb31fa694e0ab87e7fe929ec4497f19b1b4b69160f6fb9a39a6fb9a5ef0cd36a5e0d2a4135214694935d2807f55d
7
- data.tar.gz: 8215ad6d31ef47095adacd21d14af8ada31d183fc0303497d45b5cf8f65d9be0cb2e626ceb826be55038cadc02cb8c8f9a0ccc8ef05cfb27128213675429ae52
6
+ metadata.gz: 646a3e81b29767376a71242efe4307a62f3f325295e8598796c08d2058a0fc0fb34eecb9b0f4e0be88c0fefeb79d4f573014a9cdb63924ac34971a5b927307ed
7
+ data.tar.gz: a470d8c214c8e5ecb002d6f54235824751616a348d25d818be8f4e3f8d06c9ad552eb5572304a1422b3de46e10783884b19dd485dba950e0b76290eb4ceacc6e
@@ -65,7 +65,11 @@ task :defaults do
65
65
  set_default :private_pub_pid, "#{pids_path}/private_pub.pid"
66
66
  set_default :private_pub_config, "#{config_path}/private_pub.yml"
67
67
  set_default :private_pub_log, "#{logs_path}/private_pub.log"
68
- set_default :private_pub_server, "puma"
68
+
69
+ set_default :rpush_name, "rpush_#{app_namespace!}"
70
+ set_default :rpush_cmd, lambda { "#{bundle} exec rpush" }
71
+ set_default :rpush_upstart, "#{upstart_path!}/#{rpush_name}.conf"
72
+ set_default :rpush_start, "#{rpush_cmd} start -e #{rails_env}"
69
73
 
70
74
  set_default :monit_config_path, "/etc/monit/conf.d"
71
75
  set_default :monit_http_port, 2812
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Stack
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
@@ -0,0 +1,22 @@
1
+ namespace :rpush do
2
+
3
+ task(:install) { }
4
+
5
+ desc "Setup Puma configuration"
6
+ task :setup => [:upload]
7
+
8
+ desc "Create configuration and other files"
9
+ task :upload do
10
+ invoke :sudo
11
+ template "upstart/rpush.conf.erb", "/tmp/rpush_conf"
12
+ queue "sudo mv /tmp/rpush_conf #{rpush_upstart}"
13
+ end
14
+
15
+ %w[start stop restart reload].each do |command|
16
+ desc "#{command.capitalize} rpush"
17
+ task command do
18
+ queue "sudo #{command} #{rpush_name}"
19
+ queue %[echo "-----> #{command.capitalize} rpush."]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,43 @@
1
+ description "Rpush Worker"
2
+
3
+ start on runlevel [2345] and started networking
4
+ stop on runlevel [!2345] or stopped networking
5
+
6
+ setuid <%= user %>
7
+ setgid <%= user %>
8
+
9
+ respawn
10
+ respawn limit 3 30
11
+
12
+ expect daemon
13
+
14
+ script
15
+ # this script runs in /bin/sh by default
16
+ # respawn as bash so we can source in rbenv
17
+ exec /bin/bash <<'EOT'
18
+ # set HOME to the setuid user's home, there doesn't seem to be a better, portable way
19
+ export HOME="$(eval echo ~$(id -un))"
20
+
21
+ if [ -d "$HOME/.rbenv/bin" ]; then
22
+ export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
23
+ elif [ -f /etc/profile.d/rvm.sh ]; then
24
+ source /etc/profile.d/rvm.sh
25
+ elif [ -f /usr/local/rvm/scripts/rvm ]; then
26
+ source /etc/profile.d/rvm.sh
27
+ elif [ -f "$HOME/.rvm/scripts/rvm" ]; then
28
+ source "$HOME/.rvm/scripts/rvm"
29
+ elif [ -f /usr/local/share/chruby/chruby.sh ]; then
30
+ source /usr/local/share/chruby/chruby.sh
31
+ if [ -f /usr/local/share/chruby/auto.sh ]; then
32
+ source /usr/local/share/chruby/auto.sh
33
+ fi
34
+ # if you aren't using auto, set your version here
35
+ # chruby 2.0.0
36
+ fi
37
+
38
+ # Logs out to /var/log/upstart/sidekiq.log by default
39
+
40
+ cd <%= "#{deploy_to!}/#{current_path!}" %>
41
+ exec <%= rpush_start %>
42
+ EOT
43
+ end script
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Davydov
@@ -100,6 +100,7 @@ files:
100
100
  - lib/recipes/rails.rb
101
101
  - lib/recipes/rbenv.rb
102
102
  - lib/recipes/redis.rb
103
+ - lib/recipes/rpush.rb
103
104
  - lib/recipes/sidekiq.rb
104
105
  - lib/recipes/unicorn.rb
105
106
  - lib/templates/application.yml.erb
@@ -121,6 +122,7 @@ files:
121
122
  - lib/templates/unicorn.rb.erb
122
123
  - lib/templates/unicorn_init.erb
123
124
  - lib/templates/upstart/puma.conf.erb
125
+ - lib/templates/upstart/rpush.conf.erb
124
126
  - lib/templates/upstart/sidekiq.conf.erb
125
127
  - mina-stack.gemspec
126
128
  - mina-stack.rb