<commit_before># For complete deployment instructions, see the following support guide:
# http://www.engineyard.com/support/guides/deploying_your_application_with_capistrano

require "eycap/recipes"

begin
  require "config/developers/logins"
rescue LoadError=>e
  EY_PASSWORD=proc{Capistrano::CLI.password_prompt('g5search user password:')}
  SCM_USERNAME="g5search"
  SCM_PASSWORD=proc{Capistrano::CLI.password_prompt('git g5search password:')}
end

# =================================================================================================
# ENGINE YARD REQUIRED VARIABLES
# =================================================================================================
# You must always specify the application and repository for every recipe. The repository must be
# the URL of the repository you want this recipe to correspond to. The :deploy_to variable must be
# the root of the application.

set :keep_releases,       5
set :application,         "translatable"
set :user,                "g5search"
set :password,            <PASSWORD>
set :deploy_to,           "/data/#{application}"
set :monit_group,         "translatable"
set :runner,              "g5search"
set :repository,          "<EMAIL>:perry3819/translatable.git"
set :scm,                 :git
set :scm_username,        SCM_USERNAME
set :scm_password,        SCM_PASSWORD

# This will execute the Git revision parsing on the *remote* server rather than locally
set :real_revision,       lambda { source.query_revision(revision) { |cmd| capture(cmd) } }

# comment out if it gives you trouble. newest net/ssh needs this set.
ssh_options[:paranoid] = false

# =================================================================================================
# ROLES
# =================================================================================================
# You can define any number of roles, each of which contains any number of machines. Roles might
# include such things as :web, or :app, or :db, defining what the purpose of each machine is. You
# can also specify options that can be used to single out a specific subset of boxes in a
# particular role, like :primary => true.

task :production do
  role :web, "172.16.17.32:7004" # merb_background [mongrel] [], call_player [mongrel] [], api [mongrel] [], gts [mongrel] [], jobs [mongrel] []
  role :app, "172.16.17.32:7004", :mongrel => true
  role :db , "172.16.17.32:7004", :primary => true
  set :rails_env, "production"
  set :environment_database, defer { production_database }
  set :environment_dbhost, defer { production_dbhost }
end
task :staging do
  role :web, "192.168.127.12:7000" # g5searchmarketing [mongrel] [g5search-db-master], merb_background [mongrel] [], call_player [mongrel] [], api [mongrel] [], gts [mongrel] [], jobs [mongrel] []
  role :app, "192.168.127.12:7000", :mongrel => true
  role :db , "192.168.127.12:7000", :primary => true
  set :rails_env, "staging"
  set :environment_database, defer { staging_database }
  set :environment_dbhost, defer { staging_dbhost }
end

# Do not change below unless you know what you are doing!
after "deploy", "deploy:cleanup"
after "deploy:migrations" , "deploy:cleanup"
# uncomment the following to have a database backup done before every migration
# before "deploy:migrate", "db:dump"<commit_msg>using config file for logins<commit_after># For complete deployment instructions, see the following support guide:
# http://www.engineyard.com/support/guides/deploying_your_application_with_capistrano

require "eycap/recipes"
require "config/developers/logins" if File.exist?("config/developers/logins.rb")

# Servers
DEMO    = "192.168.127.12:7000"
STAGING = "192.168.3.11:7000"
PROD1   = "172.16.17.32:7002"
PROD2   = "172.16.17.32:7003"
UTIL1   = "172.16.17.32:7004"
API     = "172.16.58.3:7000"
URANUS  = "172.16.31.10"
JOBS    = "172.16.58.3:7001"

# =================================================================================================
# ENGINE YARD REQUIRED VARIABLES
# =================================================================================================
# You must always specify the application and repository for every recipe. The repository must be
# the URL of the repository you want this recipe to correspond to. The :deploy_to variable must be
# the root of the application.

set :keep_releases,       5
set :application,         "translatable"
set :user,                "g5search"
set :password,            <PASSWORD>
set :deploy_to,           "/data/#{application}"
set :monit_group,         "translatable"
set :runner,              "g5search"
set :repository,          "<EMAIL>:perry3819/translatable.git"
set :scm,                 :git
set :staging_host_name,     "real-staging.g5search.com"


# This will execute the Git revision parsing on the *remote* server rather than locally
set :real_revision,       lambda { source.query_revision(revision) { |cmd| capture(cmd) } }

# comment out if it gives you trouble. newest net/ssh needs this set.
ssh_options[:paranoid] = false

before :deploy, :set_branch
before 'deploy:long', :set_branch

# comment out if it gives you trouble. newest net/ssh needs this set.
ssh_options[:paranoid] = false

task :set_branch do
  unless exists? :branch
    default_tag = fetch(:default_branch) if exists? :default_branch
    default_tag ||= `git tag`.split("\n").last
    tag = Capistrano::CLI.ui.ask "(Tag|Branch|Commit) to deploy [#{default_tag}]: "
    tag = default_tag if tag.empty?
    set( :branch, tag )
    set( :newrelic_revision, tag ) if tag[0,1] == 'v'
  end
end

# =================================================================================================
# ROLES
# =================================================================================================
# You can define any number of roles, each of which contains any number of machines. Roles might
# include such things as :web, or :app, or :db, defining what the purpose of each machine is. You
# can also specify options that can be used to single out a specific subset of boxes in a
# particular role, like :primary => true.

task :production do
  role :web, UTIL1 # merb_background [mongrel] [], call_player [mongrel] [], api [mongrel] [], gts [mongrel] [], jobs [mongrel] []
  role :app, UTIL1, :mongrel => true
  role :db , "172.16.17.32:7004", :primary => true
  set :rails_env, "production"
end

task :staging do
  role :web, STAGING
  role :app, STAGING, :mongrel => true,
end

# Do not change below unless you know what you are doing!
after "deploy", "deploy:cleanup"
# uncomment the following to have a database backup done before every migration
# before "deploy:migrate", "db:dump"
{'fraction_non_alphanumeric': 0.21564513711973626, 'fraction_numerical': 0.03356811029521954, 'mean_word_length': 4.598993288590604, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 15, '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': '6911626', 'n_tokens_mistral': 2105, 'n_tokens_neox': 1909, 'n_words': 631}