marionetta 0.4.11 → 0.4.12

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: 916de758cb7350958d2c59b1d18171bdf16f0349
4
- data.tar.gz: f4bb66f2f4d5976981f58f6330927b046e96512f
3
+ metadata.gz: 2d19cd4eae22fc3ff4ca73e358acaec5faf6a710
4
+ data.tar.gz: 0af723a8a0ddd47b7dbb8835d19e7f5ca61c051a
5
5
  SHA512:
6
- metadata.gz: c4dcafbe865cbf58019d638e92b09e6c1bc1969e899036964b8c5410d4fb452fc82a77e6112dcdd09858b8780d51d99694a60f952cb71927620f071c9d4dc576
7
- data.tar.gz: 2319631fd9c16dfd14c6bbdaf10edcb21f547cbf7547744b1fe04dbe0343c35a1c79556bd8be145d07c3acd7ec7855f68c1345354c6d0c2dbf35001a94cf6de1
6
+ metadata.gz: 734f93e4d820a7fbf8609d4e15139ad6d7843e0a28361523a13c62e2beeef7cea2b3f6437999d50c85a18cda28aafbde22f599de2114e061c31e83f605a11ad7
7
+ data.tar.gz: 2c5862746ffc132ac920a00e6eb8377bb69c7a1790f81a715929b7ad21d99c023e6c3239b06cdae8576077c10d968c31f1459756bff084ab3a445109ff4035cf
@@ -27,7 +27,7 @@
27
27
  #
28
28
  module Marionetta
29
29
 
30
- VERSION = '0.4.11'
30
+ VERSION = '0.4.12'
31
31
 
32
32
  ### Defining Servers
33
33
 
@@ -83,6 +83,8 @@ module Marionetta
83
83
  def deploy()
84
84
  release = create_release_name()
85
85
 
86
+ write_deploy_version_file()
87
+
86
88
  DirectorySync.sync(server, from_dir, cache_dir, server[:deployer])
87
89
  copy_cache_dir_to_release(release)
88
90
 
@@ -179,6 +181,19 @@ module Marionetta
179
181
  "#{releases_dir}/#{release}"
180
182
  end
181
183
 
184
+ def release_version()
185
+ if server[:deployer].has_key?(:version)
186
+ version_cmd = server[:deployer][:version][:command]
187
+ version = nil
188
+
189
+ cmd.system("cd #{from_dir} && #{version_cmd}") do |stdout|
190
+ version = stdout.read.strip
191
+ end
192
+
193
+ return version
194
+ end
195
+ end
196
+
182
197
  def current_dir()
183
198
  "#{to_dir}/current"
184
199
  end
@@ -204,18 +219,18 @@ module Marionetta
204
219
  def create_release_name()
205
220
  name = timestamp
206
221
 
207
- if server[:deployer].has_key?(:version)
208
- version_cmd = server[:deployer][:version][:command]
209
-
210
- cmd.system("cd #{from_dir} && #{version_cmd}") do |stdout|
211
- version = stdout.read.strip
212
- name << "_#{version}" unless version.empty?
213
- end
214
- end
222
+ version = release_version()
223
+ name << "_#{version}" unless version.empty?
215
224
 
216
225
  return name
217
226
  end
218
227
 
228
+ def write_deploy_version_file()
229
+ if version = release_version()
230
+ cmd.system("echo #{version} > #{from_dir}/DEPLOY-VERSION")
231
+ end
232
+ end
233
+
219
234
  def copy_cache_dir_to_release(release)
220
235
  release_dir = release_dir(release)
221
236
  cmd.ssh("mkdir -p #{releases_dir} && cp -r #{cache_dir} #{release_dir}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionetta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Morton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-22 00:00:00.000000000 Z
11
+ date: 2013-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open4