diff --git a/Dockerfile b/Dockerfile index 37f391be..3ab6d464 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,9 +62,9 @@ RUN apk add --no-cache chromium --repository=http://dl-cdn.alpinelinux.org/alpin ARG MIX_ENV -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR "/app" RUN chown nobody /app diff --git a/lib/mix/tasks/seed.ex b/lib/mix/tasks/seed.ex index f854a48e..fd6fec69 100644 --- a/lib/mix/tasks/seed.ex +++ b/lib/mix/tasks/seed.ex @@ -9,7 +9,6 @@ defmodule Mix.Tasks.Seed do @impl Mix.Task def run(_args) do Mix.Task.run("app.start", ["--preload-modules"]) - Faker.start() :ok = contato_seeds() :ok = usuario_seeds() diff --git a/lib/pescarte/application.ex b/lib/pescarte/application.ex index 8d3b37e2..4b69ea64 100644 --- a/lib/pescarte/application.ex +++ b/lib/pescarte/application.ex @@ -21,9 +21,7 @@ defmodule Pescarte.Application do :ok end - defp children do - if Pescarte.env() == :dev, do: Faker.start() - + def children do [ Pescarte.Database.Supervisor, PescarteWeb.Telemetry, diff --git a/lib/seeder/identidades/contato.ex b/lib/seeder/identidades/contato.ex index 9a3ecbe7..c3430460 100644 --- a/lib/seeder/identidades/contato.ex +++ b/lib/seeder/identidades/contato.ex @@ -7,28 +7,28 @@ defmodule Seeder.Identidades.Contato do [ %Contato{ email_principal: "dev.admin@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "943 Schuppe Row Suite 906", + celular_principal: "(63) 5906-7216" }, %Contato{ email_principal: "dev.user@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "99981 Nicolas Orchard Apt. 060", + celular_principal: "(62) 9 0254-9051" }, %Contato{ email_principal: "dev.user1@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "2 Shanny Shore Apt. 674", + celular_principal: "(71) 3570-5710" }, %Contato{ email_principal: "dev.user2@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "74132 Alessandra Place Apt. 299", + celular_principal: "(86) 9 4994-3367" }, %Contato{ email_principal: "dev.user3@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "6864 Suzanne Overpass Apt. 273", + celular_principal: "(92) 4225-7846" } ] end diff --git a/lib/seeder/modulo_pesquisa/campus.ex b/lib/seeder/modulo_pesquisa/campus.ex index eff10e0c..03dc1b85 100644 --- a/lib/seeder/modulo_pesquisa/campus.ex +++ b/lib/seeder/modulo_pesquisa/campus.ex @@ -9,13 +9,13 @@ defmodule Seeder.ModuloPesquisa.Campus do acronimo: "UENF", nome: "Campos dos Goytacazes", nome_universidade: "Universidade Estadual do Norte Fluminense Darcy Ribeiro", - endereco: Faker.Address.street_address(true) + endereco: "57 Georgette Hill Apt. 898" }, %Campus{ acronimo: "UFSCar", nome: "Sorocaba", nome_universidade: "Universidade Federal de São Carlos", - endereco: Faker.Address.street_address(true) + endereco: "8 Morris Inlet Suite 355" } ] end diff --git a/lib/seeder/modulo_pesquisa/linha_pesquisa.ex b/lib/seeder/modulo_pesquisa/linha_pesquisa.ex index 0433e8ff..176cea96 100644 --- a/lib/seeder/modulo_pesquisa/linha_pesquisa.ex +++ b/lib/seeder/modulo_pesquisa/linha_pesquisa.ex @@ -14,26 +14,27 @@ defmodule Seeder.ModuloPesquisa.LinhaPesquisa do [ %LinhaPesquisa{ numero: 1, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: + "Praesentium architecto est fugit modi repudiandae amet architecto dolorem corrupti voluptas consequatur eveniet?", + desc_curta: "Velit qui repellat sunt harum.", nucleo_pesquisa: nucleo_pesquisa_by(letra: "A") }, %LinhaPesquisa{ numero: 2, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: "Debitis culpa ex accusamus sequi?", + desc_curta: "Aliquam dolores.", nucleo_pesquisa: nucleo_pesquisa_by(letra: "B") }, %LinhaPesquisa{ numero: 3, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: "Aspernatur repudiandae rerum.", + desc_curta: "Natus commodi provident sint et recusandae!", nucleo_pesquisa: nucleo_pesquisa_by(letra: "C") }, %LinhaPesquisa{ numero: 4, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: "Voluptatem est rerum sit quia aut autem vero esse odit est quam optio quo dolor?", + desc_curta: "Minus.", nucleo_pesquisa: nucleo_pesquisa_by(letra: "D") } ] diff --git a/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex b/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex index a34af06c..88279e4f 100644 --- a/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex +++ b/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex @@ -7,23 +7,24 @@ defmodule Seeder.ModuloPesquisa.NucleoPesquisa do def entries do [ %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "Voluptatem eaque aliquam error.", + desc: "Provident libero aliquid impedit explicabo voluptatibus ea fugit atque!", letra: "A" }, %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "In tempore?", + desc: "Culpa vero est perferendis natus aut.", letra: "B" }, %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "Voluptatem nobis molestias.", + desc: "Cumque commodi odio illum distinctio consequatur?", letra: "C" }, %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "Sit qui nesciunt sint?", + desc: + "Non veritatis similique exercitationem similique expedita et eos corporis architecto.", letra: "D" } ] diff --git a/mix.exs b/mix.exs index 13c6a53b..7a8b7042 100644 --- a/mix.exs +++ b/mix.exs @@ -22,11 +22,15 @@ defmodule Pescarte.MixProject do ] end + def cli do + [preferred_envs: [seed: :test]] + end + def application do [mod: {Pescarte.Application, []}, extra_applications: [:logger]] end - defp elixirc_paths(e) when e in [:dev, :test], do: ["lib", "test/support"] + defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp deps do @@ -74,7 +78,7 @@ defmodule Pescarte.MixProject do {:phoenix_html_helpers, "~> 1.0"}, {:nimble_csv, "~> 1.1"}, {:sentry, "~> 10.2.0"}, - {:faker, "~> 0.18", only: [:dev, :test]}, + {:faker, "~> 0.18", only: :test}, {:dialyxir, "~> 1.3", only: [:dev], runtime: false}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false}, # {:ex_doc, "> 0.0.0", only: [:dev, :test], runtime: false},