capistrano-precompile-on-local 0.0.1 → 0.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04251469c29c1267ab0b1e9ced87a6bcdf201311
|
4
|
+
data.tar.gz: 946318c267dd8cb4a97f92bf70a83044eb0c450a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e320e943c06bb32c7846cc873f0abaa98f68902b8664caed1f02adc8b7effc95084b585af672709969f0a7a4da2e19b3779d83f087bdefbedff5f3fd533236a1
|
7
|
+
data.tar.gz: d27be6be73e4feabb654d083ad95bb9ba15abacb48a5ab0610dafdeed6488fbb1f779dc0a883a0f836b3ddc0801e8ab17fad9a393cd9d4a869310555da3bfb5b
|
@@ -2,24 +2,40 @@ namespace :deploy do
|
|
2
2
|
namespace :assets do
|
3
3
|
Rake::Task['deploy:assets:precompile'].clear_actions
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
set :asset_full_path, -> { "#{release_path}/public/#{fetch(:assets_prefix)}" }
|
6
|
+
|
7
|
+
task :precompile_on_local do
|
7
8
|
run_locally do
|
8
9
|
execute 'RAILS_ENV=production bundle exec rake assets:precompile'
|
10
|
+
execute "cd ./public/#{fetch(:assets_prefix)} && tar zcf assets.tar.gz *"
|
9
11
|
end
|
12
|
+
end
|
10
13
|
|
14
|
+
task :upload_and_extract do
|
11
15
|
on roles(:app) do
|
12
16
|
within release_path do
|
13
|
-
|
14
|
-
|
15
|
-
execute "
|
16
|
-
|
17
|
+
execute "mkdir -p #{fetch(:asset_full_path)}"
|
18
|
+
upload! "./public/#{fetch(:assets_prefix)}/assets.tar.gz", fetch(:asset_full_path)
|
19
|
+
execute "cd #{fetch(:asset_full_path)} && tar zxf assets.tar.gz"
|
20
|
+
execute "cd #{fetch(:asset_full_path)} && rm assets.tar.gz"
|
17
21
|
end
|
18
22
|
end
|
23
|
+
end
|
19
24
|
|
25
|
+
task :clean do
|
20
26
|
run_locally do
|
21
27
|
execute "rm -r ./public/#{fetch(:assets_prefix)}"
|
22
28
|
end
|
23
29
|
end
|
30
|
+
|
31
|
+
desc "Precompile assets on local machine and upload them to the server."
|
32
|
+
task :precompile do
|
33
|
+
begin
|
34
|
+
invoke 'deploy:assets:precompile_on_local'
|
35
|
+
invoke 'deploy:assets:upload_and_extract'
|
36
|
+
ensure
|
37
|
+
invoke 'deploy:assets:clean'
|
38
|
+
end
|
39
|
+
end
|
24
40
|
end
|
25
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-precompile-on-local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ayaya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|