<commit_before>
require 'standarized_deploy/common'

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
  _cset(:staging_app_key) do
    abort "Please specify :staging_app_key corresponding to your server, set :staging_app_key, 'foo'"
  end

  _cset(:staging_app_domain) do
    abort "Please specify :staging_app_domain corresponding to your server, set :staging_app_domain, 'foo.bar.com'"
  end

  _cset(:staging_restart_workers)   { false }
  _cset(:staging_clear_redis_cache) { false }

  task :staging do
    ssh_options[:forward_agent] = true
    set :rvm_ruby_string, 'default'
    set :scm, :git
    set :scm_verbose, true
    set :git_enable_submodules, 1
    set :deploy_via, :remote_cache
    set :use_sudo, false
    set :application, staging_app_domain
    role :app, staging_app_domain
    role :web, staging_app_domain
    role :db, staging_app_domain, :primary => true
    default_environment['LANG']     = 'en_US.UTF-8'
    default_environment['LANGUAGE'] = 'en_US'
    default_environment['LC_ALL']   = 'en_US.UTF-8'

    set :rvm_ruby_string, 'default'
    set :rvm_type, :system

    set :user, staging_app_key
    set :deploy_to,  "/home/#{user}"

    set :branch do
      current_branch = %x[ git branch | grep ^* | awk {'print $2'} ].chomp

      branch = Capistrano::CLI.ui.ask "Branch to deploy (make sure to push the branch first): [#{current_branch}] "
      branch = current_branch if branch.empty?
      branch
    end<commit_msg>rails_env defaults to production<commit_after>
require 'standarized_deploy/common'

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
  _cset(:staging_app_key) do
    abort "Please specify :staging_app_key corresponding to your server, set :staging_app_key, 'foo'"
  end

  _cset(:staging_app_domain) do
    abort "Please specify :staging_app_domain corresponding to your server, set :staging_app_domain, 'foo.bar.com'"
  end

  _cset(:staging_restart_workers)   { false }
  _cset(:staging_clear_redis_cache) { false }

  _cset(:rails_env) { 'production' }

  task :staging do
    ssh_options[:forward_agent] = true
    set :rvm_ruby_string, 'default'
    set :scm, :git
    set :scm_verbose, true
    set :git_enable_submodules, 1
    set :deploy_via, :remote_cache
    set :use_sudo, false
    set :application, staging_app_domain
    role :app, staging_app_domain
    role :web, staging_app_domain
    role :db, staging_app_domain, :primary => true
    default_environment['LANG']     = 'en_US.UTF-8'
    default_environment['LANGUAGE'] = 'en_US'
    default_environment['LC_ALL']   = 'en_US.UTF-8'

    set :rvm_ruby_string, 'default'
    set :rvm_type, :system

    set :user, staging_app_key
    set :deploy_to,  "/home/#{user}"

    set :branch do
      current_branch = %x[ git branch | grep ^* | awk {'print $2'} ].chomp

      branch = Capistrano::CLI.ui.ask "Branch to deploy (make sure to push the branch first): [#{current_branch}] "
      branch = current_branch if branch.empty?
      branch
    end
{'fraction_non_alphanumeric': 0.10726429675425038, 'fraction_numerical': 0.002472952086553323, 'mean_word_length': 4.128367670364501, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1344275', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1084, 'n_words': 258}