<commit_before># load Rails for env vars
require File.expand_path('../application', __FILE__)
require "bundler/capistrano"
require "sidekiq/capistrano"
require "opbeat/capistrano"
set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"
# require 'capistrano/maintenance'

set :bundle_flags,   "--deployment --verbose --without development test"

set :rails_env, "production"
set :recipes, "config/recipes"
# monit varnish redis
%w(varnish memcached monit base postgresql sidekiq redis logs figaro blacklist nginx logs unicorn nodejs rbenv security check mosh).each do |r|
  load "#{recipes}/#{r}"
end

server ENV['APP_SERVER'], :web, :app, :db, primary: true
# 192.168.127.12
# server "sagan.fablabs.io", :db

set :port, ENV['SSH_PORT']
set :application, "fablabs"
set :user, ENV['DEPLOY_USER']
set :password, ENV['DEPLOY_<PASSWORD>']
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :rake, "#{rake} --trace"
set :scm, "git"
set :repository, "<EMAIL>:fablabbcn/#{application}.git"
set :branch, "master"
set :default_environment, {
  'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}

default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :maintenance_template_path, File.expand_path("../recipes/templates/maintenance.html.erb", __FILE__)

# after "deploy", "refresh_sitemaps"
# task :refresh_sitemaps do
#   run "cd #{latest_release} && RAILS_ENV=#{rails_env} bundle exec rake sitemap:refresh"
# end

after "deploy", "deploy:migrate", "deploy:cleanup" # keep only the last 5 releases

before "bower:install", "bower:symlink"<commit_msg>Use the branch specified as a param, then use the current branch. If all fails use master branch<commit_after># load Rails for env vars
require File.expand_path('../application', __FILE__)
require "bundler/capistrano"
require "sidekiq/capistrano"
require "opbeat/capistrano"
set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"
# require 'capistrano/maintenance'

set :bundle_flags,   "--deployment --verbose --without development test"

set :rails_env, "production"
set :recipes, "config/recipes"
# monit varnish redis
%w(varnish memcached monit base postgresql sidekiq redis logs figaro blacklist nginx logs unicorn nodejs rbenv security check mosh).each do |r|
  load "#{recipes}/#{r}"
end

server ENV['APP_SERVER'], :web, :app, :db, primary: true
# 192.168.127.12
# server "sagan.fablabs.io", :db

set :port, ENV['SSH_PORT']
set :application, "fablabs"
set :user, ENV['DEPLOY_USER']
set :password, ENV['DEPLOY_PASS']
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :rake, "#{rake} --trace"
set :scm, "git"
set :repository, "<EMAIL>:fablabbcn/#{application}.git"


# use the branch specified as a param, then use the current branch. If all fails use master branch
current_branch = `git branch`.match(/\* (\S+)\s/m)[1]
set :branch, ENV['branch'] || current_branch || "master" # you can use the 'branch' parameter on deployment to specify the branch you wish to deploy

set :default_environment, {
  'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}

default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :maintenance_template_path, File.expand_path("../recipes/templates/maintenance.html.erb", __FILE__)

# after "deploy", "refresh_sitemaps"
# task :refresh_sitemaps do
#   run "cd #{latest_release} && RAILS_ENV=#{rails_env} bundle exec rake sitemap:refresh"
# end

after "deploy", "deploy:migrate", "deploy:cleanup" # keep only the last 5 releases

before "bower:install", "bower:symlink"
{'fraction_non_alphanumeric': 0.14431006047278724, 'fraction_numerical': 0.006871907641561297, 'mean_word_length': 5.998076923076923, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3692581', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1255, 'n_words': 352}