Skip to content

Commit

Permalink
chore: Upgrade phoenix to 1.4 and elixir 1.8 (#4557)
Browse files Browse the repository at this point in the history
  • Loading branch information
joladev authored and NateBrady23 committed Mar 18, 2019
1 parent f7f6b6c commit 87fc55e
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -102,3 +102,7 @@ build/

# haskell
.stack-work

# Elixir
_build/
deps/
5 changes: 5 additions & 0 deletions frameworks/Elixir/phoenix/.formatter.exs
@@ -0,0 +1,5 @@
[
import_deps: [:ecto, :phoenix],
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
subdirectories: ["priv/*/migrations"]
]
1 change: 1 addition & 0 deletions frameworks/Elixir/phoenix/.gitignore
@@ -0,0 +1 @@
.elixir_ls/
7 changes: 6 additions & 1 deletion frameworks/Elixir/phoenix/config/config.exs
Expand Up @@ -5,6 +5,11 @@
# is restricted to this project.
use Mix.Config

config :phoenix, :json_library, Jason

config :hello,
ecto_repos: [Hello.Repo]

# Configures the endpoint
config :hello, Hello.Endpoint,
url: [host: "localhost"],
Expand All @@ -21,4 +26,4 @@ config :logger, :console,

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env}.exs"
import_config "#{Mix.env()}.exs"
1 change: 0 additions & 1 deletion frameworks/Elixir/phoenix/config/dev.exs
Expand Up @@ -23,7 +23,6 @@ config :hello, Hello.Endpoint,
]

config :hello, Hello.Repo,
adapter: Ecto.Adapters.Postgres,
username: "benchmarkdbuser",
password: "benchmarkdbpass",
database: "hello_world",
Expand Down
14 changes: 7 additions & 7 deletions frameworks/Elixir/phoenix/config/prod.exs
Expand Up @@ -10,18 +10,18 @@ config :hello, Hello.Endpoint,
server: true

config :hello, Hello.Repo,
adapter: Ecto.Adapters.Postgres,
username: "benchmarkdbuser",
password: "benchmarkdbpass",
database: "hello_world",
hostname: "tfb-database",
pool_size: 256,
loggers: []
pool_size: 256

config :logger,
compile_time_purge_level: :error,
level: :error,
backends: []
config :logger,
compile_time_purge_matching: [
[level_lower_than: :error]
],
level: :error,
backends: []

# ## SSL Support
#
Expand Down
1 change: 1 addition & 0 deletions frameworks/Elixir/phoenix/config/test.exs
@@ -0,0 +1 @@
use Mix.Config
2 changes: 1 addition & 1 deletion frameworks/Elixir/phoenix/lib/hello/repo.ex
@@ -1,3 +1,3 @@
defmodule Hello.Repo do
use Ecto.Repo, otp_app: :hello
use Ecto.Repo, otp_app: :hello, adapter: Ecto.Adapters.Postgres
end
35 changes: 19 additions & 16 deletions frameworks/Elixir/phoenix/mix.exs
Expand Up @@ -2,14 +2,15 @@ defmodule Hello.Mixfile do
use Mix.Project

def project do
[app: :hello,
version: "0.1.0",
elixir: "~> 1.6.5",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps()]
[
app: :hello,
version: "0.1.0",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
deps: deps()
]
end

# Configuration for the OTP application
Expand All @@ -25,13 +26,15 @@ defmodule Hello.Mixfile do
#
# Type `mix help deps` for examples and options
defp deps do
[{:phoenix, "1.3.2"},
{:phoenix_ecto, "3.3.0"},
{:postgrex, "0.13.3"},
{:cowboy, "1.0.0"},
{:plug_cowboy, "1.0.0"},
{:jason, "1.0.0"},
{:phoenix_html, "2.11.0"},
{:phoenix_live_reload, "1.1.0", only: :dev}]
[
{:phoenix, "~> 1.4.0"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.0"},
{:postgrex, "~> 0.14"},
{:plug_cowboy, "~> 2.0"},
{:jason, "~> 1.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev}
]
end
end
4 changes: 2 additions & 2 deletions frameworks/Elixir/phoenix/phoenix.dockerfile
@@ -1,4 +1,4 @@
FROM elixir:1.6.5
FROM elixir:1.8.1

ADD ./ /phoenix
WORKDIR /phoenix
Expand All @@ -10,4 +10,4 @@ RUN mix local.rebar --force
RUN mix deps.get --force --only prod
RUN mix compile --force

CMD ["elixir", "--erl", "+K true +sbwt very_long +swt very_low", "-S", "mix", "phoenix.server"]
CMD ["elixir", "--erl", "+K true +sbwt very_long +swt very_low", "-S", "mix", "phx.server"]

0 comments on commit 87fc55e

Please sign in to comment.