capistrano-sunspot 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e0851dea2c9b539e8767f8e9f079b640d0f8c204
4
+ data.tar.gz: 7db86933f6d4e687d66d62127bf1ac8eada1b904
5
+ SHA512:
6
+ metadata.gz: 15187678565a4f86246fea3cb7040caf98be0ac147a3f5f9094db4ae4fdba392fc98e34c1b361de6afebd92d3ef83d6a603ac969beefe9f20488e9ee0403fcdb
7
+ data.tar.gz: 4db76ac39a1aeb4163ba1a27962bf1ad987cc5521cb734232d708d7f66f8932e8da12259962eb487daa39923d11aaafe711181e7e8b0227a77b60f70dacf2875
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,4 @@
1
+
2
+ # 1.0.0
3
+
4
+ Initial release
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-sunspot.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Tom Clements
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,69 @@
1
+ # Capistrano::Sunspot
2
+
3
+ Sunspot specific tasks for Capistrano v3:
4
+
5
+ - `cap sunspot:start`
6
+ - `cap sunspot:stop`
7
+ - `cap sunspot:reindex`
8
+ - `cap sunspot:restart`
9
+
10
+ ## Installation
11
+
12
+ Add these lines to your application's Gemfile:
13
+
14
+ ```ruby
15
+ group :development do
16
+ gem 'capistrano'
17
+ gem 'capistrano-sunspot'
18
+ end
19
+ ```
20
+
21
+ Run the following command to install the gems:
22
+
23
+ ```
24
+ bundle install
25
+ ```
26
+
27
+ Then run the generator to create a basic set of configuration files:
28
+
29
+ ```
30
+ bundle exec cap install
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ Require capistrano sunspot :
36
+
37
+ ```ruby
38
+ # Capfile
39
+ require 'capistrano/capistrano-sunspot'
40
+ ```
41
+
42
+
43
+ Please note that any `require`s should be placed in `Capfile`, not in `config/deploy.rb`.
44
+
45
+ You can tweak some Rails-specific options in `config/deploy.rb`:
46
+
47
+ ```ruby
48
+
49
+
50
+
51
+ ### Symlinks
52
+
53
+ You'll probably want to symlink sunspot shared files and directories like `solr`.
54
+ Make sure you enable it by setting `linked_dirs` and `linked_files` options:
55
+
56
+ ```ruby
57
+ # deploy.rb
58
+ set :linked_dirs, fetch(:linked_dirs, []).push('solr')
59
+
60
+ ```
61
+
62
+
63
+ ## Contributing
64
+
65
+ 1. Fork it
66
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
67
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
68
+ 4. Push to the branch (`git push origin my-new-feature`)
69
+ 5. Create new Pull Request
@@ -0,0 +1,4 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ # Do nothing by default
4
+ task :default
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "capistrano-sunspot"
7
+ gem.version = '1.0.0'
8
+ gem.authors = ["Navin Kumar"]
9
+ gem.email = ["navinspm@gmail.com"]
10
+ gem.description = %q{Capistrano task for sunspot}
11
+ gem.summary = %q{Capistrano task for sunspot}
12
+ gem.homepage = "https://github.com/navinspm/capistrano-sunspot"
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.require_paths = ["lib"]
17
+
18
+ gem.add_dependency 'capistrano', '~> 3.1'
19
+ gem.add_dependency 'capistrano-bundler', '~> 1.1'
20
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ require 'capistrano/bundler'
2
+ require 'capistrano/sunspot/sunspot'
3
+
@@ -0,0 +1 @@
1
+ load File.expand_path("../../tasks/sunspot.rake", __FILE__)
@@ -0,0 +1,54 @@
1
+ module Capistrano
2
+ class FileNotFound < StandardError
3
+ end
4
+ end
5
+
6
+ namespace :solr do
7
+
8
+ desc "start solr sunspot server"
9
+ task :start do
10
+ on roles(:app) do
11
+ within release_path do
12
+ with rails_env: fetch(:rails_env) do
13
+ execute :rake, "sunspot:solr:start"
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ desc "stop solr sunspot server"
20
+ task :stop do
21
+ on roles(:app) do
22
+ within release_path do
23
+ with rails_env: fetch(:rails_env) do
24
+ begin
25
+ execute :rake, "sunspot:solr:stop"
26
+ rescue Exception => e
27
+ puts "No pid is running"
28
+ end
29
+ execute "rm -rf #{current_path}/solr"
30
+ end
31
+ end
32
+ execute "ps -ef | grep solr | grep -v grep | awk '{print $2}' | xargs kill || echo 'no process with name solr found'"
33
+ end
34
+ end
35
+
36
+ desc "reindex the whole database"
37
+ task :reindex do
38
+ on roles(:app) do
39
+ within release_path do
40
+ with rails_env: fetch(:rails_env) do
41
+ execute :rake, "sunspot:solr:reindex"
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ desc "start & reindex and stop solr and start again ( for manual use )"
48
+ task :restart do
49
+ on roles(:app), in: :sequence, wait: 3 do
50
+ %w[stop start reindex].each { |task| invoke "solr:#{stop}" }
51
+ end
52
+ end
53
+
54
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-sunspot
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Navin Kumar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: capistrano-bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ description: Capistrano task for sunspot
42
+ email:
43
+ - navinspm@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - CHANGELOG.md
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - capistrano-sunspot.gemspec
55
+ - lib/capistrano-sunspot.rb
56
+ - lib/capistrano/sunspot.rb
57
+ - lib/capistrano/sunspot/sunspot.rb
58
+ - lib/capistrano/tasks/sunspot.rake
59
+ homepage: https://github.com/navinspm/capistrano-sunspot
60
+ licenses: []
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.6.8
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Capistrano task for sunspot
82
+ test_files: []