capistranovelys 1.0.1 → 2.0.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: bf43dc5cfa937aedb411d6fc78c89c0774ce622e
4
- data.tar.gz: 3215f8004ab47fd42b0b19d3e2092925808f7733
3
+ metadata.gz: 8748950ff9c9d04bb793134bb78dd457767b70d0
4
+ data.tar.gz: a1f4833e0f47b8bfc59aad5e4a13db344df84a73
5
5
  SHA512:
6
- metadata.gz: 27f57b6e57d6dfe8d86640063aa0eae536fb4a21ae0eae8a51db8bc25b9fb7b2851e8a2513faa3ae6738f526bf683c10668b6091172afb4fe0a39f727ea86eab
7
- data.tar.gz: ffcfcf21a61034dff4fdc5df39555458e47dd92694dbef3499bad02c957e13f203c532e5c31283b8847d0b2ccf9b3f96041d06addb69a18a0808f802b049bbe4
6
+ metadata.gz: e8bff43daefc899c40594904a14b37dd5f0a42a4512c8bcbee65e45781dcb301ab88a57408fe4f6a9dca8ea04921ffb63b5f324790e1914153360a16ea1af6ce
7
+ data.tar.gz: b0aa94df8f5becc416c2e4e246b04ba415e851a735fb372f9ea20c9a22f17b0aafbd22a68b0839489140cb102d3be2ff81613ae63ccdef8ea4ffb3107f494994
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ## `2.0.0`
2
+
3
+ * Add missing sphinx recipes;
4
+ * Extracted novelys-specific config in a specific file;
5
+ * Added defaults option for `bundle_without`;
6
+ * Renamed `use_stack` to `use_recipes` and `use_default_stack` to `use_novelys`;
7
+ * `rails2` tasks are namespaced under `rails` (but the module name stays `rails2`).
8
+
9
+ ## `1.0.0`
10
+
11
+ First release
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Capistranovelys - Keeping our recipes DRY
2
2
 
3
- This gem, once stable, should include every recipe/task that serves for more than one of our project.
3
+ This gem includes every recipe/task that is in use in more than one project at Novelys.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,17 +8,18 @@ This gem, once stable, should include every recipe/task that serves for more tha
8
8
  meaning you can remove `capistrano` and `capistrano-ext` from your Gemfile, and replace it with :
9
9
 
10
10
  ```ruby
11
- gem "capistranovelys", :git => 'git@github.com:novelys/capistranovelys.git'
11
+ gem "capistranovelys", '~> 2.0.0'
12
12
  ```
13
13
 
14
14
  ## Usage
15
15
 
16
16
  In your deploy.rb :
17
17
 
18
- * remove `require "production_chain/capistrano";
18
+ * remove `require "production_chain/capistrano" if you are using [novelys/production_chain](https://github.com/novelys/production_chain)
19
19
  * add `require 'capistrano/novelys'` (loads the core recipes)
20
- * load recipes you need, eg: `use_stack :database, :rails2, :rbenv, :whenever`. To be used **BEFORE** other loading of recipes such as `deploy/assets`, otherwise some hooks (such as the symlinks) will be executed too late.
21
- * You can use `use_default_stack_and [arg, ...]`. It will load `airbrake`, `rbenv`, `unicorn`, `logs`, `stages`, `remote_commands, production_chain`, and the recipes supplied as arguments. Use `use_default_stack` if you don't want/need anything else.
20
+ * load recipes you need, eg: `use_recipes :database, :rails2, :rbenv, :whenever`. To be used **BEFORE** other loading of recipes such as `deploy/assets`, otherwise some hooks (such as the symlinks) will be executed too late.
21
+ * You can use `use_novelys_and [arg, ...]`. It will load `airbrake`, `rbenv`, `logs`, `stages`, `remote_commands, production_chain`, and the recipes supplied as arguments. This will also use Novelys' configuration for `user`, `deploy_to`, and `repository`. Use `use_novelys` if you don't want/need anything else.
22
+ * You probably want to set `user`, `deploy_to`, and `repository` at the very least. Refer to `core.rb` to see which default values are set
22
23
  * Make sure you don't have duplicates!
23
24
 
24
25
  ## Recipes available
@@ -45,9 +46,9 @@ Rails 3 & 4 commands.
45
46
 
46
47
  Rails 2 commands.
47
48
 
48
- * `rails2:console` : open a rails console
49
- * `rails2:secret_token:copy` : copy the session_store from your local file to the shared path
50
- * `rails2:secret_token:symlink` : symlink the session_store.rb file from the shared path to the current path. Hooked after `deploy:update_code`
49
+ * `rails:console` : open a rails console
50
+ * `rails:secret_token:copy` : copy the session_store from your local file to the shared path
51
+ * `rails:secret_token:symlink` : symlink the session_store.rb file from the shared path to the current path. Hooked after `deploy:update_code`
51
52
 
52
53
  ### Stages (`stages`)
53
54
 
@@ -78,7 +79,7 @@ You should not require `capistrano/ext/multistage`.
78
79
 
79
80
  ### Production chain (`production_chain`)
80
81
 
81
- Recipes usings rake tasks from [novelys/production_chain](https://github.com/novelys/production_chain)
82
+ Recipes usings rake tasks from [novelys/production_chain](https://github.com/novelys/production_chain). Will work only if the gem is present.
82
83
 
83
84
  * `db:dump_and_restore`: restore the database from the server to your local env. Supply `FILE=mongoid` when using mongoid.
84
85
  * `assets:dump_and_restore`: restore the assets from the public direction to your local env.
@@ -9,13 +9,10 @@ set(:repository_cache) { 'git_cache' }
9
9
  set(:copy_exclude) { %w(.svn .DS_Store .git) }
10
10
  set(:keep_releases) { 5 }
11
11
  set(:public_children) { %w(images) }
12
- set(:bundle_cmd) { 'bundle' }
13
12
 
14
- ## Default app configuration
15
- set(:user) { application }
16
- set(:deploy_to) { "/home/#{user}/www/" }
17
- set(:github_account) { 'novelys' }
18
- set(:repository) { "git@github.com:#{github_account}/#{application}" }
13
+ ## Bundle
14
+ set(:bundle_cmd) { 'bundle' }
15
+ set(:bundle_without) { (stages + [:development, :test]) - [stage] }
19
16
 
20
17
  ## SSH Options
21
18
  ssh_options[:forward_agent] = true
@@ -1,15 +1,15 @@
1
1
  module Capistrano
2
2
  class Configuration
3
3
  # Sugar for loading given recipes
4
- def use_stack(*args)
4
+ def use_recipes(*args)
5
5
  args.each { |recipes| load "novelys/#{recipes.to_s}" }
6
6
  end
7
7
 
8
8
  # Sugar for loading common recipes (+ supplied is present)
9
- def use_default_stack(*args)
10
- args = ([:airbrake, :logs, :production_chain, :rbenv, :remote_commands, :stages, :unicorn] + args).uniq
9
+ def use_novelys(*args)
10
+ args = ([:airbrake, :logs, :production_chain, :rbenv, :remote_commands, :novelys, :stages] + args).uniq
11
11
  use_stack(*args)
12
12
  end
13
- alias :use_default_stack_and :use_default_stack
13
+ alias :use_novelys_and :use_novelys
14
14
  end
15
15
  end
@@ -0,0 +1,6 @@
1
+ ## Default Novelys app configuration
2
+
3
+ set(:user) { application }
4
+ set(:deploy_to) { "/home/#{user}/www/" }
5
+ set(:github_account) { 'novelys' }
6
+ set(:repository) { "git@github.com:#{github_account}/#{application}" }
@@ -1,19 +1,19 @@
1
1
  require 'readline'
2
2
 
3
3
  ## Hooks
4
- after 'deploy:update_code', 'rails2:secret_token:symlink'
4
+ after 'deploy:update_code', 'rails:secret_token:symlink'
5
5
 
6
6
  ## Tasks
7
- namespace :rails2 do
7
+ namespace :rails do
8
8
  namespace :secret_token do
9
9
  desc "Copy the secret token file to the server"
10
10
  task :copy do
11
- upload "config/initializers/session_store.rb", "#{shared_path}/config/initializers/session_store.rb", :via => :scp
11
+ upload "config/initializers/session_store.rb", "#{shared_path}/config/initializes/session_store.rb", :via => :scp
12
12
  end
13
13
 
14
14
  desc "Symlink the secret token file in the current release"
15
15
  task :symlink do
16
- run "test -f #{release_path}/config/initializers/session_store.rb || ln -s #{shared_path}/config/initializers/session_store.rb #{release_path}/config/initializers/session_store.rb"
16
+ run "test -f #{release_path}/initializers/session_store.rb || ln -s #{shared_path}/initializers/session_store.rb #{release_path}/initializers/session_store.rb"
17
17
  end
18
18
  end
19
19
 
@@ -13,6 +13,46 @@ namespace :thinking_sphinx do
13
13
  task :symlink do
14
14
  run "test -f #{release_path}/config/#{rails_env}.sphinx.conf || ln -s #{shared_path}/config/#{rails_env}.sphinx.conf #{release_path}/config/#{rails_env}.sphinx.conf"
15
15
  end
16
+
17
+ desc "Generate the Sphinx configuration file"
18
+ task :configure do
19
+ Novelys::Helpers.run_remote_rake(self, "thinking_sphinx:configure")
20
+ end
21
+
22
+ desc "Index data"
23
+ task :index do
24
+ Novelys::Helpers.run_remote_rake(self, "thinking_sphinx:index")
25
+ end
26
+
27
+ desc "Start the Sphinx daemon"
28
+ task :start do
29
+ configure
30
+ Novelys::Helpers.run_remote_rake(self, "thinking_sphinx:start")
31
+ end
32
+
33
+ desc "Stop the Sphinx daemon"
34
+ task :stop do
35
+ configure
36
+ Novelys::Helpers.run_remote_rake(self, "thinking_sphinx:stop")
37
+ end
38
+
39
+ desc "Stop and then start the Sphinx daemon"
40
+ task :restart do
41
+ stop
42
+ start
43
+ end
44
+
45
+ desc "Stop, re-index and then start the Sphinx daemon"
46
+ task :rebuild do
47
+ stop
48
+ index
49
+ start
50
+ end
51
+
52
+ desc "Add the shared folder for sphinx files for the current environment"
53
+ task :shared_sphinx_folder, :roles => :web do
54
+ run "mkdir -p #{shared_path}/db/sphinx/#{rails_env}"
55
+ end
16
56
  end
17
57
 
18
58
  ## Alias for thinking_sphinx namespace
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Novelys
3
- VERSION = '1.0.1'
3
+ VERSION = '2.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistranovelys
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Soltysiak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2014-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.15.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.15.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sushi
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.0.2
41
41
  description: Capistrano recipes in use at novelys
@@ -44,7 +44,8 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
- - ".gitignore"
47
+ - .gitignore
48
+ - CHANGELOG.md
48
49
  - Gemfile
49
50
  - LICENCE
50
51
  - README.md
@@ -57,6 +58,7 @@ files:
57
58
  - lib/capistrano/novelys/helpers.rb
58
59
  - lib/capistrano/novelys/logs.rb
59
60
  - lib/capistrano/novelys/mongoid.rb
61
+ - lib/capistrano/novelys/novelys.rb
60
62
  - lib/capistrano/novelys/production_chain.rb
61
63
  - lib/capistrano/novelys/puma.rb
62
64
  - lib/capistrano/novelys/rails.rb
@@ -80,17 +82,17 @@ require_paths:
80
82
  - lib
81
83
  required_ruby_version: !ruby/object:Gem::Requirement
82
84
  requirements:
83
- - - ">="
85
+ - - '>='
84
86
  - !ruby/object:Gem::Version
85
87
  version: '0'
86
88
  required_rubygems_version: !ruby/object:Gem::Requirement
87
89
  requirements:
88
- - - ">="
90
+ - - '>='
89
91
  - !ruby/object:Gem::Version
90
92
  version: '0'
91
93
  requirements: []
92
94
  rubyforge_project:
93
- rubygems_version: 2.2.0
95
+ rubygems_version: 2.1.9
94
96
  signing_key:
95
97
  specification_version: 4
96
98
  summary: Capistrano recipes for novelys