rezzza_capistrano_tools 0.3.2.dev → 0.3.3.dev

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bcff33303d3d0b6488d017672cacda4a3a0ed1e
4
- data.tar.gz: c5dc6646f2461e544491f8e069d729af70afdf79
3
+ metadata.gz: 8096b28af35da1b6b382e801d1715cbb457ebde9
4
+ data.tar.gz: 87d74a636b297f0ff449c574188c77aab5f06c5d
5
5
  SHA512:
6
- metadata.gz: 756f16e2e31841399d59f2f7f79758e8a6e88cbeaa090c4c29ac4169b78b264967ab8ebec2006ed3bb8c5f4b589dc1ab0f8b8be26c353ee505e930e7b1d99fb5
7
- data.tar.gz: 39d994dc53a35d357ca1dc1c50fb4451c768c638ca0516985f956eb52f1809c49efebe6feb576ef95316c8f1321185246d0669f629a6781535b3837bacd33481
6
+ metadata.gz: 0773269ed785c4f8a5315964f93739c29a06e020c0da6c533dc027848e5c5ee32c2821f9a739291374b4c0676ad90c3d62c06a5a4f1a3daf8de5ecc658ca3caa
7
+ data.tar.gz: 6ef6f4752730177cf3ab16af501f299c1c13ce449dccdadb8f43896aea6658216142abc5d94b0fa67c94c218a6e863dfbb0752acf726df905e8e7dc58dd2d4f6
@@ -6,6 +6,7 @@ require 'inifile'
6
6
  require 'yaml'
7
7
  require 'zlib'
8
8
  require 'ruby-progressbar'
9
+ require 'tempfile'
9
10
 
10
11
  module RezzzaCapistranoTools
11
12
  def self.load_into(configuration)
data/lib/vaultage.rb CHANGED
@@ -11,25 +11,27 @@ end
11
11
 
12
12
  namespace :vaultage do
13
13
  task :decrypt do
14
- randomstr = `openssl rand -base64 10`.strip
15
- localfiles = []
14
+ tempfiles = []
15
+ cryptedpaths = []
16
16
 
17
17
  vaultage_files.each_with_index do |files, index|
18
- tmp = "/tmp/#{application}_parameters_#{randomstr}#{index}.yml.#{vaultage_extension}"
19
- top.download(latest_release+"/"+files[0], tmp)
20
- localfiles.push(tmp)
18
+ tempfile = Tempfile.new(application)
19
+
20
+ top.download(latest_release+"/"+files[0], tempfile.path+"."+vaultage_extension)
21
+
22
+ tempfiles.push(tempfile);
23
+ cryptedpaths.push(tempfile.path+"."+vaultage_extension);
21
24
  end
22
25
 
23
- system "vaultage decrypt --write --files="+localfiles.join(',')
26
+ system "vaultage decrypt --write --files="+cryptedpaths.join(',')
24
27
 
25
28
  vaultage_files.each_with_index do |files, index|
26
- top.upload("/tmp/#{application}_parameters_#{randomstr}#{index}.yml", latest_release+"/"+files[1])
29
+ top.upload(tempfiles[index].path, latest_release+"/"+files[1])
30
+ tempfiles[index].unlink
27
31
  end
28
32
  end
29
33
 
30
34
  task :diff do
31
- randomstr = `openssl rand -base64 10`.strip
32
-
33
35
  vaultage_files.each_with_index do |files, index|
34
36
  directory = File.dirname(files[0])
35
37
 
@@ -64,17 +66,17 @@ namespace :vaultage do
64
66
  remote = from_vendor ? "composer" : "capistrano"
65
67
  system "cd #{absolute_directory} && git fetch #{remote}"
66
68
 
67
- tmp1 = "/tmp/#{application}_parameters_1_#{randomstr}#{index}.yml.gpg"
68
- tmp2 = "/tmp/#{application}_parameters_2_#{randomstr}#{index}.yml"
69
+ tmp1 = Tempfile.new(application)
70
+ tmp2 = Tempfile.new(application)
69
71
 
70
72
  # fetch encrypted file from git
71
- system "cd #{absolute_directory} && git show #{remote}/#{branch}:#{files[0].gsub(root_directory, '')} > #{tmp1}"
73
+ system "cd #{absolute_directory} && git show #{remote}/#{branch}:#{files[0].gsub(root_directory, '')} > #{tmp1.path}.gpg"
72
74
  # download decrypted file on remote server
73
- top.download(latest_release+"/"+files[1], tmp2)
75
+ top.download(latest_release+"/"+files[1], tmp2.path)
74
76
 
75
77
  capifony_pretty_print("Diff between local (versionned) #{files[0]} and remote #{files[1]}")
76
78
 
77
- system "vaultage diff --files=#{tmp1},#{tmp2}"
79
+ system "vaultage diff --files=#{tmp1.path}.gpg,#{tmp2.path}"
78
80
  end
79
81
  end
80
82
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rezzza_capistrano_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.dev
4
+ version: 0.3.3.dev
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les écureuils de Jean-Marc
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-15 00:00:00.000000000 Z
12
+ date: 2013-11-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |
15
15
  - Vaultage integration