negroku 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ec2569b3276084c2c0ec1cc56d347beb091289a
4
- data.tar.gz: 3fe05dae4150ad499a1c8dd55faf17e94fade952
3
+ metadata.gz: 99af355d40735ca8a089b636261ef2992e22677d
4
+ data.tar.gz: 47af8644d84832835cab04bfdeb01d48b7b9ff7e
5
5
  SHA512:
6
- metadata.gz: 6981e2a803ac70a429ca70970a0411fa45d6905995afd89b356d743c422bd147bbec01ab666bd24205871806356939c00a508ff32701cdee0c67de28155e6830
7
- data.tar.gz: b98501e5f48db42cc580b851c8088f7f87a9dbc2235178f48760549910e3e83e1bbac3da36a1df6c747d0d9742882ac781fb86330be8c95e0ccd4384d1c594d3
6
+ metadata.gz: f2691bc32d17ee2f5889fdb63ee202bbcfa52890ad51e1c1b514941661bf6eae5726e77ad61180703612537d54ddd670a6d754c8c44fa6eb9b9c2521cd086093
7
+ data.tar.gz: 936d0a0d561758117b4c853ed34f819c4a889d55ba7f48d4dfe74e891bcfda02b3feb97184723f92a457d6f2e37e1d83d65e9f21d9d3339b3bbbfee5980915aa
@@ -31,5 +31,7 @@ load_task "rails" if required? 'capistrano/rails'
31
31
  load_task "nginx" if required? 'capistrano/nginx'
32
32
  load_task "unicorn" if required? 'capistrano3/unicorn'
33
33
  load_task "delayed_job" if required? 'capistrano/delayed-job'
34
+ load_task "github" if required? 'capistrano/github'
34
35
  load_task "whenever" if required? 'whenever/capistrano'
36
+ load_task "thinking_sphinx" if required? 'thinking_sphinx/capistrano'
35
37
  load_task "log"
@@ -0,0 +1 @@
1
+ load_task 'eye/thinking_sphinx', ['thinking_sphinx/capistrano']
@@ -0,0 +1,27 @@
1
+ #########
2
+ ## Adds support to monitor sphinx processes through eye
3
+ #########
4
+
5
+ # Watch the sphinx processes using the build in template
6
+ namespace :eye do
7
+ task :watch_process do
8
+
9
+ watch_process(:sphinx);
10
+
11
+ end
12
+ end
13
+
14
+ # Override start, restart and stop sphinx tasks to so they call
15
+ # the eye equivalents
16
+ namespace :thinking_sphinx do
17
+ ['start','restart','stop'].each do |cmd|
18
+ if Rake::Task.task_defined?("thinking_sphinx:#{cmd}")
19
+ Rake::Task["thinking_sphinx:#{cmd}"].clear_actions
20
+ # Reload or restart after the application is published
21
+ desc "using eye"
22
+ task cmd do
23
+ invoke "eye:#{cmd}", 'thinking_sphinx'
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,25 @@
1
+ ## github.rb
2
+ #
3
+ # Adds capistrano/github specific variables and tasks
4
+
5
+ namespace :load do
6
+ task :defaults do
7
+
8
+ set :github_access_token, ENV['GITHUB_API_TOKEN']
9
+
10
+ end
11
+ end
12
+
13
+ namespace :negroku do
14
+
15
+ namespace :gihub do
16
+
17
+ before 'deploy:starting', 'github:deployment:create'
18
+ after 'deploy:starting', 'github:deployment:pending'
19
+ after 'deploy:finished', 'github:deployment:success'
20
+ after 'deploy:failed', 'github:deployment:failure'
21
+
22
+ end
23
+
24
+ end
25
+
@@ -0,0 +1,99 @@
1
+ ## thinkinx_sphinx.rb
2
+ #
3
+ # Adds thinking sphinx specific variables and tasks
4
+
5
+ namespace :load do
6
+ task :defaults do
7
+
8
+ set :thinking_sphinx_roles, :app
9
+
10
+ # Local path to look for custom config template
11
+ set :thinking_sphinx_template, -> { "config/#{fetch(:stage)}/thinking_sphinx.yml.erb" }
12
+
13
+ # Link thinking_sphinx.yml file
14
+ set :linked_files, fetch(:linked_files, []) << 'config/thinking_sphinx.yml'
15
+
16
+ # Thinking Sphinx config defaults
17
+ set :thinking_sphinx_pid_file, -> { "#{shared_path}/tmp/pids/searchd.pid" }
18
+ set :thinking_sphinx_indices_location, -> { "#{shared_path}/db/sphinx" }
19
+ set :thinking_sphinx_configuration_file, -> { "#{shared_path}/config/sphinx.conf" }
20
+ set :thinking_sphinx_binlog_path, -> { "#{shared_path}/sphinx_binlog" }
21
+ set :thinking_sphinx_log, -> { "#{shared_path}/log/searchd.log" }
22
+ set :thinking_sphinx_query_log, -> { "#{shared_path}/log/searchd.query.log" }
23
+ end
24
+ end
25
+
26
+ namespace :negroku do
27
+
28
+ namespace :thinking_sphinx do
29
+
30
+ desc "Upload thinking sphinx configuration file"
31
+ task :setup do
32
+ on release_roles fetch(:sphinx_roles) do
33
+ within "#{shared_path}/config" do
34
+ template_path = fetch(:thinking_sphinx_template)
35
+
36
+ # user a build in template if the template doesn't exists in the project
37
+ unless File.exists?(template_path)
38
+ template_path = "tasks/thinking_sphinx.yml.erb"
39
+ end
40
+
41
+ config = build_template(template_path, nil, binding)
42
+ upload! config, '/tmp/thinking_sphinx.yml'
43
+
44
+ execute :mv, '/tmp/thinking_sphinx.yml', 'thinking_sphinx.yml'
45
+ end
46
+ end
47
+ end
48
+
49
+ task :backup_config do
50
+ on release_roles fetch(:sphinx_roles) do
51
+ within "#{shared_path}/config" do
52
+ execute :cp, fetch(:thinking_sphinx_configuration_file), '/tmp/sphinx.conf.bak'
53
+ end
54
+ end
55
+ end
56
+ # Backup the config on every configure
57
+ Rake::Task['thinking_sphinx:configure'].enhance ['negroku:thinking_sphinx:backup_config']
58
+
59
+ task :check_config do
60
+ on release_roles fetch(:sphinx_roles) do
61
+ within "#{shared_path}/config" do
62
+ config_diff = capture "diff -q /tmp/sphinx.conf.bak #{fetch(:thinking_sphinx_configuration_file)}", raise_on_non_zero_exit: false
63
+ set :thinking_sphinx_config_changed, !config_diff.empty?
64
+ end
65
+ end
66
+ end
67
+
68
+
69
+ # Configure and regenerate after the application is published
70
+ after 'deploy:published', 'restart' do
71
+ invoke 'negroku:thinking_sphinx:setup'
72
+ invoke 'thinking_sphinx:configure'
73
+
74
+ # Change whether the config changed or not
75
+ invoke 'negroku:thinking_sphinx:check_config'
76
+
77
+ if fetch(:thinking_sphinx_config_changed)
78
+ invoke 'thinking_sphinx:regenerate'
79
+ end
80
+ end
81
+
82
+ define_logs(:sphinx, {
83
+ out: 'searchd.log',
84
+ query: 'searchd.query.log'
85
+ })
86
+
87
+ end
88
+
89
+ end
90
+
91
+ # Ensure the folders needed exist
92
+ task 'deploy:check:directories' do
93
+ on release_roles fetch(:thinking_sphinx_roles) do
94
+ execute :mkdir, '-pv', "#{shared_path}/db"
95
+ execute :mkdir, '-pv', "#{shared_path}/tmp/pids"
96
+ execute :mkdir, '-pv', "#{shared_path}/sphinx_binlog"
97
+ execute :touch, "#{shared_path}/config/thinking_sphinx.yml"
98
+ end
99
+ end
@@ -83,20 +83,19 @@ namespace :negroku do
83
83
  invoke 'unicorn:restart'
84
84
  end
85
85
 
86
- # Ensure the folders needed exist
87
- after 'deploy:check', 'deploy:check:directories' do
88
- on release_roles fetch(:unicorn_roles) do
89
- execute :mkdir, '-pv', "#{shared_path}/config"
90
- execute :mkdir, '-pv', "#{shared_path}/tmp/sockets"
91
- execute :mkdir, '-pv', "#{shared_path}/tmp/pids"
92
- end
93
- end
94
-
95
86
  define_logs(:unicorn, {
96
87
  error: 'unicorn-error.log',
97
88
  out: 'unicorn-out.log'
98
89
  })
99
90
 
100
91
  end
92
+ end
101
93
 
94
+ # Ensure the folders needed exist
95
+ task 'deploy:check:directories' do
96
+ on release_roles fetch(:unicorn_roles) do
97
+ execute :mkdir, '-pv', "#{shared_path}/config"
98
+ execute :mkdir, '-pv', "#{shared_path}/tmp/sockets"
99
+ execute :mkdir, '-pv', "#{shared_path}/tmp/pids"
100
+ end
102
101
  end
@@ -8,6 +8,9 @@ require 'capistrano/deploy'
8
8
  # Osx notifications
9
9
  require 'capistrano-nc/nc'
10
10
 
11
+ # Github deployments
12
+ require 'capistrano/github'
13
+
11
14
  # Ruby
12
15
  require 'capistrano/rbenv'
13
16
  require 'capistrano/bundler'
@@ -25,13 +28,15 @@ require 'capistrano3/unicorn'
25
28
  require 'capistrano/nginx'
26
29
 
27
30
  # Tools
28
- require 'capistrano/delayed-job'
29
- require 'whenever/capistrano'
31
+ #require 'capistrano/delayed-job'
32
+ #require 'whenever/capistrano'
33
+ #require 'thinking_sphinx/capistrano'
30
34
 
31
35
  # Eye monitoring
32
36
  require 'negroku/eye'
33
37
  require 'negroku/eye/unicorn'
34
- require 'negroku/eye/delayed_job'
38
+ #require 'negroku/eye/delayed_job'
39
+ #require 'negroku/eye/thinking_sphinx'
35
40
 
36
41
  # NEGROKU
37
42
  # Includes negroku defaults and tasks
@@ -0,0 +1,14 @@
1
+ process 'sphinx' do
2
+ pid_file "<%= fetch(:thinking_sphinx_pid_file) %>"
3
+ start_command "<%= fetch(:rbenv_prefix) %> bundle exec rake ts:start"
4
+
5
+ stop_command "<%= fetch(:rbenv_prefix) %> bundle exec rake ts:stop"
6
+
7
+ # soft restart
8
+ restart_command "<%= fetch(:rbenv_prefix) %> bundle exec rake ts:restart"
9
+
10
+ check :cpu, :every => 30, :below => 80, :times => 3
11
+
12
+ start_timeout 100.seconds
13
+ restart_grace 30.seconds
14
+ end
@@ -0,0 +1,11 @@
1
+ ##############################################
2
+ # Thinking Sphinx Base configuration file
3
+ ##############################################
4
+
5
+ <%= fetch(:thinking_sphinx_rails_env) %>:
6
+ pid_file: <%= fetch(:thinking_sphinx_pid_file) %>
7
+ indices_location: <%= fetch(:thinking_sphinx_indices_location) %>
8
+ configuration_file: <%= fetch(:thinking_sphinx_configuration_file) %>
9
+ binlog_path: <%= fetch(:thinking_sphinx_binlog_path) %>
10
+ log: <%= fetch(:thinking_sphinx_log) %>
11
+ query_log: <%= fetch(:thinking_sphinx_query_log) %>
@@ -1,3 +1,3 @@
1
1
  module Negroku
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
data/negroku.gemspec CHANGED
@@ -20,16 +20,17 @@ spec = Gem::Specification.new do |s|
20
20
  s.add_development_dependency('fakefs')
21
21
 
22
22
  s.add_runtime_dependency('rake', '~> 10.1')
23
- s.add_runtime_dependency('capistrano','~> 3.3.5')
23
+ s.add_runtime_dependency('capistrano','~> 3.4.0')
24
24
  s.add_runtime_dependency('capistrano-rbenv', '~> 2.0.3')
25
- s.add_runtime_dependency('capistrano-rails', '~> 1.1.2')
25
+ s.add_runtime_dependency('capistrano-rails', '~> 1.1.3')
26
26
  s.add_runtime_dependency('capistrano-bundler', '~> 1.1.4')
27
27
  s.add_runtime_dependency('capistrano-npm', '~> 1.0.1')
28
28
  s.add_runtime_dependency('capistrano-nc', '~> 0.1.4')
29
+ s.add_runtime_dependency('capistrano-github', '~> 0.1.1')
29
30
 
30
31
  s.add_runtime_dependency('capistrano-nodenv', '~> 1.0.0')
31
32
  s.add_runtime_dependency('capistrano-bower', '~> 1.1.0')
32
- s.add_runtime_dependency('capistrano3-nginx', '~> 2.0.7')
33
+ s.add_runtime_dependency('capistrano3-nginx', '~> 2.1.1')
33
34
  s.add_runtime_dependency('capistrano3-unicorn', '~> 0.2.1')
34
35
  s.add_runtime_dependency('capistrano3-delayed-job', '~> 1.4.0')
35
36
  s.add_runtime_dependency('whenever', '~> 0.9.4')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: negroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Ignacio Donoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 3.3.5
75
+ version: 3.4.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 3.3.5
82
+ version: 3.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: capistrano-rbenv
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 1.1.2
103
+ version: 1.1.3
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 1.1.2
110
+ version: 1.1.3
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: capistrano-bundler
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.1.4
153
+ - !ruby/object:Gem::Dependency
154
+ name: capistrano-github
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 0.1.1
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 0.1.1
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: capistrano-nodenv
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +198,14 @@ dependencies:
184
198
  requirements:
185
199
  - - ~>
186
200
  - !ruby/object:Gem::Version
187
- version: 2.0.7
201
+ version: 2.1.1
188
202
  type: :runtime
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - ~>
193
207
  - !ruby/object:Gem::Version
194
- version: 2.0.7
208
+ version: 2.1.1
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: capistrano3-unicorn
197
211
  requirement: !ruby/object:Gem::Requirement
@@ -304,6 +318,7 @@ files:
304
318
  - lib/negroku/deploy.rb
305
319
  - lib/negroku/eye.rb
306
320
  - lib/negroku/eye/delayed_job.rb
321
+ - lib/negroku/eye/thinking_sphinx.rb
307
322
  - lib/negroku/eye/unicorn.rb
308
323
  - lib/negroku/formatters/simple.rb
309
324
  - lib/negroku/helpers.rb
@@ -320,13 +335,16 @@ files:
320
335
  - lib/negroku/tasks/env.rake
321
336
  - lib/negroku/tasks/eye.rake
322
337
  - lib/negroku/tasks/eye/delayed_job.rake
338
+ - lib/negroku/tasks/eye/thinking_sphinx.rake
323
339
  - lib/negroku/tasks/eye/unicorn.rake
340
+ - lib/negroku/tasks/github.rake
324
341
  - lib/negroku/tasks/log.rake
325
342
  - lib/negroku/tasks/negroku.rake
326
343
  - lib/negroku/tasks/nginx.rake
327
344
  - lib/negroku/tasks/nodenv.rake
328
345
  - lib/negroku/tasks/rails.rake
329
346
  - lib/negroku/tasks/rbenv.rake
347
+ - lib/negroku/tasks/thinking_sphinx.rake
330
348
  - lib/negroku/tasks/unicorn.rake
331
349
  - lib/negroku/tasks/whenever.rake
332
350
  - lib/negroku/templates/negroku/Capfile.erb
@@ -334,8 +352,10 @@ files:
334
352
  - lib/negroku/templates/negroku/stage.rb.erb
335
353
  - lib/negroku/templates/tasks/eye/_delayed_job.erb
336
354
  - lib/negroku/templates/tasks/eye/_process.erb
355
+ - lib/negroku/templates/tasks/eye/_sphinx.erb
337
356
  - lib/negroku/templates/tasks/eye/_unicorn.erb
338
357
  - lib/negroku/templates/tasks/eye/application.eye.erb
358
+ - lib/negroku/templates/tasks/thinking_sphinx.yml.erb
339
359
  - lib/negroku/templates/tasks/unicorn_rails.rb.erb
340
360
  - lib/negroku/templates/tasks/unicorn_rails_activerecord.rb.erb
341
361
  - lib/negroku/version.rb