mina-stack 0.0.22 → 0.0.23
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 +5 -5
- data/lib/mina-stack/defaults.rb +7 -0
- data/lib/mina-stack/version.rb +1 -1
- data/lib/recipes/phobos.rb +22 -0
- data/lib/recipes/rbenv.rb +1 -1
- data/lib/templates/upstart/phobos.conf.erb +42 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d37e329410229e820883a82971f69c8e620340da27176f631276bc179c3c028c
|
4
|
+
data.tar.gz: c37d20722c6b1a28f93b77d0a954f18b608e55280c337dc6dd7c5b8928ac439a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe858a42f6ab696c479ec53e659271dcab71175bf24c05c7057da9d026f7866003d864ee8d01b7a321e3b81c828eb8eeae9271eff3a78bddf3341a3f0394467a
|
7
|
+
data.tar.gz: '09e50ee09f40ff1db1e3c4074129bf74d14fea3542991e86a22520cd40368c669ec2d32b2df9e17d11109df26df600882e90e2580d9088d5bb4183f076533a59'
|
data/lib/mina-stack/defaults.rb
CHANGED
@@ -71,6 +71,13 @@ task :defaults do
|
|
71
71
|
set_default :rpush_upstart, "#{upstart_path!}/#{rpush_name}.conf"
|
72
72
|
set_default :rpush_start, "#{rpush_cmd} start -f -e #{rails_env}"
|
73
73
|
|
74
|
+
set_default :phobos_name, "phobos_#{app_namespace!}"
|
75
|
+
set_default :phobos_cmd, lambda { "#{bundle_bin} exec phobos" }
|
76
|
+
set_default :phobos_upstart, "#{upstart_path!}/#{phobos_name}.conf"
|
77
|
+
set_default :phobos_boot_file, "config/phobos_boot.rb"
|
78
|
+
set_default :phobos_config_file, "config/phobos.yml"
|
79
|
+
set_default :phobos_start, "#{phobos_cmd} start -b #{phobos_boot_file} -c #{phobos_config_file}"
|
80
|
+
|
74
81
|
set_default :monit_config_path, "/etc/monit/conf.d"
|
75
82
|
set_default :monit_http_port, 2812
|
76
83
|
set_default :monit_http_username, "PleaseChangeMe_monit"
|
data/lib/mina-stack/version.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
namespace :phobos do
|
2
|
+
|
3
|
+
task(:install) { }
|
4
|
+
|
5
|
+
desc "Setup Phobos configuration"
|
6
|
+
task :setup => [:upload]
|
7
|
+
|
8
|
+
desc "Create configuration and other files"
|
9
|
+
task :upload do
|
10
|
+
invoke :sudo
|
11
|
+
template "upstart/phobos.conf.erb", "/tmp/phobos_conf"
|
12
|
+
queue "sudo mv /tmp/phobos_conf #{phobos_upstart}"
|
13
|
+
end
|
14
|
+
|
15
|
+
%w[start stop restart reload].each do |command|
|
16
|
+
desc "#{command.capitalize} phobos"
|
17
|
+
task command do
|
18
|
+
queue "sudo #{command} #{phobos_name}"
|
19
|
+
queue %[echo "-----> #{command.capitalize} phobos."]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/recipes/rbenv.rb
CHANGED
@@ -5,7 +5,7 @@ namespace :rbenv do
|
|
5
5
|
invoke :sudo
|
6
6
|
queue %{echo "-----> Installing Ruby"}
|
7
7
|
queue "sudo apt-get -y install curl git-core"
|
8
|
-
queue "curl -
|
8
|
+
queue "curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash"
|
9
9
|
bashrc = <<-BASHRC
|
10
10
|
if [ -d $HOME/.rbenv ]; then
|
11
11
|
export PATH="$HOME/.rbenv/bin:$PATH"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
description "Phobos Process"
|
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
|
+
script
|
13
|
+
# this script runs in /bin/sh by default
|
14
|
+
# respawn as bash so we can source in rbenv
|
15
|
+
exec /bin/bash <<'EOT'
|
16
|
+
# set HOME to the setuid user's home, there doesn't seem to be a better, portable way
|
17
|
+
export HOME="$(eval echo ~$(id -un))"
|
18
|
+
|
19
|
+
if [ -d "$HOME/.rbenv/bin" ]; then
|
20
|
+
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
21
|
+
elif [ -f /etc/profile.d/rvm.sh ]; then
|
22
|
+
source /etc/profile.d/rvm.sh
|
23
|
+
elif [ -f /usr/local/rvm/scripts/rvm ]; then
|
24
|
+
source /etc/profile.d/rvm.sh
|
25
|
+
elif [ -f "$HOME/.rvm/scripts/rvm" ]; then
|
26
|
+
source "$HOME/.rvm/scripts/rvm"
|
27
|
+
elif [ -f /usr/local/share/chruby/chruby.sh ]; then
|
28
|
+
source /usr/local/share/chruby/chruby.sh
|
29
|
+
if [ -f /usr/local/share/chruby/auto.sh ]; then
|
30
|
+
source /usr/local/share/chruby/auto.sh
|
31
|
+
fi
|
32
|
+
# if you aren't using auto, set your version here
|
33
|
+
# chruby 2.0.0
|
34
|
+
fi
|
35
|
+
|
36
|
+
# Logs out to /var/log/upstart/<%= phobos_name %>.log by default
|
37
|
+
|
38
|
+
export RAILS_ENV=<%= rails_env %>
|
39
|
+
cd <%= "#{deploy_to!}/#{current_path!}" %>
|
40
|
+
exec <%= phobos_start %>
|
41
|
+
EOT
|
42
|
+
end script
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Davydov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/recipes/monit.rb
|
96
96
|
- lib/recipes/nginx.rb
|
97
97
|
- lib/recipes/node.rb
|
98
|
+
- lib/recipes/phobos.rb
|
98
99
|
- lib/recipes/postgresql.rb
|
99
100
|
- lib/recipes/private_pub.rb
|
100
101
|
- lib/recipes/puma.rb
|
@@ -122,6 +123,7 @@ files:
|
|
122
123
|
- lib/templates/sidekiq.yml.erb
|
123
124
|
- lib/templates/unicorn.rb.erb
|
124
125
|
- lib/templates/unicorn_init.erb
|
126
|
+
- lib/templates/upstart/phobos.conf.erb
|
125
127
|
- lib/templates/upstart/puma.conf.erb
|
126
128
|
- lib/templates/upstart/rpush.conf.erb
|
127
129
|
- lib/templates/upstart/sidekiq.conf.erb
|
@@ -146,8 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
148
|
- !ruby/object:Gem::Version
|
147
149
|
version: '0'
|
148
150
|
requirements: []
|
149
|
-
|
150
|
-
rubygems_version: 2.5.1
|
151
|
+
rubygems_version: 3.0.1
|
151
152
|
signing_key:
|
152
153
|
specification_version: 4
|
153
154
|
summary: Mina + stack
|