the_force 0.3.0 → 0.3.1

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.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ exclude_file_globs = []
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = "the_force"
10
- s.version = '0.3.0'
10
+ s.version = '0.3.1'
11
11
  s.author = "Ryan Ziegler"
12
12
  s.email = "info@symbolforce.com"
13
13
  s.homepage = "http://www.symbolforce.com"
@@ -0,0 +1,21 @@
1
+ Capistrano::Configuration.instance(:sf_defaults).load do
2
+ set :repository do; "git@git.symbolforce.com:#{application}"; end
3
+ set :deploy_to do; "/var/www/#{application}"; end
4
+
5
+ set :rails_env, "production"
6
+ set :scm, :git
7
+ set :branch, "master"
8
+ set :server_name, "mastodon.symbolforce.com"
9
+ set :deploy_via, :remote_cache
10
+ set :copy_strategy, :export
11
+ set :user, 'root'
12
+ set :runner, 'root'
13
+ #set :deploy_via, :copy
14
+ #shallow clone and non-master branch dont work together, but only git clone --depth 1
15
+ #set :git_shallow_clone, 1
16
+ #remote local repo on deployment machine, and deploy from there. fastest
17
+
18
+ set :use_sudo, false
19
+ default_run_options[:pty] = true
20
+ end
21
+
@@ -0,0 +1,80 @@
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 '/Users/ry/apps/the_force/lib/the_force/capistrano/internal/defaults'
10
+ # set :application, "amie"
11
+ # set :shared_dirs, %w(public/system log db/sqlite)
12
+ # set :shared_files, %w(config/database.yml config/cdn.yml)
13
+ # require '/Users/ry/apps/the_force/lib/the_force/capistrano/internal/rails'
14
+
15
+ require 'highline'
16
+
17
+ Capistrano::Configuration.instance(:sf_internal_rails).load do
18
+ [:server_name, :application, :shared_dirs, :shared_files].each do |v|
19
+ raise "#{v} must be set to use this capistrano recipe." unless exists? v
20
+ end
21
+
22
+ role :app, "#{server_name}"
23
+ role :db, "#{server_name}", :primary => true
24
+
25
+ namespace :sf do
26
+ desc "symlink shared directories"
27
+ task :symlink_shared_dirs, :roles => :app do
28
+ for d in shared_dirs
29
+ run <<-EOF
30
+ mkdir -p #{shared_path}/#{d} &&
31
+ rm -rf #{release_path}/#{d}; true;
32
+ ln -s #{shared_path}/#{d} #{release_path}/#{d}
33
+ EOF
34
+ end
35
+ end
36
+
37
+ desc "symlinks shared files"
38
+ task :symlink_shared_files, :roles => :app do
39
+ for f in shared_files
40
+ run "mkdir -p #{deploy_to}/shared/#{File.dirname(f)}"
41
+ run "rm #{release_path}/#{f}; true"
42
+ run "ln -s #{shared_path}/#{f} #{release_path}/#{f}"
43
+ end
44
+ end
45
+
46
+ desc "set permissions on mastodon"
47
+ task :chowning, :roles => :app do
48
+ run "chown -R apache.apache #{release_path}"
49
+ end
50
+ end
51
+
52
+ namespace :deploy do
53
+ desc "restart passenger ruby process"
54
+ task :restart, :roles => :app do
55
+ run "touch #{current_path}/tmp/restart.txt"
56
+ on_rollback do
57
+ run "touch #{current_path}/tmp/restart.txt"
58
+ end
59
+ end
60
+ end
61
+
62
+ namespace :bundler do
63
+ task :create_symlink, :roles => :app do
64
+ shared_dir = File.join(shared_path, 'bundle')
65
+ release_dir = File.join(current_release, '.bundle')
66
+ run "mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}"
67
+ end
68
+
69
+ task :bundle_new_release, :roles => :app do
70
+ bundler.create_symlink
71
+ run "cd #{release_path} && bundle install --deployment --without test development"
72
+ end
73
+ end
74
+
75
+ after 'deploy:update_code', 'bundler:bundle_new_release'
76
+ after 'deploy:finalize_update', 'sf:chowning'
77
+ after 'sf:chowning', 'sf:symlink_shared_files'
78
+ after 'sf:symlink_shared_files', 'sf:symlink_shared_dirs'
79
+ after 'deploy:symlink', 'deploy:migrate'
80
+ 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: 19
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 3
9
- - 0
10
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
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: 2010-11-02 00:00:00 -04:00
17
+ date: 2010-11-05 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies: []
21
20
 
@@ -32,6 +31,8 @@ files:
32
31
  - LICENSE
33
32
  - Rakefile
34
33
  - init.rb
34
+ - lib/the_force/capistrano/internal/defaults.rb
35
+ - lib/the_force/capistrano/internal/rails.rb
35
36
  - lib/the_force/keep_trying.rb
36
37
  - lib/the_force/memoize.rb
37
38
  - lib/the_force/object_support.rb
@@ -60,7 +61,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
61
  requirements:
61
62
  - - ">="
62
63
  - !ruby/object:Gem::Version
63
- hash: 3
64
64
  segments:
65
65
  - 0
66
66
  version: "0"
@@ -69,7 +69,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- hash: 3
73
72
  segments:
74
73
  - 0
75
74
  version: "0"