Commit d52f06f38013540a9798686aa37c4dad120c3d74

Authored by Dmitriy Zaporozhets
1 parent 22d0569d

Remove gitlab-cli and Proc.prod. Use foreman for development and unicorn for production.

Procfile.production
... ... @@ -1,2 +0,0 @@
1   -web: bundle exec rails s -p $PORT -e production
2   -worker: bundle exec rake environment resque:work RAILS_ENV=production QUEUE=*
doc/development.md
... ... @@ -8,9 +8,9 @@ Install the Gitlab development in a virtual machine with the [Gitlab Vagrant vir
8 8  
9 9 ### Start application in development mode
10 10  
11   -#### 1. Via gitlab cli
  11 +#### 1. Via foreman
12 12  
13   - ./gitlab start
  13 + bundle exec foreman start -p 3000
14 14  
15 15 #### 2. Manually
16 16  
... ...
... ... @@ -1,75 +0,0 @@
1   -#!/usr/bin/env ruby
2   -
3   -class GitlabCli
4   - def initialize
5   - @path = File.dirname(__FILE__)
6   - @command = ARGV.shift
7   - @mode = ARGV.shift
8   - end
9   -
10   - def execute
11   - case @command
12   - when 'start' then start
13   - when 'stop' then stop
14   - else
15   - puts "-- Usage gitlab start production or gitlab stop development"
16   - end
17   - end
18   -
19   - private
20   -
21   - def start
22   - case @mode
23   - when 'production';
24   - system(unicorn_start_cmd)
25   - system(resque_start_cmd)
26   - else
27   - system(rails_start_cmd)
28   - system(resque_dev_start_cmd)
29   - end
30   - end
31   -
32   - def stop
33   - case @mode
34   - when 'production';
35   - system(unicorn_stop_cmd)
36   - else
37   - system(rails_stop_cmd)
38   - end
39   - system(resque_stop_cmd)
40   - end
41   -
42   - def rails_start_cmd
43   - "bundle exec rails s -d"
44   - end
45   -
46   - def rails_stop_cmd
47   - pid = File.join(@path, "tmp/pids/server.pid")
48   - "kill -QUIT `cat #{pid}`"
49   - end
50   -
51   - def unicorn_start_cmd
52   - unicorn_conf = File.join(@path, "config/unicorn.rb")
53   - "bundle exec unicorn_rails -c #{unicorn_conf} -E production -D"
54   - end
55   -
56   - def unicorn_stop_cmd
57   - pid = File.join(@path, "/tmp/pids/unicorn.pid")
58   - "kill -QUIT `cat #{pid}`"
59   - end
60   -
61   - def resque_dev_start_cmd
62   - "./resque_dev.sh > /dev/null 2>&1"
63   - end
64   -
65   - def resque_start_cmd
66   - "./resque.sh > /dev/null 2>&1"
67   - end
68   -
69   - def resque_stop_cmd
70   - pid = File.join(@path, "tmp/pids/resque_worker.pid")
71   - "kill -QUIT `cat #{pid}`"
72   - end
73   -end
74   -
75   -GitlabCli.new.execute