<commit_before>require 'bundler/capistrano'
require 'capistrano/ext/multistage'

set :application, "ADAUsers"
set :repository,  "<EMAIL>:ANUSF/ADAUsers.git"

set :scm, :git
set :deploy_via, :remote_cache

default_run_options[:pty] = true
default_run_options[:tty] = true

ssh_options[:paranoid] = false
ssh_options[:port] = 22
ssh_options[:forward_agent] = true
ssh_options[:compression] = false

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

set(:branch) do
  Capistrano::CLI.ui.ask "Specify a tag name to deploy:"
end

namespace :db do
  task :seed, :roles => :app do
    run("cd #{current_release} && #{rake} db:seed RAILS_ENV=#{rails_env}")
  end
end


after 'deploy:setup', :create_extra_dirs
after 'deploy:setup', :copy_database_yml

before 'deploy:update_code', :echo_ruby_env

after 'deploy:update', :symlinks
after 'deploy:update', :deploy_log

desc "create additional shared directories during setup"
task :create_extra_dirs, :roles => :app do
  run "mkdir -m 0755 -p #{shared_path}/db"
end

desc "copy the database configuration to the server"
task :copy_database_yml, :roles => :app do
  prompt = "Specify a database configuration file to copy to the server:"
  path = Capistrano::CLI.ui.ask prompt
  put File.read("#{path}"), "#{shared_path}/database.yml", :mode => 0600
end

task :echo_ruby_env do
  puts "Checking ruby env ..."
  run "ruby -v"
  run "export RAILS_ENV='#{rails_env}'"
end

task :symlinks, :roles => :app do
  run "ln -nfs #{shared_path}/db/* #{current_path}/db/"
  run "ln -nfs #{shared_path}/database.yml #{current_path}/config/"
end

task :deploy_log, :roles => :app do
  run "touch #{current_path}/tmp/deploy-log.txt"
  run "echo \"Deployed at #{Time.now.strftime('%Y-%m-%d %I:%M')}\" > #{current_path}/tmp/deploy-log.txt"
end<commit_msg>Changed capistrano copy_database_yml task to copy_secrets, and symlink secrets.rb on deploy. For deployment, simply: cap copy_secrets; cap deploy<commit_after>require 'bundler/capistrano'
require 'capistrano/ext/multistage'

set :application, "ADAUsers"
set :repository,  "<EMAIL>:ANUSF/ADAUsers.git"

set :scm, :git
set :deploy_via, :remote_cache

default_run_options[:pty] = true
default_run_options[:tty] = true

ssh_options[:paranoid] = false
ssh_options[:port] = 22
ssh_options[:forward_agent] = true
ssh_options[:compression] = false

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

set(:branch) do
  Capistrano::CLI.ui.ask "Specify a tag name to deploy:"
end

namespace :db do
  task :seed, :roles => :app do
    run("cd #{current_release} && #{rake} db:seed RAILS_ENV=#{rails_env}")
  end
end


after 'deploy:setup', :create_extra_dirs
after 'deploy:setup', :copy_database_yml

before 'deploy:update_code', :echo_ruby_env

after 'deploy:update', :symlinks
after 'deploy:update', :deploy_log

desc "create additional shared directories during setup"
task :create_extra_dirs, :roles => :app do
  run "mkdir -m 0755 -p #{shared_path}/db"
end

desc "copy the secret configuration variables to the server"
task :copy_secrets, :roles => :app do
  prompt = "Specify a secrets.rb file to copy to the server:"
  path = Capistrano::CLI.ui.ask prompt
  put File.read("#{path}"), "#{shared_path}/secrets.rb", :mode => 0600
end

task :echo_ruby_env do
  puts "Checking ruby env ..."
  run "ruby -v"
  run "export RAILS_ENV='#{rails_env}'"
end

task :symlinks, :roles => :app do
  run "ln -nfs #{shared_path}/db/* #{current_path}/db/"
  run "ln -nfs #{shared_path}/secrets.rb #{current_path}/config/initializers/"
end

task :deploy_log, :roles => :app do
  run "touch #{current_path}/tmp/deploy-log.txt"
  run "echo \"Deployed at #{Time.now.strftime('%Y-%m-%d %I:%M')}\" > #{current_path}/tmp/deploy-log.txt"
end
{'fraction_non_alphanumeric': 0.14977533699450823, 'fraction_numerical': 0.004992511233150275, 'mean_word_length': 5.071212121212121, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '60114', 'n_tokens_mistral': 1505, 'n_tokens_neox': 1436, 'n_words': 396}