the_force 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/the_force/capistrano/tomcat.rb +76 -0
- data/lib/the_force/thread_pool.rb +3 -2
- metadata +5 -9
data/Rakefile
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
#CRZ - sep 24 10 installs app to mastodon as www user
|
2
|
+
# - beware, www user needs to have custom PATH in .ssh/environment for things to work right
|
3
|
+
# - uses custom tasks for bundler support
|
4
|
+
#
|
5
|
+
# - oct 28 10 - copied from invoicing app deploy.rb
|
6
|
+
# - to deploy on a new box, first cap deploy:setup, then add database.yml on the server in shared, then deploy:cold
|
7
|
+
#
|
8
|
+
# - nov 4 - putting capistrano recipe into the_force, use like this
|
9
|
+
# require 'rubygems'
|
10
|
+
# require 'the_force'
|
11
|
+
# require 'the_force/lib/the_force/capistrano/internal/defaults'
|
12
|
+
# set :application, "amie"
|
13
|
+
# set :shared_dirs, %w(public/system log db/sqlite)
|
14
|
+
# set :shared_files, %w(config/database.yml config/cdn.yml)
|
15
|
+
# require 'the_force/lib/the_force/capistrano/internal/rails'
|
16
|
+
|
17
|
+
require 'highline'
|
18
|
+
|
19
|
+
Capistrano::Configuration.instance(:sf_internal_rails).load do
|
20
|
+
[:server_name, :application, :shared_dirs, :shared_files].each do |v|
|
21
|
+
raise "#{v} must be set to use this capistrano recipe." unless exists? v
|
22
|
+
end
|
23
|
+
|
24
|
+
role :app, "#{server_name}"
|
25
|
+
role :db, "#{server_name}", :primary => true
|
26
|
+
|
27
|
+
namespace :sf do
|
28
|
+
desc "symlink shared directories"
|
29
|
+
task :symlink_shared_dirs, :roles => :app do
|
30
|
+
for d in shared_dirs
|
31
|
+
run <<-EOF
|
32
|
+
mkdir -p #{shared_path}/#{d} &&
|
33
|
+
rm -rf #{release_path}/#{d}; true;
|
34
|
+
ln -s #{shared_path}/#{d} #{release_path}/#{d}
|
35
|
+
EOF
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "symlinks shared files"
|
40
|
+
task :symlink_shared_files, :roles => :app do
|
41
|
+
for f in shared_files
|
42
|
+
run "mkdir -p #{deploy_to}/shared/#{File.dirname(f)}"
|
43
|
+
run "rm #{release_path}/#{f}; true"
|
44
|
+
run "ln -s #{shared_path}/#{f} #{release_path}/#{f}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "set permissions on mastodon"
|
49
|
+
task :chowning, :roles => :app do
|
50
|
+
run "chown -R #{httpd_owner}.#{httpd_owner} #{release_path}"
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "init and update submodules"
|
54
|
+
task :fetch_submodules, :roles => :app do
|
55
|
+
run "cd #{release_path} && git submodule update --init"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
namespace :deploy do
|
60
|
+
desc "restart passenger ruby process"
|
61
|
+
task :restart, :roles => :app do
|
62
|
+
run "touch #{current_path}/tmp/restart.txt"
|
63
|
+
on_rollback do
|
64
|
+
run "touch #{current_path}/tmp/restart.txt"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
###CRZ - the chowning is not the last thing...some things owned by root, particularly the symlinks.
|
70
|
+
after 'deploy:update_code', 'bundler:bundle_new_release'
|
71
|
+
after 'bundler:bundle_new_release', 'sf:fetch_submodules'
|
72
|
+
after 'deploy:finalize_update', 'sf:chowning'
|
73
|
+
after 'sf:chowning', 'sf:symlink_shared_files'
|
74
|
+
after 'sf:symlink_shared_files', 'sf:symlink_shared_dirs'
|
75
|
+
after 'deploy:symlink', 'deploy:migrate'
|
76
|
+
end
|
@@ -2,7 +2,8 @@ require 'thread'
|
|
2
2
|
begin
|
3
3
|
require 'fastthread'
|
4
4
|
rescue LoadError
|
5
|
-
|
5
|
+
#CRZ: this error msg is quite annoying
|
6
|
+
#$stderr.puts "Using the ruby-core thread implementation"
|
6
7
|
end
|
7
8
|
|
8
9
|
module TheForce
|
@@ -50,7 +51,7 @@ module TheForce
|
|
50
51
|
|
51
52
|
def exception(thread, exception, *original_args)
|
52
53
|
# Subclass this method to handle an exception within a thread.
|
53
|
-
puts "Exception in thread #{thread}: #{exception}"
|
54
|
+
puts "Exception in thread #{thread}: #{exception}\n #{exception.backtrace.join("\n ")}"
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_force
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 31
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
8
|
+
- 7
|
9
|
+
version: 0.3.7
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Ryan Ziegler
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2012-05-06 00:00:00 -04:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|
@@ -34,6 +33,7 @@ files:
|
|
34
33
|
- init.rb
|
35
34
|
- lib/the_force/capistrano/internal/defaults.rb
|
36
35
|
- lib/the_force/capistrano/internal/rails.rb
|
36
|
+
- lib/the_force/capistrano/tomcat.rb
|
37
37
|
- lib/the_force/keep_trying.rb
|
38
38
|
- lib/the_force/memoize.rb
|
39
39
|
- lib/the_force/object_support.rb
|
@@ -62,27 +62,23 @@ rdoc_options:
|
|
62
62
|
require_paths:
|
63
63
|
- lib
|
64
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
65
|
requirements:
|
67
66
|
- - ">="
|
68
67
|
- !ruby/object:Gem::Version
|
69
|
-
hash: 3
|
70
68
|
segments:
|
71
69
|
- 0
|
72
70
|
version: "0"
|
73
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
72
|
requirements:
|
76
73
|
- - ">="
|
77
74
|
- !ruby/object:Gem::Version
|
78
|
-
hash: 3
|
79
75
|
segments:
|
80
76
|
- 0
|
81
77
|
version: "0"
|
82
78
|
requirements: []
|
83
79
|
|
84
80
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.3.
|
81
|
+
rubygems_version: 1.3.6
|
86
82
|
signing_key:
|
87
83
|
specification_version: 3
|
88
84
|
summary: Common code for Symbolforce
|