Skip to content

Commit

Permalink
chore: update to otp 26, elixir 15
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck committed Jan 4, 2024
1 parent d68edc1 commit 9637909
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 65 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/on_push_branch__execute_ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# Currently, this need to be synced manually with the Dockerfile. In the future, the workflow should be changed,
# so that a development container is built from the Dockerfile, pushed, and then re-used in the following steps.
# This would also remove the need to install cmake manually in each step:
container: hexpm/elixir:1.13.4-erlang-24.3.4.15-debian-bullseye-20231009-slim
container: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bullseye-20230612-slim

steps:
# See https://github.com/actions/checkout
Expand All @@ -37,7 +37,7 @@ jobs:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: hexpm/elixir:1.13.4-erlang-24.3.4.15-debian-bullseye-20231009-slim
container: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bullseye-20230612-slim

needs: build_deps

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

check_mix_format:
runs-on: ubuntu-latest
container: hexpm/elixir:1.13.4-erlang-24.3.4.15-debian-bullseye-20231009-slim
container: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bullseye-20230612-slim

needs: build_deps

Expand All @@ -107,7 +107,7 @@ jobs:

check_mix_gettext_extract_up_to_date:
runs-on: ubuntu-latest
container: hexpm/elixir:1.13.4-erlang-24.3.4.15-debian-bullseye-20231009-slim
container: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bullseye-20230612-slim

needs: build_deps

Expand All @@ -127,7 +127,7 @@ jobs:

check_mix_sobelow:
runs-on: ubuntu-latest
container: hexpm/elixir:1.13.4-erlang-24.3.4.15-debian-bullseye-20231009-slim
container: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bullseye-20230612-slim

needs: build_deps

Expand All @@ -143,4 +143,4 @@ jobs:

- run: mix do local.hex --force, local.rebar --force
- run: mix compile
- run: mix sobelow --config
- run: mix sobelow --config
2 changes: 1 addition & 1 deletion .github/workflows/on_push_main_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Create and publish a Docker image
# Configures this workflow to run every time a change is pushed to the branch called `master`.
on:
push:
branches: ["master"]
branches: ["master", "216-chore-upgrarde-elixir-otp-and-the-necessary-dependencies"]
release:
types: [published]

Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# - https://pkgs.org/ - resource for finding needed packages
# - Ex: hexpm/elixir:1.13.1-erlang-24.2-debian-bullseye-20210902-slim
#
ARG ELIXIR_VERSION=1.13.4
ARG OTP_VERSION=24.3.4.15
ARG DEBIAN_VERSION=bullseye-20231009-slim
ARG ELIXIR_VERSION=1.15.2
ARG OTP_VERSION=26.0.2
ARG DEBIAN_VERSION=bullseye-20230612-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
Expand All @@ -38,6 +38,7 @@ RUN apt-get update && apt-get install -y nodejs \
build-essential \
inotify-tools \
postgresql-client \
ca-certificates \
git \
cmake && \
apt-get clean && \
Expand Down Expand Up @@ -107,7 +108,7 @@ RUN mix release
# the compiled release and other runtime necessities
FROM ${RUNNER_IMAGE} as production

RUN apt-get update -y && apt-get install -y libstdc++6 postgresql-client openssl libncurses5 locales \
RUN apt-get update -y && apt-get install -y ca-certificates libstdc++6 postgresql-client openssl libncurses5 locales \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*

# Set the locale
Expand Down
2 changes: 1 addition & 1 deletion config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config :mindwendel, MindwendelWeb.Endpoint,
secret_key_base = System.get_env("SECRET_KEY_BASE")

unless secret_key_base do
Logger.warn(
Logger.warning(
"Environment variable SECRET_KEY_BASE is missing. You can generate one by calling: mix phx.gen.secret"
)
end
Expand Down
22 changes: 15 additions & 7 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ require Logger

if config_env() != :test do
unless System.get_env("DATABASE_URL") do
Logger.warn(
Logger.warning(
"Environment variable DATABASE_URL is missing, e.g. Database_URL=ecto://USER:PASS@HOST/DATABASE"
)
end

unless System.get_env("DATABASE_HOST") do
Logger.warn(
Logger.warning(
"Environment variable DATABASE_HOST is missing, e.g. DATABASE_HOST=localhost or DATABASE_HOST=postgres"
)
end

unless System.get_env("DATABASE_NAME") do
Logger.warn("Environment variable DATABASE_NAME is missing, e.g. DATABASE_NAME=mindwendel")
Logger.warning("Environment variable DATABASE_NAME is missing, e.g. DATABASE_NAME=mindwendel")
end

unless System.get_env("DATABASE_USER") do
Logger.warn(
Logger.warning(
"Environment variable DATABASE_USER is missing, e.g. DATABASE_USER=mindwendel_user"
)
end

unless System.get_env("DATABASE_USER_PASSWORD") do
Logger.warn(
Logger.warning(
"Environment variable DATABASE_USER_PASSWORD is missing, e.g. DATABASE_USER_PASSWORD=mindwendel_user_password"
)
end
Expand All @@ -41,9 +41,17 @@ if config_env() != :test do
username: System.get_env("DATABASE_USER"),
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
port: String.to_integer(System.get_env("DATABASE_PORT", "5432")),
ssl: System.get_env("DATABASE_SSL", "true") == "true",
url: System.get_env("DATABASE_URL"),
timeout: String.to_integer(System.get_env("DATABASE_TIMEOUT", "15000"))
timeout: String.to_integer(System.get_env("DATABASE_TIMEOUT", "15000")),
ssl: System.get_env("DATABASE_SSL", "true") == "true",
ssl_opts: [
verify: :verify_peer,
cacerts: :public_key.cacerts_get(),
server_name_indication: String.to_charlist(System.get_env("DATABASE_HOST")),
customize_hostname_check: [
match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
]
]

secret_key_base =
System.get_env("SECRET_KEY_BASE") ||
Expand Down
4 changes: 2 additions & 2 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ config :mindwendel, MindwendelWeb.Endpoint,
secret_key_base: "tYWGCQJLcTAYCJ9X9sNj022JQkTkh0ryuPO+ImBLBIFJwcfrm0+gIdryq9QTUUIM"

# Print only warnings and errors during test
config :logger, level: :warn
config :logger, level: :warning

# See https://github.com/phoenixframework/phoenix/blob/v1.5/CHANGELOG.md#1510-2021-08-06
config :phoenix, :plug_init_mode, :runtime

config :gettext, :default_locale, "en"
config :timex, :default_locale, "en"

config :mindwendel, Oban, repo: Mindwendel.Repo, queues: false, plugins: false
config :mindwendel, Oban, repo: Mindwendel.Repo, testing: :inline
2 changes: 1 addition & 1 deletion docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:
# If you do not have another postgres database service in this docker-compose, you can add this postgres service.
# Note: Please use other credentials when using this in production.
postgres_prod:
image: postgres:12-alpine
image: postgres:15
# Pass config parameters to the postgres server.
# Find more information below when you need to generate the ssl-relevant file your self
command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
- /app/assets/node_modules

postgres:
image: postgres:12-alpine
image: postgres:15
environment:
PGDATA: /var/lib/postgresql/data/pgdata
# IMPORTANT: Do not use these credentials in production. Please use other credentials when deploying this in production
Expand Down
28 changes: 14 additions & 14 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ defmodule Mindwendel.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "1.6.15"},
{:phoenix_ecto, "4.4.0"},
{:phoenix, "1.6.16"},
{:phoenix_ecto, "4.4.3"},
{:phoenix_html, "3.2.0"},
{:phoenix_live_dashboard, "0.7.2"},
{:phoenix_live_reload, "1.3.3", only: :dev},
{:phoenix_live_view, "0.18.3"},
{:esbuild, "0.5.0", runtime: Mix.env() == :dev},
{:dart_sass, "0.5.1", runtime: Mix.env() == :dev},
{:bypass, "~> 2.1", only: :test},
{:csv, "~> 2.4"},
{:ecto_sql, "3.8.3"},
{:floki, ">= 0.27.0"},
{:gettext, "0.20.0"},
{:httpoison, "~> 1.7"},
{:jason, "1.4.0"},
{:oban, "2.12.1"},
{:plug_cowboy, "~> 2.0"},
{:postgrex, "0.16.5"},
{:sobelow, "~> 0.8", only: :dev},
{:bypass, "2.1.0", only: :test},
{:csv, "2.5.0"},
{:ecto_sql, "3.11.1"},
{:floki, "0.35.2"},
{:gettext, "0.24.0"},
{:httpoison, "2.2.1"},
{:jason, "1.4.1"},
{:oban, "2.17.1"},
{:plug_cowboy, "2.6.1"},
{:postgrex, "0.17.4"},
{:sobelow, "0.13.0", only: :dev},
{:telemetry_metrics, "0.6.1"},
{:telemetry_poller, "1.0.0"},
{:timex, "3.7.8"}
{:timex, "3.7.11"}
]
end

Expand Down
Loading

0 comments on commit 9637909

Please sign in to comment.