shuttle-deploy 0.2.0.beta12 → 0.2.0.beta13

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: b6ee5e81023988deeb094a7226c78f9f9e6a46f9
4
- data.tar.gz: 846bf3cfa380f9c6a47f07f94e05841bb23f4780
3
+ metadata.gz: 48ac61e4be7aa5690dcf6edcb3fbb0e601a72703
4
+ data.tar.gz: d9a6e5a5ea69859d9df6e986d8c1deee84244b39
5
5
  SHA512:
6
- metadata.gz: 33a43a7688bb0aacc7a277792551cb9bacd9d1ddba041b520fea4471f73614c0c0f7c58a63a3b74b202629e2a08cb458e8fa22339a3a329a4edf765df5b3c445
7
- data.tar.gz: d97492ce75db43bb90dc0be0413721f2f2b9732cca3c81629782d1e9ecc0c2fb8869386fc00b054aaeb33d4f4db611d549796d5953c070193e971ad0aedab44b
6
+ metadata.gz: d7de4b7784cbcfe8b294988046a2e96b23e3f2ac37d2fadc85fe579dbc2c9241a29164e02cf6afe5f7021652704e970319e480b78180eb5b287af488d1c7f3e3
7
+ data.tar.gz: 8966d34feac331a67924cbbdd63acbe92958fc7af9f5e6ffdb1a2f22ffbbfa4c2800f6760214a41d47cc347c8f95fe29876d3869e1a420cb27557dc732b271fc
@@ -15,6 +15,10 @@ module Shuttle
15
15
  config.rails && config.rails.precompile_assets != false
16
16
  end
17
17
 
18
+ def cache_assets?
19
+ config.rails && config.rails.cache_assets == true
20
+ end
21
+
18
22
  def start_server?
19
23
  if config.rails && !config.rails.start_server.nil?
20
24
  config.rails.start_server
@@ -43,10 +47,30 @@ module Shuttle
43
47
  end
44
48
  end
45
49
 
50
+ # Precompile rails assets. If no changes detected between last and
51
+ # current releases, precompile task will be skipped.
46
52
  def precompile_assets
47
53
  if precompile_assets?
48
- log "Precompiling assets"
49
- rake 'assets:precompile'
54
+ precompile = true
55
+
56
+ # Detect if there any change in assets
57
+ if cache_assets? && last_version != version
58
+ old_path = deploy_path("releases/#{last_version}")
59
+ new_path = release_path
60
+
61
+ result = ssh.run("diff -arq #{old_path}/app/assets #{new_path}/app/assets")
62
+ if result.success?
63
+ precompile = false
64
+ ssh.run("cp -a #{old_path}/public/assets #{new_path}/public/")
65
+ end
66
+ end
67
+
68
+ if precompile
69
+ log "Precompiling assets"
70
+ rake 'assets:precompile'
71
+ else
72
+ log "Asset procompilation skipped"
73
+ end
50
74
  end
51
75
  end
52
76
 
@@ -1,3 +1,3 @@
1
1
  module Shuttle
2
- VERSION = '0.2.0.beta12'
2
+ VERSION = "0.2.0.beta13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shuttle-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta12
4
+ version: 0.2.0.beta13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Sosedoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-09 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  version: 1.3.1
223
223
  requirements: []
224
224
  rubyforge_project:
225
- rubygems_version: 2.0.5
225
+ rubygems_version: 2.0.3
226
226
  signing_key:
227
227
  specification_version: 4
228
228
  summary: Minimalistic deployment tool