<commit_before>lock '3.2.1'

set :repo_url, "<EMAIL>:idhmc-tamu/emop-dashboard.git"
set :scm, :git
set :branch, :master

set :format, :pretty
set :log_level, :debug

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

set :linked_dirs, %w{
log
tmp/cache
tmp/pids
tmp/sessions
tmp/sockets
vendor/bundle
}

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 :publishing, :restart

  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
    end
  end

  desc 'Run db:seed'
  task :seed do
    on roles(:db) do
      within release_path do
        with rails_env: fetch(:rails_env) do
          execute :rake, 'db:seed'
        end
      end
    end
  end

  after :migrate, :seed

  after :finish, :set_current_version do
    on roles(:app) do
      within release_path do
        execute :echo, "#{capture("cd #{repo_path} && git describe --tags --exact-match $(git rev-parse --short HEAD) > VERSION")} > VERSION"
      end
    end
  end

  desc "Upload config files"
  task :upload_configs do
    on roles(:app) do |server|
      fetch(:linked_files).each do |f|
        upload! File.join("config/deploy", fetch(:stage).to_s, f), File.join(shared_path, f)
      end<commit_msg>Fix deploy task that sets VERSION<commit_after>lock '3.2.1'

set :repo_url, "<EMAIL>:idhmc-tamu/emop-dashboard.git"
set :scm, :git
set :branch, :master

set :format, :pretty
set :log_level, :debug

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

set :linked_dirs, %w{
log
tmp/cache
tmp/pids
tmp/sessions
tmp/sockets
vendor/bundle
}

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 :publishing, :restart

  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
    end
  end

  desc 'Run db:seed'
  task :seed do
    on roles(:db) do
      within release_path do
        with rails_env: fetch(:rails_env) do
          execute :rake, 'db:seed'
        end
      end
    end
  end

  after :migrate, :seed

  after :set_current_revision, :set_current_version do
    on roles(:app) do
      within release_path do
        begin
          version = capture("cd #{repo_path} && git describe --tags #{fetch(:current_revision)}")
        rescue
        end
        if version
          execute :echo, "\"#{version.chomp}\" > VERSION"
        end
      end
    end
  end

  desc "Upload config files"
  task :upload_configs do
    on roles(:app) do |server|
      fetch(:linked_files).each do |f|
        upload! File.join("config/deploy", fetch(:stage).to_s, f), File.join(shared_path, f)
      end
{'fraction_non_alphanumeric': 0.11603243917654397, 'fraction_numerical': 0.004366812227074236, 'mean_word_length': 2.7729411764705882, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '2798446', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1097, 'n_words': 335}