<commit_before>namespace :deploy do
  DEPLOYABLE_ENV = %w(production staging)

  desc "Deploy Rails app"
  task :rails do
    remote %w[app:update app:restart app:warm], app_servers
  end

  desc "Deploy Rails app, update and compile static assets"
  task :app do
    remote %w[app:update app:bower app:jammit app:restart app:warm], app_servers
  end

  desc "Deploy and migrate the database, then restart CloudCrowd"
  task :full do
    invoke "deploy:cluster"
    invoke "deploy:app"
    # invoke "deploy:search" # Solr is behaving badly, deploy manually for now
    invoke "deploy:workers"
  end

  desc "Deploy Rails app to CloudCrowd server, migrate database, and restart CloudCrowd"
  task :cluster do
    remote %w[app:update db:migrate crowd:server:restart], central_servers
  end

  desc "Deploy Rails app to workers and restart CloudCrowd nodes"
  task :workers do
    remote %w[app:update crowd:node:restart], worker_servers
  end

  desc "Deploy Rails app to search server and restart Solr"
  task :search do
    remote %w[app:update app:restart_solr], search_servers
  end

  desc "Deploy Cloud.Typography assets to production"
  task :webfonts do
    if Rails.env.production?
      FileUtils.cp_r("secrets/cloud_typography", "tmp/fonts")
      FileUtils.rm(['tmp/fonts/about_this_directory.txt'])
      upload_filetree("tmp/fonts/**/*.css", 'fonts', /^tmp\/fonts/)
      FileUtils.rm_r(['tmp/fonts'])
    else
      puts "Cloud.Typography only knows about our production CDN (assets.documentcloud.org)"
    end
  end

  namespace :embed do

    embeds = [
      { name:         :document,
        loader_dest:  'viewer/loader.js',
        asset_dir:    'viewer'
      },
      { name:         :page,
        loader_dest:  'embed/loader/enhance.js',
        asset_dir:    'embed/page'
      },
      { name:         :note,
        loader_dest:  'notes/loader.js',
        asset_dir:    'note_embed'
      },
      { name:         :search,
        loader_dest:  'embed/loader.js',
        asset_dir:    'search_embed'<commit_msg>Remove webfont deployment rake task<commit_after>namespace :deploy do
  DEPLOYABLE_ENV = %w(production staging)

  desc "Deploy Rails app"
  task :rails do
    remote %w[app:update app:restart app:warm], app_servers
  end

  desc "Deploy Rails app, update and compile static assets"
  task :app do
    remote %w[app:update app:bower app:jammit app:restart app:warm], app_servers
  end

  desc "Deploy and migrate the database, then restart CloudCrowd"
  task :full do
    invoke "deploy:cluster"
    invoke "deploy:app"
    # invoke "deploy:search" # Solr is behaving badly, deploy manually for now
    invoke "deploy:workers"
  end

  desc "Deploy Rails app to CloudCrowd server, migrate database, and restart CloudCrowd"
  task :cluster do
    remote %w[app:update db:migrate crowd:server:restart], central_servers
  end

  desc "Deploy Rails app to workers and restart CloudCrowd nodes"
  task :workers do
    remote %w[app:update crowd:node:restart], worker_servers
  end

  desc "Deploy Rails app to search server and restart Solr"
  task :search do
    remote %w[app:update app:restart_solr], search_servers
  end

  namespace :embed do

    embeds = [
      { name:         :document,
        loader_dest:  'viewer/loader.js',
        asset_dir:    'viewer'
      },
      { name:         :page,
        loader_dest:  'embed/loader/enhance.js',
        asset_dir:    'embed/page'
      },
      { name:         :note,
        loader_dest:  'notes/loader.js',
        asset_dir:    'note_embed'
      },
      { name:         :search,
        loader_dest:  'embed/loader.js',
        asset_dir:    'search_embed'
{'fraction_non_alphanumeric': 0.09620114785460508, 'fraction_numerical': 0.0, 'mean_word_length': 2.8977635782747604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '881045', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1162, 'n_words': 339}