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 +4 -4
- data/lib/marionetta.rb +1 -1
- data/lib/marionetta/manipulators/deployer.rb +23 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d19cd4eae22fc3ff4ca73e358acaec5faf6a710
|
4
|
+
data.tar.gz: 0af723a8a0ddd47b7dbb8835d19e7f5ca61c051a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 734f93e4d820a7fbf8609d4e15139ad6d7843e0a28361523a13c62e2beeef7cea2b3f6437999d50c85a18cda28aafbde22f599de2114e061c31e83f605a11ad7
|
7
|
+
data.tar.gz: 2c5862746ffc132ac920a00e6eb8377bb69c7a1790f81a715929b7ad21d99c023e6c3239b06cdae8576077c10d968c31f1459756bff084ab3a445109ff4035cf
|
data/lib/marionetta.rb
CHANGED
@@ -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
|
-
|
208
|
-
|
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.
|
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-
|
11
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: open4
|