Skip to content

Commit 4bde001

Browse files
jhassdenschub
authored andcommitted
replace foreman with eye
closes diaspora#5966
1 parent a21de8b commit 4bde001

File tree

7 files changed

+83
-14
lines changed

7 files changed

+83
-14
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Do not retry a couple of unrecoverable job failures [#5938](https://github.com/diaspora/diaspora/pull/5938) [#5942](https://github.com/diaspora/diaspora/pull/5943)
1010
* Remove some old temporary workarounds [#5964](https://github.com/diaspora/diaspora/pull/5964)
1111
* Remove unused `hasPhotos` and `hasText` functions [#5969](https://github.com/diaspora/diaspora/pull/5969)
12+
* Replace foreman with eye [#5966](https://github.com/diaspora/diaspora/pull/5966)
1213

1314
## Bug fixes
1415
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ group :production do # we don"t install these on travis to speed up test runs
203203

204204
# Process management
205205

206-
gem "foreman", "0.62"
206+
gem "eye", "0.7.pre"
207207

208208
# Redirects
209209

Gemfile.lock

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ GEM
8888
mime-types (>= 1.16)
8989
celluloid (0.16.0)
9090
timers (~> 4.0.0)
91+
celluloid-io (0.16.2)
92+
celluloid (>= 0.16.0)
93+
nio4r (>= 1.1.0)
9194
childprocess (0.5.6)
9295
ffi (~> 1.0, >= 1.0.11)
9396
chunky_png (1.3.4)
@@ -173,6 +176,12 @@ GEM
173176
eventmachine (1.0.7)
174177
excon (0.45.3)
175178
execjs (2.5.2)
179+
eye (0.7.pre)
180+
celluloid (~> 0.16.0)
181+
celluloid-io (~> 0.16.0)
182+
sigar (~> 0.7.2)
183+
state_machine
184+
thor
176185
factory_girl (4.5.0)
177186
activesupport (>= 3.0.0)
178187
factory_girl_rails (4.5.0)
@@ -287,8 +296,6 @@ GEM
287296
nokogiri (~> 1.5, >= 1.5.11)
288297
font-awesome-rails (4.3.0.0)
289298
railties (>= 3.2, < 5.0)
290-
foreman (0.62.0)
291-
thor (>= 0.13.6)
292299
formatador (0.2.5)
293300
fuubar (2.0.0)
294301
rspec (~> 3.0)
@@ -411,6 +418,7 @@ GEM
411418
net-scp (1.2.1)
412419
net-ssh (>= 2.6.5)
413420
net-ssh (2.9.2)
421+
nio4r (1.1.0)
414422
nokogiri (1.6.6.2)
415423
mini_portile (~> 0.6.0)
416424
notiffany (0.0.6)
@@ -636,6 +644,7 @@ GEM
636644
celluloid (>= 0.14.1)
637645
ice_cube (= 0.11.1)
638646
sidekiq (>= 3.0.0)
647+
sigar (0.7.3)
639648
simple_captcha2 (0.3.4)
640649
rails (>= 4.1)
641650
simple_oauth (0.2.0)
@@ -660,6 +669,7 @@ GEM
660669
actionpack (>= 3.0)
661670
activesupport (>= 3.0)
662671
sprockets (>= 2.8, < 4.0)
672+
state_machine (1.2.0)
663673
systemu (2.6.5)
664674
test_after_commit (0.4.1)
665675
activerecord (>= 3.2)
@@ -729,13 +739,13 @@ DEPENDENCIES
729739
devise_lastseenable (= 0.0.4)
730740
diaspora-vines (~> 0.1.27)
731741
entypo-rails (= 2.2.3)
742+
eye (= 0.7.pre)
732743
factory_girl_rails (= 4.5.0)
733744
faraday (= 0.9.1)
734745
faraday-cookie_jar (= 0.0.6)
735746
faraday_middleware (= 0.9.1)
736747
fixture_builder (= 0.3.6)
737748
fog (= 1.30.0)
738-
foreman (= 0.62)
739749
fuubar (= 2.0.0)
740750
gon (= 5.2.3)
741751
guard (= 2.12.5)

Procfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
web: bin/bundle exec unicorn_rails -c config/unicorn.rb -p $PORT
1+
web: bin/bundle exec unicorn -c config/unicorn.rb -p $PORT
22
sidekiq: bin/bundle exec sidekiq
3-
xmpp: bin/bundle exec vines start

bin/eye

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env ruby
2+
#
3+
# This file was generated by Bundler.
4+
#
5+
# The application 'eye' is installed as part of a gem, and
6+
# this file is here to facilitate running it.
7+
#
8+
9+
require 'pathname'
10+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11+
Pathname.new(__FILE__).realpath)
12+
13+
require 'rubygems'
14+
require 'bundler/setup'
15+
16+
load Gem.bin_path('eye', 'eye')

config/eye.rb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
require_relative "load_config"
2+
rails_env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
3+
4+
Eye.config do
5+
logger Logger.new(STDOUT)
6+
end
7+
8+
Eye.application("diaspora") do
9+
working_dir Rails.root.to_s
10+
env "DB" => ENV["DB"], "RAILS_ENV" => rails_env
11+
stdall "log/eye_processes.log"
12+
13+
process :web do
14+
start_command "bin/bundle exec unicorn -c config/unicorn.rb"
15+
daemonize true
16+
pid_file "tmp/pids/web.pid"
17+
stop_signals [:TERM, 10.seconds]
18+
env "PORT" => ENV["PORT"]
19+
20+
monitor_children do
21+
stop_command "kill -QUIT {PID}"
22+
end
23+
end
24+
25+
group :sidekiq do
26+
with_condition(!AppConfig.environment.single_process_mode?) do
27+
AppConfig.server.sidekiq_workers.to_i.times do |i|
28+
i += 1
29+
30+
process "sidekiq#{i}" do
31+
start_command "bin/bundle exec sidekiq"
32+
daemonize true
33+
pid_file "tmp/pids/sidekiq#{i}.pid"
34+
stop_signals [:USR1, 0, :TERM, 10.seconds, :KILL]
35+
end
36+
end
37+
end
38+
end
39+
40+
with_condition(AppConfig.chat.enabled? && AppConfig.chat.server.enabled?) do
41+
process :xmpp do
42+
start_command "bin/bundle exec vines start"
43+
daemonize true
44+
pid_file "tmp/pids/xmpp.pid"
45+
stop_signals [:TERM, 10.seconds, :KILL]
46+
end
47+
end
48+
end

script/server

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,9 @@ https://github.com/diaspora/diaspora/issues/4202 for details
182182
"
183183
fi
184184

185-
vines=0
186-
if [ "$chat" = "true" ] && [ "$chat_server" = "true" ]
185+
if [ "$chat" = "true" -a "$chat_server" = "true" -a "$chat_bosh_proxy" = "false" ]
187186
then
188-
vines=1
189-
if [ "$chat_bosh_proxy" = "false" ]
190-
then
191-
warning "
187+
warning "
192188
*****************************************************************
193189
You enabled the chat feature but haven't configured BOSH! That
194190
could lead to mixed-content problems with the http clients. Please
@@ -204,7 +200,6 @@ printf "Starting Diaspora in $RAILS_ENV mode "
204200
if [ -n "$PORT" ]
205201
then
206202
printf "on port $PORT "
207-
port_option="-p $PORT"
208203
fi
209204
if [ "$embed_sidekiq_worker" = "true" ]
210205
then
@@ -219,4 +214,4 @@ else
219214
fi
220215
echo ""
221216

222-
exec bin/bundle exec foreman start -m "xmpp=$vines,web=1,sidekiq=$workers" $port_option
217+
exec bin/bundle exec loader_eye -st -c config/eye.rb

0 commit comments

Comments
 (0)