easy-deployment 0.1.6 → 0.2.0
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/lib/easy-deployment/version.rb +1 -1
- data/lib/easy/deployment/nfs.rb +31 -0
- metadata +5 -4
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Define a capistrano task for creating nfs shared directories and symlinking them on deployment
|
|
2
|
+
# To load this capistrano configuraiton, require 'easy/deployment/nfs' from deploy.rb
|
|
3
|
+
#
|
|
4
|
+
# the default nfs_path is /opt/apps/nfs/shared, to change this value copy the line below
|
|
5
|
+
# set :nfs_path, "/var/apps/nfs/shared"
|
|
6
|
+
#
|
|
7
|
+
# nfs_shared_children consists of tmp/sessions by default; to add more children copy the line below
|
|
8
|
+
# set :nfs_shared_children, nfs_shared_children + %w(public/system)
|
|
9
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
|
10
|
+
set :nfs_path, "/opt/apps/nfs/shared"
|
|
11
|
+
set :nfs_shared_children, %w(tmp/sessions)
|
|
12
|
+
|
|
13
|
+
namespace :nfs do
|
|
14
|
+
desc "Create folders under the nfs path to be shared between app servers"
|
|
15
|
+
task :create_shared_dirs, :roles => :app, :primary => true do
|
|
16
|
+
nfs_shared_children.each do |child_path|
|
|
17
|
+
run "mkdir -p #{nfs_path}/#{application}/#{child_path}; chmod g+w #{nfs_path}/#{application}/#{child_path}"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
desc "Symlink the shared folders to the nfs path on all app servers"
|
|
22
|
+
task :symlink_shared_dirs, :roles => :app do
|
|
23
|
+
nfs_shared_children.each do |child_path|
|
|
24
|
+
run "ln -nfs #{nfs_path}/#{application}/#{child_path} #{release_path}/#{child_path}"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
after 'deploy:setup', 'nfs:create_shared_dirs'
|
|
30
|
+
after 'deploy:update_code', 'nfs:symlink_shared_dirs'
|
|
31
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: easy-deployment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2012-08-
|
|
15
|
+
date: 2012-08-22 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: rails
|
|
@@ -134,6 +134,7 @@ files:
|
|
|
134
134
|
- lib/easy/deployment/capistrano.rb
|
|
135
135
|
- lib/easy/deployment/dbreference.rb
|
|
136
136
|
- lib/easy/deployment/logrotate.rb
|
|
137
|
+
- lib/easy/deployment/nfs.rb
|
|
137
138
|
- lib/easy/deployment/niet.rb
|
|
138
139
|
- lib/easy/deployment/whenever.rb
|
|
139
140
|
- lib/easy/generators/deployment_generator.rb
|
|
@@ -158,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
158
159
|
version: '0'
|
|
159
160
|
segments:
|
|
160
161
|
- 0
|
|
161
|
-
hash:
|
|
162
|
+
hash: 881864788252472295
|
|
162
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
164
|
none: false
|
|
164
165
|
requirements:
|
|
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
167
168
|
version: '0'
|
|
168
169
|
segments:
|
|
169
170
|
- 0
|
|
170
|
-
hash:
|
|
171
|
+
hash: 881864788252472295
|
|
171
172
|
requirements: []
|
|
172
173
|
rubyforge_project:
|
|
173
174
|
rubygems_version: 1.8.24
|