<commit_before>use Bootleg.Config

role(
  :build,
  "signdict.org",
  user: System.get_env("bootleg_user"),
  workspace: "/tmp/bootleg/signdict/",
  silently_accept_hosts: true
)

task :download_ua_files do
  alias Bootleg.UI

  remote :build do
    "[ -d deps/phoenix ] && MIX_ENV=#{mix_env} mix ua_inspector.download --force || true"
  end

  UI.info("UserAgent database downloaded")
end

task :phoenix_digest do
  alias Bootleg.UI

  mix_env = Keyword.get(config(), :mix_env, "prod")

  remote :build, cd: "assets" do
    "yarn || true"
    "npm run deploy || true"
  end

  remote :build do
    "[ -d deps/phoenix ] && MIX_ENV=#{mix_env} mix phx.digest || true"
  end

  UI.info("Phoenix asset digest generated")
end

task :migrate do
  alias Bootleg.UI

  UI.info("Migrating database")

  remote :app, filter: [primary: true] do
    "bin/signdict migrate"
  end

  UI.info("Database migrated")
end

before_task(:compile, :download_ua_files)
after_task(:compile, :phoenix_digest)
before_task(:start, :migrate)<commit_msg>fixing download of user agent files<commit_after>use Bootleg.Config

role(
  :build,
  "signdict.org",
  user: System.get_env("bootleg_user"),
  workspace: "/tmp/bootleg/signdict/",
  silently_accept_hosts: true
)

task :download_ua_files do
  alias Bootleg.UI

  mix_env = Keyword.get(config(), :mix_env, "prod")

  remote :build do
    "[ -d deps/phoenix ] && MIX_ENV=#{mix_env} mix ua_inspector.download --force || true"
  end

  UI.info("UserAgent database downloaded")
end

task :phoenix_digest do
  alias Bootleg.UI

  mix_env = Keyword.get(config(), :mix_env, "prod")

  remote :build, cd: "assets" do
    "yarn || true"
    "npm run deploy || true"
  end

  remote :build do
    "[ -d deps/phoenix ] && MIX_ENV=#{mix_env} mix phx.digest || true"
  end

  UI.info("Phoenix asset digest generated")
end

task :migrate do
  alias Bootleg.UI

  UI.info("Migrating database")

  remote :app, filter: [primary: true] do
    "bin/signdict migrate"
  end

  UI.info("Database migrated")
end

after_task(:compile, :download_ua_files)
after_task(:compile, :phoenix_digest)
before_task(:start, :migrate)
{'fraction_non_alphanumeric': 0.13311382878645345, 'fraction_numerical': 0.0, 'mean_word_length': 4.052256532066508, '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': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2709575', 'n_tokens_mistral': 809, 'n_tokens_neox': 778, 'n_words': 192}