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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc1b9c37e2033ee3e24f968020f68e529def8390
4
- data.tar.gz: f68745dad08f66224b1a1f182ef24e90d6dcc02d
3
+ metadata.gz: 1078429a30dc19fe5c7b180b935de7a15329a13e
4
+ data.tar.gz: c475d02ac4c703612e24ecc91a7cdd2d0a0f816f
5
5
  SHA512:
6
- metadata.gz: ca84ab111fc07c81a1fcc961f60bfa7038318c3d1315ab3982234634802bf6829b1ad3b55dbbddf7069f9d16704c6b8514bded324ffdeedf31a02525a199cf3e
7
- data.tar.gz: fad616f135138357f5b714d79a16ddc69d1eef8f85fdaa959e2f4d14fc3d121fca8deee183ee5414714deaa51616ec601ac4c56b79cf2ea83966f2d28f847ef4
6
+ metadata.gz: 661183ed3b98bee647065ff05d200ea7e064fcf3c8149f2f708dc61d65086032e593770b39e22f688fcacc380c5f561919269d3c81b507be7b875b8593ccc91c
7
+ data.tar.gz: ba24884e99014e6b4f2a94bf2a12a1dffea06147cee3e4593a45c1dae8108ae352213c31c3a4a1427eec4014104812fd2a04693bdc1123cc478f3b7885ca27e9
@@ -1,5 +1,5 @@
1
1
  module Softwear
2
2
  module Lib
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: softwear-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Baillie