dust-deploy 0.10.0 → 0.10.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/changelog.md CHANGED
@@ -1,6 +1,17 @@
1
1
  Changelog
2
2
  =============
3
3
 
4
+ 0.10.1
5
+ ------------
6
+
7
+ - fixes an issue, where node.scp / node.write were not preserved if the file existed before
8
+ - repositories recipe now accepts multiple releases for custom repos
9
+
10
+ recipes:
11
+ repositories:
12
+ release: [ myrelease1, myrelease2 ]
13
+
14
+
4
15
  0.10.0
5
16
  ------------
6
17
 
@@ -93,8 +93,10 @@ class Repositories < Recipe
93
93
  def generate_repo repo
94
94
  # add url to sources.list
95
95
  sources = ''
96
- sources << "deb #{repo['url']} #{repo['release']} #{repo['components']}\n" if repo['binary']
97
- sources << "deb-src #{repo['url']} #{repo['release']} #{repo['components']}\n" if repo['source']
96
+ repo['release'].to_array.each do |release|
97
+ sources << "deb #{repo['url']} #{release} #{repo['components']}\n" if repo['binary']
98
+ sources << "deb-src #{repo['url']} #{release} #{repo['components']}\n" if repo['source']
99
+ end
98
100
  sources
99
101
  end
100
102
 
data/lib/dust/server.rb CHANGED
@@ -115,13 +115,9 @@ module Dust
115
115
  f.print content
116
116
  f.close
117
117
 
118
- file_existed = file_exists? destination, :quiet => true
119
-
120
118
  ret = Dust.print_result scp(f.path, destination, :quiet => true), options
121
119
  f.unlink
122
120
 
123
- # default to 644 unless file existed before
124
- chmod '0644', destination, options unless file_existed
125
121
  ret
126
122
  end
127
123
 
@@ -144,6 +140,15 @@ module Dust
144
140
 
145
141
  Dust.print_msg "deploying #{File.basename source}", options
146
142
 
143
+ # save permissions if the file already exists
144
+ ret = exec "stat -c %a:%u:%g #{destination}"
145
+ if ret[:exit_code] == 0
146
+ permissions, user, group = ret[:stdout].chomp.split ':'
147
+ else
148
+ # files = 644, dirs = 755
149
+ permissions = 'ug-x,o-wx,u=rwX,g=rX,o=rX'
150
+ end
151
+
147
152
  # if in sudo mode, copy file to temporary place, then move using sudo
148
153
  if @node['sudo']
149
154
  ret = exec 'mktemp --tmpdir dust.XXXXXXXXXX'
@@ -166,6 +171,10 @@ module Dust
166
171
  Dust.print_ok '', options
167
172
  end
168
173
 
174
+ # set file permissions
175
+ chown "#{user}:#{group}", destination, :quiet => true if user and group
176
+ chmod permissions, destination, :quiet => true
177
+
169
178
  restorecon destination, options # restore SELinux labels
170
179
  end
171
180
 
data/lib/dust/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dust
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 10
8
- - 0
9
- version: 0.10.0
8
+ - 1
9
+ version: 0.10.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - kris kechagia
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-04-03 00:00:00 +02:00
17
+ date: 2012-04-05 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency