sumodev_deploy 0.9.1 → 0.9.2
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.
- checksums.yaml +4 -4
- data/lib/sumodev_deploy/tasks/assets.rb +43 -0
- data/sumodev_deploy.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c56190b60427c229c251d3107b67870bfd76b096
|
4
|
+
data.tar.gz: 6361cff6120e976caa2ff65a0b43c22d1f2e6ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f68798cc73273266f02e7daa76100cc4826b7723779f6b500a37187dfd4ce95b371a51681e8561433e5db8612a22f46603b76d54b343143d87c3da28ac1cd90f
|
7
|
+
data.tar.gz: 54a8d779bb249382d3b054417f168bce761be40247957649d76e1b44b52a9cd4b2675f0c4c47999996831dfb0b2c7e4738291b4c41da4275d65c374c180fdfed
|
@@ -18,6 +18,11 @@ Capistrano::Configuration.instance.load do
|
|
18
18
|
upload "./src/Frontend/Themes/#{theme}/Core", "#{latest_release.shellescape}/src/Frontend/Themes/#{theme}/Core"
|
19
19
|
else
|
20
20
|
logger.important "No Gruntfile.coffee or gulpfile.js found"
|
21
|
+
|
22
|
+
compass_folders = fetch(:compass_folders, Dir.glob('**/config.rb'))
|
23
|
+
if not compass_folders.empty?
|
24
|
+
assets.compile_with_compass
|
25
|
+
end
|
21
26
|
end
|
22
27
|
if File.exists?("package.json")
|
23
28
|
run_locally "rm -rf temporary_node_modules && mkdir temporary_node_modules && cp package.json temporary_node_modules && cd temporary_node_modules && npm install --production"
|
@@ -25,5 +30,43 @@ Capistrano::Configuration.instance.load do
|
|
25
30
|
run_locally "rm -rf temporary_node_modules"
|
26
31
|
end
|
27
32
|
end
|
33
|
+
|
34
|
+
desc "Compass compile"
|
35
|
+
task :compile_with_compass do
|
36
|
+
require 'compass'
|
37
|
+
|
38
|
+
compass = fetch(:compass_command) do
|
39
|
+
if File.exists?("Gemfile.lock")
|
40
|
+
"bundle exec compass"
|
41
|
+
else
|
42
|
+
"compass"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
compass_folders = fetch(:compass_folders, Dir.glob('**/config.rb'))
|
46
|
+
asset_path = fetch(:asset_cache_dir, Dir.pwd + "/cache/cached_assets")
|
47
|
+
output_style = fetch(:compass_output, :compressed)
|
48
|
+
|
49
|
+
compass_folders.each do |config|
|
50
|
+
path = File.dirname(config)
|
51
|
+
Compass.add_project_configuration(config)
|
52
|
+
|
53
|
+
run_locally "rm -rf #{asset_path} && mkdir -p #{asset_path}" # Cleanup
|
54
|
+
run_locally "cd #{path} && #{compass} clean --css-dir #{asset_path}/#{Compass.configuration.css_dir}"
|
55
|
+
run_locally "cd #{path} && #{compass} compile -s #{output_style} --css-dir #{asset_path}/#{Compass.configuration.css_dir}"
|
56
|
+
|
57
|
+
assets = Dir.glob(asset_path + '/**/*').map {|f| [f, f.gsub(asset_path, '')] }
|
58
|
+
sprites = Dir.glob(path + "/images/**/*").grep(/-[0-9a-z]{11}.(png|jpg)/).map {|f| [f, f.gsub(path, '')] }
|
59
|
+
|
60
|
+
(assets + sprites).each do |file, filepath|
|
61
|
+
if File.directory?(file)
|
62
|
+
run "mkdir -p #{latest_release.shellescape}/#{path}/#{filepath}"
|
63
|
+
else
|
64
|
+
upload file, "#{latest_release.shellescape}/#{path}#{filepath}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
run_locally "rm -rf #{asset_path}"
|
69
|
+
Compass.reset_configuration!
|
70
|
+
end end
|
28
71
|
end
|
29
72
|
end
|
data/sumodev_deploy.gemspec
CHANGED