Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criando estrutura inicial para app catalogo #120

Merged
merged 7 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ COPY mix.exs mix.lock ./

# copy all mix.exs from umbrella apps
# to corresponding folder
COPY apps/catalogo/mix.exs ./apps/catalogo/
COPY apps/cotacoes/mix.exs ./apps/cotacoes/
COPY apps/cotacoes_etl/mix.exs ./apps/cotacoes_etl/
COPY apps/database/mix.exs ./apps/database/
Expand All @@ -29,32 +30,34 @@ COPY apps/plataforma_digital_api/mix.exs ./apps/plataforma_digital_api/
COPY apps/proxy_web/mix.exs ./apps/proxy_web/
COPY apps/seeder/mix.exs ./apps/seeder/


RUN mix deps.get --only $MIX_ENV
RUN mix deps.compile

# to be re-compiled.
COPY config/config.exs config/${MIX_ENV}.exs config/

# compile assets
# compile static and dynamic assets
COPY apps/plataforma_digital/priv ./apps/plataforma_digital/priv
COPY apps/plataforma_digital/assets ./apps/plataforma_digital/assets
RUN ["npm", "ci", "--prefix", "./apps/plataforma_digital/assets/"]
RUN mix assets.deploy

# copy source code and static files
COPY apps/catalogo/lib ./apps/catalogo/lib
COPY apps/cotacoes/lib ./apps/cotacoes/lib
COPY apps/cotacoes_etl/lib ./apps/cotacoes_etl/lib
COPY apps/database/lib ./apps/database/lib
COPY apps/seeder/lib ./apps/seeder/lib
COPY apps/proxy_web/lib ./apps/proxy_web/lib
COPY apps/identidades/lib ./apps/identidades/lib
COPY apps/modulo_pesquisa/lib ./apps/modulo_pesquisa/lib
COPY apps/plataforma_digital/lib ./apps/plataforma_digital/lib
COPY apps/plataforma_digital_api/lib ./apps/plataforma_digital_api/lib
COPY apps/proxy_web/lib ./apps/proxy_web/lib
COPY apps/seeder/lib ./apps/seeder/lib

COPY apps/cotacoes/priv ./apps/cotacoes/priv
COPY apps/identidades/priv ./apps/identidades/priv
COPY apps/modulo_pesquisa/priv ./apps/modulo_pesquisa/priv
COPY apps/plataforma_digital/priv ./apps/plataforma_digital/priv

# Compile the release
RUN mix compile
Expand Down
5 changes: 5 additions & 0 deletions apps/catalogo/.formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
import_deps: [:ecto, :ecto_sql],
subdirectories: ["priv/*/migrations"],
inputs: ["*.{ex,exs}", "{lib,test}/**/*.{ex,exs}", "priv/*/seeds.exs"]
]
26 changes: 26 additions & 0 deletions apps/catalogo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Temporary files, for example, from tests.
/tmp/

# Ignore package tarball (built via "mix hex.build").
identidades-*.tar
Empty file.
Empty file.
44 changes: 44 additions & 0 deletions apps/catalogo/mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
defmodule Catalogo.MixProject do
use Mix.Project

def project do
[
app: :catalogo,
version: "0.1.0",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases()
]
end

def application do
[extra_applications: [:logger, :runtime_tools]]
end

# Specifies which paths to compile per environment.
defp elixirc_paths(e) when e in ~w(dev test)a, do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]

defp deps do
[
{:ecto_sql, "~> 3.4"},
{:postgrex, ">= 0.0.0"},
{:ex_machina, "~> 2.7.0"},
{:database, in_umbrella: true}
]
end

defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/ecto_repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"]
]
end
end
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ defmodule Pescarte.MixProject do
paths = [
"apps/identidades/priv/repo/migrations",
"apps/modulo_pesquisa/priv/repo/migrations",
"apps/catalogo/priv/repo/migrations",
"apps/cotacoes/priv/repo/migrations"
]

Expand Down
Loading