<commit_before>$:.unshift(File.expand_path('../lib', File.dirname(__FILE__))).uniq!
require 'capistrano/ext/multistage'
require 'capistrano/helpers'
require 'bundler/capistrano'

extend Capistrano::Helpers::Prompts
extend Capistrano::Helpers::SiteConfig

default_run_options[:pty] = true
set :application, "TriSano"
set :deploy_to, "/opt/csi/#{application}"

set :repository, "."
set :scm, :none
set :deploy_via, :copy
set :copy_exclude, [".git", "log"]
set :copy_compression, :zip

depend :remote, :command, "rake"
depend :remote, :command, "bundle"

after 'deploy:update_code', 'deploy:update_database_yml'
after 'deploy:update_code', 'deploy:update_site_config_yml'

before 'deploy:migrate', "deploy:dump_db"
before "deploy:rollback",  "deploy:restore_db"

namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  task :update_database_yml, :roles => :app do
    require 'erb'<commit_msg>Use sudo and brianb for deployment<commit_after>$:.unshift(File.expand_path('../lib', File.dirname(__FILE__))).uniq!
require 'capistrano/ext/multistage'
require 'capistrano/helpers'
require 'bundler/capistrano'

extend Capistrano::Helpers::Prompts
extend Capistrano::Helpers::SiteConfig

default_run_options[:pty] = true
set :application, "TriSano"
set :deploy_to, "/opt/csi/#{application}"
set :user, "brianb"
set :use_sudo, true
set :repository, "."
set :scm, :none
set :deploy_via, :copy
set :copy_exclude, [".git", "log"]
set :copy_compression, :zip

depend :remote, :command, "rake"
depend :remote, :command, "bundle"

after 'deploy:update_code', 'deploy:update_database_yml'
after 'deploy:update_code', 'deploy:update_site_config_yml'

before 'deploy:migrate', "deploy:dump_db"
before "deploy:rollback",  "deploy:restore_db"

namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  task :update_database_yml, :roles => :app do
    require 'erb'
{'fraction_non_alphanumeric': 0.1576036866359447, 'fraction_numerical': 0.0, 'mean_word_length': 6.4604810996563575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '627234', 'n_tokens_mistral': 799, 'n_tokens_neox': 770, 'n_words': 182}