cap-elastics 0.0.1
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.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +29 -0
- data/README.md +34 -0
- data/Rakefile +1 -0
- data/cap-elastics.gemspec +23 -0
- data/lib/cap_elastics.rb +6 -0
- data/lib/cap_elastics/task_helpers.rb +8 -0
- data/lib/cap_elastics/tasks.rb +45 -0
- data/lib/cap_elastics/version.rb +3 -0
- metadata +87 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cap-elastics (0.0.1)
|
5
|
+
capistrano (~> 2.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
capistrano (2.15.5)
|
11
|
+
highline
|
12
|
+
net-scp (>= 1.0.0)
|
13
|
+
net-sftp (>= 2.0.0)
|
14
|
+
net-ssh (>= 2.0.14)
|
15
|
+
net-ssh-gateway (>= 1.1.0)
|
16
|
+
highline (1.6.19)
|
17
|
+
net-scp (1.1.2)
|
18
|
+
net-ssh (>= 2.6.5)
|
19
|
+
net-sftp (2.1.2)
|
20
|
+
net-ssh (>= 2.6.5)
|
21
|
+
net-ssh (2.6.8)
|
22
|
+
net-ssh-gateway (1.2.0)
|
23
|
+
net-ssh (>= 2.6.5)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
cap-elastics!
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# cap-elastics
|
2
|
+
|
3
|
+
|
4
|
+
Cap extension for the elastics gem (https://rubygems.org/gems/elastics-rails).
|
5
|
+
|
6
|
+
Use this exetension to rebuild the Elastic Search index on a server.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
gem install cap-elastics
|
11
|
+
|
12
|
+
Or if in the context of something using bundler such as Rails, add to Gemfile
|
13
|
+
eg:
|
14
|
+
|
15
|
+
gem 'elastics', :group => :development
|
16
|
+
|
17
|
+
Add to top of a relevant Capistrano file (such as config/deploy.rb ordinarily):
|
18
|
+
|
19
|
+
require 'cap_elastics'
|
20
|
+
|
21
|
+
This makes cap-elastics's tasks available to you.
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
The cap-elastics extension adds two tasks to your capistrano setup:
|
26
|
+
|
27
|
+
cap elastics:reindex # Reindex ElasticSearch on a remote server.
|
28
|
+
cap deploy:elastics:reindex # Deploy the app and reindex (similar to cap deploy:migrations).
|
29
|
+
|
30
|
+
## Copyright
|
31
|
+
|
32
|
+
Copyright © 2013 Tiago Franco and contributors
|
33
|
+
|
34
|
+
Licensed under the same license as Emacs (GPL v3 or later) unless otherwise specified.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "cap_elastics/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "cap-elastics"
|
7
|
+
s.version = CapElastics::VERSION
|
8
|
+
s.authors = ["Tiago Franco"]
|
9
|
+
s.email = ["gama.franco@gmail.com"]
|
10
|
+
s.homepage = "http://github.com/gamafranco/cap-elastics"
|
11
|
+
s.summary = %q{Cap extension for the Elastics gem.}
|
12
|
+
|
13
|
+
s.rubyforge_project = "cap-elastics"
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
|
21
|
+
s.add_dependency "capistrano", "~> 2.0"
|
22
|
+
s.add_dependency "elastics", "~> 1.0.10"
|
23
|
+
end
|
data/lib/cap_elastics.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Written using crazy meta-code cribbed from capistrano_ext so you
|
2
|
+
# can (and must) 'require' this file rather than 'load' it.
|
3
|
+
require 'capistrano'
|
4
|
+
|
5
|
+
unless Capistrano::Configuration.respond_to?(:instance)
|
6
|
+
abort 'cap-elastics requires Capistrano 2'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'cap_elastics/task_helpers'
|
10
|
+
|
11
|
+
|
12
|
+
Capistrano::Configuration.instance.load do
|
13
|
+
|
14
|
+
namespace :deploy do
|
15
|
+
namespace :elastics do
|
16
|
+
# include our helper methods, I believe just into this namespace
|
17
|
+
# if we do it this way.
|
18
|
+
extend CapElastics::TaskHelpers
|
19
|
+
|
20
|
+
desc <<-DESC
|
21
|
+
Deploy the app and reindex
|
22
|
+
DESC
|
23
|
+
task :reindex do
|
24
|
+
update_code
|
25
|
+
reindex
|
26
|
+
create_symlink
|
27
|
+
restart
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
namespace :elastics do
|
33
|
+
desc <<-DESC
|
34
|
+
Reindex ElasticSearch.
|
35
|
+
DESC
|
36
|
+
task :reindex do
|
37
|
+
rails = fetch(:rails, 'script/rails')
|
38
|
+
rails_env = fetch(:rails_env, 'production')
|
39
|
+
|
40
|
+
|
41
|
+
run "cd #{latest_release} && RAILS_ENV=#{rails_env} bundle exec #{rails} runner 'Elastics::LiveReindex.reindex_models'"
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cap-elastics
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Tiago Franco
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-09-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: capistrano
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: elastics
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.0.10
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.10
|
46
|
+
description:
|
47
|
+
email:
|
48
|
+
- gama.franco@gmail.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
56
|
+
- README.md
|
57
|
+
- Rakefile
|
58
|
+
- cap-elastics.gemspec
|
59
|
+
- lib/cap_elastics.rb
|
60
|
+
- lib/cap_elastics/task_helpers.rb
|
61
|
+
- lib/cap_elastics/tasks.rb
|
62
|
+
- lib/cap_elastics/version.rb
|
63
|
+
homepage: http://github.com/gamafranco/cap-elastics
|
64
|
+
licenses: []
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project: cap-elastics
|
83
|
+
rubygems_version: 1.8.25
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: Cap extension for the Elastics gem.
|
87
|
+
test_files: []
|