<commit_before>require 'erb'
# http://github.com/jnewland/san_juan/tree/master For god integration
require 'san_juan'

set :application, "goldencircle.academycommunity.com"

set :scm, :git
set :repository,  "<EMAIL>:golden_circle.git"
set :branch, "master"
set :deploy_via, :remote_cache


set :user, "capistrano"
set :use_sudo, false

# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/srv/www/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:
# set :scm, :subversion

before "deploy:setup", :db
after "deploy:update_code", "db:symlink", "db:rake_db" 

namespace :db do
  desc "Create database yaml in shared path" 
  task :default do
    db_config = ERB.new <<-EOF
    base: &base
      adapter: mysql
      socket: /tmp/mysql.sock
      username: golden
      password: <PASSWORD>

    development:
      database: gc_development
      <<: *base

    test:
      database: gc_test
      <<: *base

    production:
      database: gc_production
      <<: *base
      
    profile:
      database: gc_production
      <<: *base
    EOF

    run "mkdir -p #{shared_path}/config" 
    put db_config.result, "#{shared_path}/config/database.yml" 
  end

  desc "Make symlink for database yaml" 
  task :symlink do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  end

  desc "Rake the databases"
  task :rake_db do
    run "rake db:migrate RAILS_ENV=production"
  end
end

namespace :slicehost do
desc "install required gems"
  task :install_required_gems do
    run "cd #{deploy_to}/current; rake gems:install"
  end
end

set :web_server, "academycommunity.com"

role :app, web_server
role :web, web_server
role :db,  web_server, :primary => true

thin_app = "thin-goldencircle.academycommunity.com"

san_juan.role :app, [thin_app]
#san_juan.role :web, %w(nginx)

set :god_config_path, "/etc/god.conf"

namespace :deploy do
  desc "Use god to restart the app" 
    task :restart do
#      god.all.reload #ensures any changes to the god config are applied at deploy
      god.app.send(thin_app).restart
#      god.web.nginx.reload
    end<commit_msg>let's try that again<commit_after>require 'erb'
# http://github.com/jnewland/san_juan/tree/master For god integration
require 'san_juan'

set :application, "goldencircle.academycommunity.com"

set :scm, :git
set :repository,  "<EMAIL>:golden_circle.git"
set :branch, "master"
set :deploy_via, :remote_cache


set :user, "capistrano"
set :use_sudo, false

# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/srv/www/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:
# set :scm, :subversion

before "deploy:setup", :db
after "deploy:update_code", "db:symlink", "db:rake_db" 

namespace :db do
  desc "Create database yaml in shared path" 
  task :default do
    db_config = ERB.new <<-EOF
    base: &base
      adapter: mysql
      socket: /tmp/mysql.sock
      username: golden
      password: <PASSWORD>

    development:
      database: gc_development
      <<: *base

    test:
      database: gc_test
      <<: *base

    production:
      database: gc_production
      <<: *base
      
    profile:
      database: gc_production
      <<: *base
    EOF

    run "mkdir -p #{shared_path}/config" 
    put db_config.result, "#{shared_path}/config/database.yml" 
  end

  desc "Make symlink for database yaml" 
  task :symlink do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  end

  desc "Rake the databases"
  task :rake_db do
    run "rake -f #{deploy_to}/current/Rakefile db:migrate RAILS_ENV=production"
  end
end

namespace :slicehost do
desc "install required gems"
  task :install_required_gems do
    run "cd #{deploy_to}/current; rake gems:install"
  end
end

set :web_server, "academycommunity.com"

role :app, web_server
role :web, web_server
role :db,  web_server, :primary => true

thin_app = "thin-goldencircle.academycommunity.com"

san_juan.role :app, [thin_app]
#san_juan.role :web, %w(nginx)

set :god_config_path, "/etc/god.conf"

namespace :deploy do
  desc "Use god to restart the app" 
    task :restart do
#      god.all.reload #ensures any changes to the god config are applied at deploy
      god.app.send(thin_app).restart
#      god.web.nginx.reload
    end
{'fraction_non_alphanumeric': 0.11079669133652591, 'fraction_numerical': 0.0, 'mean_word_length': 3.5540138751238852, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4776060', 'n_tokens_mistral': 1637, 'n_tokens_neox': 1554, 'n_words': 462}