<commit_before>set :application, 'uk-postcodes'
set :repo_url, '<EMAIL>:theodi/uk-postcodes.git'
set :branch, 'master'

set :deploy_to, '/var/www/uk-postcodes'
set :scm, :git

set :linked_files, %w{config/database.yml}

# set :format, :pretty
# set :log_level, :debug
# set :pty, true

# set :linked_files, %w{config/database.yml}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# set :keep_releases, 5

# 
# namespace :foreman do
#   desc "Export the Procfile to Ubuntu's upstart scripts"
#   task :export, :roles => :app do
#     run "cd /var/uk-postcodes && sudo bundle exec foreman export upstart /etc/init -a uk-postcodes -u uk-postcodes -l /var/payrollapp/log"
#   end
#   
#   desc "Start the application services"
#   task :start, :roles => :app do
#     sudo "start uk-postcodes"
#   end
# 
#   desc "Stop the application services"
#   task :stop, :roles => :app do
#     sudo "stop uk-postcodes"
#   end
# 
#   desc "Restart the application services"
#   task :restart, :roles => :app do
#     run "sudo start uk-postcodes || sudo restart uk-postcodes"
#   end
# end
# 
# after "deploy:update", "foreman:export"
# after "deploy:update", "foreman:restart"

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      # Your restart mechanism here, for example:
      # execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # Here we can do anything such as:
      # within release_path do
      #   execute :rake, 'cache:clear'
      # end<commit_msg>Or maybe this?<commit_after>set :application, 'uk-postcodes'
set :repo_url, '<EMAIL>:theodi/uk-postcodes.git'
set :branch, 'master'

set :deploy_to, '/var/www/uk-postcodes'
set :scm, :git

#set :linked_files, %w{config/database.yml}

# set :format, :pretty
# set :log_level, :debug
# set :pty, true

# set :linked_files, %w{config/database.yml}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# set :keep_releases, 5


namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      foreman:export
      foreman:restart
    end
  end
  
  before :updated, :symlink_shared do
    on roles(:app) do
      execute "ln -s #{shared_path}/config/database.yml #{release_path}/config/database.yml"
    end
  end

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # Here we can do anything such as:
      # within release_path do
      #   execute :rake, 'cache:clear'
      # end
{'fraction_non_alphanumeric': 0.13657490168037184, 'fraction_numerical': 0.003575259206292456, 'mean_word_length': 3.4983922829581995, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4070509', 'n_tokens_mistral': 1033, 'n_tokens_neox': 987, 'n_words': 294}