public
Fork of fudgestudios/bort
Description: A base rails app featuring: RESTful Authentication, Will Paginate, Rspec & Rspec-rails, Exception Notifier, Asset Packager, Cap Recipe. Put together by Fudge to remove the need for boring project setup.
Homepage: http://www.fudgestudios.com
Clone URL: git://github.com/UnderpantsGnome/bort.git
unf--k the missed merge conflicts
Sun Nov 09 13:48:15 -0800 2008
commit  72737b180add02a96450d0bfd2e0b2c38651b2e0
tree    925c2230aac114b2c85b9f3c5964ef65f6af1399
parent  405719b0a8e6f6b7c98f43c41b48d4435f78c68c
...
1
2
3
4
5
6
7
8
9
10
11
12
13
 
 
 
 
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
 
 
 
 
 
34
35
36
37
38
39
40
41
42
43
 
 
 
 
44
45
 
46
47
48
 
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
 
 
 
66
67
 
 
 
 
 
 
 
 
 
 
 
 
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
...
134
135
136
137
 
138
139
140
141
 
142
143
144
...
150
151
152
153
 
154
155
156
 
157
158
159
...
161
162
163
164
165
166
167
...
 
 
 
 
 
 
1
2
3
 
 
 
 
4
5
6
7
8
 
9
10
11
12
13
14
 
 
15
16
17
18
19
 
 
 
 
 
20
21
22
23
24
25
26
27
28
29
30
31
 
 
 
 
32
33
34
35
36
 
37
38
39
 
40
41
42
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
45
46
47
48
 
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
66
67
...
69
70
71
 
72
73
74
75
 
76
77
78
79
...
85
86
87
 
88
89
90
 
91
92
93
94
...
96
97
98
 
 
99
100
0
@@ -1,132 +1,67 @@
0
-set :stages, %w(staging production)
0
-set :default_stage, "production"
0
-<<<<<<< HEAD:config/deploy.rb
0
-
0
-require File.expand_path("#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage")
0
-
0
 #############################################################
0
 #  Application
0
 #############################################################
0
-=======
0
-require File.expand_path("#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage")
0
->>>>>>> fudgestudios/master:config/deploy.rb
0
-
0
+require 'capistrano/ext/multistage'
0
+set :stages, %w(staging production)
0
+set :default_stage, "production"
0
+set :application, "yummylogs"
0
 
0
-<<<<<<< HEAD:config/deploy.rb
0
 #############################################################
0
 #  Settings
0
 #############################################################
0
 
0
 default_run_options[:pty] = true
0
 ssh_options[:forward_agent] = true
0
-set :use_sudo, true
0
-set :scm_verbose, true
0
 
0
 #############################################################
0
 #  Servers
0
 #############################################################
0
 
0
-set :user, "bort"
0
-set :gateway, 'gateway.example.com'
0
-set :domain, "www.example.com"
0
-server domain, :app, :web
0
-role :db, domain, :primary => true
0
+set :user, 'deploy'
0
+set :use_sudo, false
0
+set :gateway, 'gate.pixels-and-bits.com'
0
+role :web, 'web.pixles-and-bits.com'
0
+role :app, 'app1.pixles-and-bits.com'
0
+role :db, 'db.pixels-and-bits', :primary => true
0
 
0
 #############################################################
0
 #  Git
0
 #############################################################
0
 
0
 set :scm, :git
0
-set :branch, "master"
0
-set :scm_user, 'bort'
0
-set :scm_passphrase, "PASSWORD"
0
-set :repository, "git@github.com:FudgeStudios/bort.git"
0
+set :branch, 'master'
0
+set :scm_user, 'pb-deploy'
0
+set :repository, "git@github.com:pixels-and-bits/#{application}.git"
0
+set :deploy_to, "/var/webapps/#{application}/website"
0
 set :deploy_via, :remote_cache
0
-set :repository_cache, "repo_cache"
0
+set :scm_verbose, true
0
 
0
 #############################################################
0
-#  Passenger
0
+#  recipes
0
 #############################################################
0
 
0
 namespace :deploy do
0
-  desc "Create the database yaml file"
0
-  task :after_update_code do
0
-    deploy:write_db_config
0
-    
0
-    #########################################################
0
-    # Uncomment the following to symlink an uploads directory.
0
-    # Just change the paths to whatever you need.
0
-    #########################################################
0
-    
0
-    # desc "Symlink the upload directories"
0
-    # task :before_symlink do
0
-    #   run "mkdir -p #{shared_path}/uploads"
0
-    #   run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
0
-    # end
0
+  desc "This to do once we get the code up"
0
+  task :after_update_code, :roles => :app, :except => { :no_release => true } do
0
+    send(run_method, "cd #{release_path} && sudo gemtools install")
0
+    deploy:migrate
0
   end
0
-  
0
+
0
+  #########################################################
0
+  # Uncomment the following to symlink an uploads directory.
0
+  # Just change the paths to whatever you need.
0
+  #########################################################
0
+
0
+  # desc "Symlink the upload directories"
0
+  # task :before_symlink do
0
+  #   run "mkdir -p #{shared_path}/uploads"
0
+  #   run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
0
+  # end
0
+
0
   # Restart passenger on deploy
0
   desc "Restarting mod_rails with restart.txt"
0
   task :restart, :roles => :app, :except => { :no_release => true } do
0
     run "touch #{current_path}/tmp/restart.txt"
0
-=======
0
-namespace :db do
0
-  desc 'Dumps the production database to db/production_data.sql on the remote server'
0
-  task :remote_db_dump, :roles => :db, :only => { :primary => true } do
0
-    run "cd #{deploy_to}/#{current_dir} && " +
0
-      "rake RAILS_ENV=#{rails_env} db:database_dump --trace" 
0
-  end
0
-
0
-  desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
0
-  task :remote_db_download, :roles => :db, :only => { :primary => true } do  
0
-    execute_on_servers(options) do |servers|
0
-      self.sessions[servers.first].sftp.connect do |tsftp|
0
-        tsftp.download!("#{deploy_to}/#{current_dir}/db/production_data.sql", "db/production_data.sql")
0
-      end
0
-    end
0
->>>>>>> fudgestudios/master:config/deploy.rb
0
-  end
0
-
0
-  desc 'Cleans up data dump file'
0
-  task :remote_db_cleanup, :roles => :db, :only => { :primary => true } do
0
-    execute_on_servers(options) do |servers|
0
-      self.sessions[servers.first].sftp.connect do |tsftp|
0
-        tsftp.remove! "#{deploy_to}/#{current_dir}/db/production_data.sql" 
0
-      end
0
-    end
0
-  end 
0
-
0
-  desc 'Dumps, downloads and then cleans up the production data dump'
0
-  task :remote_db_runner do
0
-    remote_db_dump
0
-    remote_db_download
0
-    remote_db_cleanup
0
-  end
0
-<<<<<<< HEAD:config/deploy.rb
0
-  
0
-  desc "Prompts the deployment user for the database password, then generates config/database.yml"
0
-  task :write_db_config, :roles => [:app, :db], :except => { :no_release => true } do
0
-    transaction do
0
-      require "yaml"
0
-
0
-      buffer = YAML::load_file('config/database.template.yml')
0
-      user = buffer[rails_env]['username']
0
-      host = buffer[rails_env]['host'] || 'localhost'
0
-      dbname = buffer[rails_env]['database']
0
-
0
-      set :deployed_database_password, proc { 
0
-        Capistrano::CLI.password_prompt("
0
-***************
0
-DB password for #{user}@#{host}:/#{dbname} : ")
0
-      }
0
-
0
-      # set password
0
-      buffer.keys.each { |env| 
0
-        buffer[env]['password'] = deployed_database_password
0
-      }
0
-
0
-      put YAML::dump(buffer), "#{release_path}/config/database.yml", :mode => 0664
0
-    end
0
   end
0
 end
0
 
0
@@ -134,11 +69,11 @@ namespace :db do
0
   desc 'Dumps the production database to db/production_data.sql on the remote server'
0
   task :remote_db_dump, :roles => :db, :only => { :primary => true } do
0
     run "cd #{deploy_to}/#{current_dir} && " +
0
-      "rake RAILS_ENV=#{rails_env} db:database_dump --trace" 
0
+      "rake RAILS_ENV=#{rails_env} db:database_dump --trace"
0
   end
0
 
0
   desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
0
-  task :remote_db_download, :roles => :db, :only => { :primary => true } do  
0
+  task :remote_db_download, :roles => :db, :only => { :primary => true } do
0
     execute_on_servers(options) do |servers|
0
       self.sessions[servers.first].sftp.connect do |tsftp|
0
         tsftp.download!("#{deploy_to}/#{current_dir}/db/production_data.sql", "db/production_data.sql")
0
@@ -150,10 +85,10 @@ namespace :db do
0
   task :remote_db_cleanup, :roles => :db, :only => { :primary => true } do
0
     execute_on_servers(options) do |servers|
0
       self.sessions[servers.first].sftp.connect do |tsftp|
0
-        tsftp.remove! "#{deploy_to}/#{current_dir}/db/production_data.sql" 
0
+        tsftp.remove! "#{deploy_to}/#{current_dir}/db/production_data.sql"
0
       end
0
     end
0
-  end 
0
+  end
0
 
0
   desc 'Dumps, downloads and then cleans up the production data dump'
0
   task :remote_db_runner do
0
@@ -161,6 +96,4 @@ namespace :db do
0
     remote_db_download
0
     remote_db_cleanup
0
   end
0
-=======
0
->>>>>>> fudgestudios/master:config/deploy.rb
0
 end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
0
@@ -1,93 +1 @@
0
-#############################################################
0
-<<<<<<< HEAD:config/deploy/production.rb
0
-#  Settings
0
-#############################################################
0
-
0
-=======
0
-#  Application
0
-#############################################################
0
-
0
-set :application, "bort"
0
-set :deploy_to, "/path/to/deploy"
0
-
0
-#############################################################
0
-#  Settings
0
-#############################################################
0
-
0
-default_run_options[:pty] = true
0
-ssh_options[:forward_agent] = true
0
-set :use_sudo, true
0
-set :scm_verbose, true
0
->>>>>>> fudgestudios/master:config/deploy/production.rb
0
-set :rails_env, "production" 
0
-
0
-#############################################################
0
-#  Servers
0
-#############################################################
0
-
0
-<<<<<<< HEAD:config/deploy/production.rb
0
-set :domain, "www.example.com"
0
-server domain, :app, :web
0
-role :db, domain, :primary => true
0
-=======
0
-set :user, "bort"
0
-set :domain, "www.example.com"
0
-server domain, :app, :web
0
-role :db, domain, :primary => true
0
-
0
-#############################################################
0
-#  Git
0
-#############################################################
0
-
0
-set :scm, :git
0
-set :branch, "master"
0
-set :scm_user, 'bort'
0
-set :scm_passphrase, "PASSWORD"
0
-set :repository, "git@github.com:FudgeStudios/bort.git"
0
-set :deploy_via, :remote_cache
0
-
0
-#############################################################
0
-#  Passenger
0
-#############################################################
0
-
0
-namespace :deploy do
0
-  desc "Create the database yaml file"
0
-  task :after_update_code do
0
-    db_config = <<-EOF
0
-    production:    
0
-      adapter: mysql
0
-      encoding: utf8
0
-      username: root
0
-      password: 
0
-      database: bort_production
0
-      host: localhost
0
-    EOF
0
-    
0
-    put db_config, "#{release_path}/config/database.yml"
0
-    
0
-    #########################################################
0
-    # Uncomment the following to symlink an uploads directory.
0
-    # Just change the paths to whatever you need.
0
-    #########################################################
0
-    
0
-    # desc "Symlink the upload directories"
0
-    # task :before_symlink do
0
-    #   run "mkdir -p #{shared_path}/uploads"
0
-    #   run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
0
-    # end
0
-  
0
-  end
0
-    
0
-  # Restart passenger on deploy
0
-  desc "Restarting mod_rails with restart.txt"
0
-  task :restart, :roles => :app, :except => { :no_release => true } do
0
-    run "touch #{current_path}/tmp/restart.txt"
0
-  end
0
-  
0
-  [:start, :stop].each do |t|
0
-    desc "#{t} task is a no-op with mod_rails"
0
-    task t, :roles => :app do ; end
0
-  end
0
-  
0
-end
0
->>>>>>> fudgestudios/master:config/deploy/production.rb
0
+set :rails_env, "production"
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
0
@@ -1,92 +1 @@
0
-#############################################################
0
-<<<<<<< HEAD:config/deploy/staging.rb
0
-#  Settings
0
-#############################################################
0
-
0
-=======
0
-#  Application
0
-#############################################################
0
-
0
-set :application, "bort"
0
-set :deploy_to, "/path/to/deploy"
0
-
0
-#############################################################
0
-#  Settings
0
-#############################################################
0
-
0
-default_run_options[:pty] = true
0
-ssh_options[:forward_agent] = true
0
-set :use_sudo, true
0
-set :scm_verbose, true
0
->>>>>>> fudgestudios/master:config/deploy/staging.rb
0
-set :rails_env, "staging" 
0
-
0
-#############################################################
0
-#  Servers
0
-#############################################################
0
-
0
-<<<<<<< HEAD:config/deploy/staging.rb
0
-set :domain, "www.example.com"
0
-server domain, :app, :web
0
-role :db, domain, :primary => true
0
-=======
0
-set :user, "bort"
0
-set :domain, "www.example.com"
0
-server domain, :app, :web
0
-role :db, domain, :primary => true
0
-
0
-#############################################################
0
-#  Git
0
-#############################################################
0
-
0
-set :scm, :git
0
-set :branch, "master"
0
-set :scm_user, 'bort'
0
-set :scm_passphrase, "PASSWORD"
0
-set :repository, "git@github.com:FudgeStudios/bort.git"
0
-set :deploy_via, :remote_cache
0
-
0
-#############################################################
0
-#  Passenger
0
-#############################################################
0
-
0
-namespace :deploy do
0
-  desc "Create the database yaml file"
0
-  task :after_update_code do
0
-    db_config = <<-EOF
0
-    staging:    
0
-      adapter: mysql
0
-      encoding: utf8
0
-      username: root
0
-      password: 
0
-      database: bort_staging
0
-      host: localhost
0
-    EOF
0
-    
0
-    put db_config, "#{release_path}/config/database.yml"
0
-
0
-    #########################################################
0
-    # Uncomment the following to symlink an uploads directory.
0
-    # Just change the paths to whatever you need.
0
-    #########################################################
0
-    
0
-    # desc "Symlink the upload directories"
0
-    # task :before_symlink do
0
-    #   run "mkdir -p #{shared_path}/uploads"
0
-    #   run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
0
-    # end
0
-  end
0
-  
0
-  # Restart passenger on deploy
0
-  desc "Restarting mod_rails with restart.txt"
0
-  task :restart, :roles => :app, :except => { :no_release => true } do
0
-    run "touch #{current_path}/tmp/restart.txt"
0
-  end
0
-  
0
-  [:start, :stop].each do |t|
0
-    desc "#{t} task is a no-op with mod_rails"
0
-    task t, :roles => :app do ; end
0
-  end
0
-  
0
-end
0
->>>>>>> fudgestudios/master:config/deploy/staging.rb
0
+set :rails_env, "staging"

Comments