sekrets 1.1.0 → 1.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/sekrets.rb +1 -1
- data/lib/sekrets/capistrano.rb +25 -5
- data/sekrets.gemspec +1 -1
- metadata +1 -1
data/lib/sekrets.rb
CHANGED
data/lib/sekrets/capistrano.rb
CHANGED
@@ -1,17 +1,37 @@
|
|
1
1
|
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
rails_root =
|
3
|
+
case
|
4
|
+
when defined?(RAILS_ROOT)
|
5
|
+
RAILS_ROOT
|
6
|
+
when defined?(Rails.root)
|
7
|
+
Rails.root
|
8
|
+
else
|
9
|
+
nil
|
10
|
+
end
|
11
|
+
|
12
|
+
if rails_root.nil?
|
13
|
+
Capistrano::Configuration.instance.load_paths.each do |load_path|
|
14
|
+
if test(?e, File.join(load_path, 'Capfile'))
|
15
|
+
rails_root = File.expand_path(load_path)
|
16
|
+
break
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
abort 'could not determine rails_root!' unless rails_root
|
22
|
+
|
2
23
|
namespace :sekrets do
|
3
24
|
task :upload_key do
|
4
|
-
|
5
|
-
|
25
|
+
|
6
26
|
src = File.join(rails_root, '.sekrets.key')
|
7
27
|
dst = File.join(deploy_to, 'current', '.sekrets.key')
|
8
|
-
|
28
|
+
|
9
29
|
if test(?s, src)
|
10
30
|
upload(src, dst, :recursive => true)
|
11
31
|
end
|
12
32
|
end
|
13
33
|
end
|
14
|
-
|
15
|
-
|
34
|
+
|
35
|
+
|
16
36
|
after "deploy", "sekrets:upload_key"
|
17
37
|
end
|
data/sekrets.gemspec
CHANGED