softwear-lib 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/softwear/lib/version.rb +1 -1
- data/lib/softwear/lib.rb +47 -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: 1078429a30dc19fe5c7b180b935de7a15329a13e
|
4
|
+
data.tar.gz: c475d02ac4c703612e24ecc91a7cdd2d0a0f816f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 661183ed3b98bee647065ff05d200ea7e064fcf3c8149f2f708dc61d65086032e593770b39e22f688fcacc380c5f561919269d3c81b507be7b875b8593ccc91c
|
7
|
+
data.tar.gz: ba24884e99014e6b4f2a94bf2a12a1dffea06147cee3e4593a45c1dae8108ae352213c31c3a4a1427eec4014104812fd2a04693bdc1123cc478f3b7885ca27e9
|
data/lib/softwear/lib/version.rb
CHANGED
data/lib/softwear/lib.rb
CHANGED
@@ -62,6 +62,8 @@ end
|
|
62
62
|
|
63
63
|
def self.capistrano(context)
|
64
64
|
context.instance_eval do
|
65
|
+
Rake::Task["deploy:compile_assets"].clear
|
66
|
+
|
65
67
|
ruby = fetch(:rvm_ruby_string) || fetch(:rvm_ruby_version)
|
66
68
|
gem_home_1 = fetch(:gems_path) || "~/.rvm/rubies/#{ruby}/gems"
|
67
69
|
gem_home_2 = "~/.rvm/gems/#{ruby}"
|
@@ -83,10 +85,54 @@ end
|
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
88
|
+
after :publishing, :restart_sidekiq_manager do
|
89
|
+
on roles(:sidekiq) do
|
90
|
+
execute 'sudo restart sidekiq-manager'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
86
94
|
# This is no longer necessary
|
87
95
|
# before :updating, :update_softwear_lib
|
88
|
-
|
89
96
|
after :publishing, :restart
|
97
|
+
|
98
|
+
desc 'Compile assets'
|
99
|
+
task :compile_assets => [:set_rails_env] do
|
100
|
+
invoke 'deploy:assets:precompile_local'
|
101
|
+
invoke 'deploy:assets:backup_manifest'
|
102
|
+
end
|
103
|
+
|
104
|
+
namespace :assets do
|
105
|
+
|
106
|
+
desc "Precompile assets locally and then rsync to web servers"
|
107
|
+
task :precompile_local do
|
108
|
+
# compile assets locally
|
109
|
+
run_locally do
|
110
|
+
execute "RAILS_ENV=#{fetch(:stage)} bundle exec rake assets:precompile"
|
111
|
+
end
|
112
|
+
|
113
|
+
# rsync to each server
|
114
|
+
assets_dir = "public/#{fetch(:assets_prefix) || 'assets'}"
|
115
|
+
local_dir = "./#{assets_dir}/"
|
116
|
+
on roles( fetch(:assets_roles, [:web]) ) do
|
117
|
+
# this needs to be done outside run_locally in order for host to exist
|
118
|
+
remote_dir = "#{host.user}@#{host.hostname}:#{release_path}/#{assets_dir}"
|
119
|
+
|
120
|
+
execute "mkdir -p #{release_path}/#{assets_dir}"
|
121
|
+
run_locally { execute "rsync -av --delete #{local_dir} #{remote_dir}" }
|
122
|
+
|
123
|
+
if fetch(:asset_sync)
|
124
|
+
with rails_env: fetch(:rails_env) || fetch(:stage) do
|
125
|
+
within(release_path) do
|
126
|
+
with_rvm(fetch(:task_ruby_version)) { execute :rake, 'assets:sync' }
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# clean up
|
133
|
+
run_locally { execute "rm -rf #{local_dir}" }
|
134
|
+
end
|
135
|
+
|
90
136
|
end
|
91
137
|
end
|
92
138
|
end
|