From 7886090c744eada6ac3af5b50c9dc5e1b2358c3a Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Wed, 13 Nov 2024 00:53:04 +0700 Subject: [PATCH] Update to Elixir 1.17.3 OTP 27.1.2 (#45) --- .github/workflows/main.yml | 4 ++-- Dockerfile | 6 +++--- config/releases.exs | 31 ------------------------------- config/runtime.exs | 33 +++++++++++++++++++++++++++++++++ mix.exs | 5 +++-- 5 files changed, 41 insertions(+), 38 deletions(-) delete mode 100644 config/releases.exs create mode 100644 config/runtime.exs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6c997c..1637de9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,8 +13,8 @@ jobs: - name: Install OTP and Elixir uses: erlef/setup-beam@v1 with: - otp-version: 25.3.1 - elixir-version: 1.14.2 + otp-version: 27.1.2 + elixir-version: 1.17.3 - name: Install dependencies run: | diff --git a/Dockerfile b/Dockerfile index 262bfca..68bbbbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM hexpm/elixir:1.14.2-erlang-25.3.1-alpine-3.17.3 as build +FROM hexpm/elixir:1.17.3-erlang-27.1.2-alpine-3.20.3 as build # install build dependencies RUN apk add --no-cache --update git @@ -30,8 +30,8 @@ COPY rel rel RUN mix release # prepare release image -FROM alpine:3.17.3 AS app -RUN apk add --no-cache --update bash openssl libstdc++ +FROM alpine:3.20.3 AS app +RUN apk add --no-cache --update bash openssl libgcc libstdc++ ncurses RUN mkdir /app WORKDIR /app diff --git a/config/releases.exs b/config/releases.exs deleted file mode 100644 index 1a40cc6..0000000 --- a/config/releases.exs +++ /dev/null @@ -1,31 +0,0 @@ -import Config - -config :hexdocs, - port: System.fetch_env!("HEXDOCS_PORT"), - hexpm_url: System.fetch_env!("HEXDOCS_HEXPM_URL"), - hexpm_secret: System.fetch_env!("HEXDOCS_HEXPM_SECRET"), - fastly_key: System.fetch_env!("HEXDOCS_FASTLY_KEY"), - fastly_hexdocs: System.fetch_env!("HEXDOCS_FASTLY_HEXDOCS"), - queue_id: System.fetch_env!("HEXDOCS_QUEUE_ID"), - session_key_base: System.fetch_env!("HEXDOCS_SESSION_KEY_BASE"), - session_signing_salt: System.fetch_env!("HEXDOCS_SESSION_SIGNING_SALT"), - session_encryption_salt: System.fetch_env!("HEXDOCS_SESSION_ENCRYPTION_SALT"), - queue_concurrency: String.to_integer(System.fetch_env!("HEXDOCS_QUEUE_CONCURRENCY")), - host: System.fetch_env!("HEXDOCS_HOST") - -config :hexdocs, :repo_bucket, name: System.fetch_env!("HEXDOCS_REPO_BUCKET") - -config :hexdocs, :docs_private_bucket, name: System.fetch_env!("HEXDOCS_DOCS_PRIVATE_BUCKET") - -config :hexdocs, :docs_public_bucket, name: System.fetch_env!("HEXDOCS_DOCS_PUBLIC_BUCKET") - -config :ex_aws, - access_key_id: System.fetch_env!("HEXDOCS_AWS_ACCESS_KEY_ID"), - secret_access_key: System.fetch_env!("HEXDOCS_AWS_ACCESS_KEY_SECRET") - -config :rollbax, - access_token: System.fetch_env!("HEXDOCS_ROLLBAR_ACCESS_TOKEN") - -config :kernel, - inet_dist_listen_min: String.to_integer(System.fetch_env!("BEAM_PORT")), - inet_dist_listen_max: String.to_integer(System.fetch_env!("BEAM_PORT")) diff --git a/config/runtime.exs b/config/runtime.exs new file mode 100644 index 0000000..bab3fe5 --- /dev/null +++ b/config/runtime.exs @@ -0,0 +1,33 @@ +import Config + +if config_env() == :prod do + config :hexdocs, + port: System.fetch_env!("HEXDOCS_PORT"), + hexpm_url: System.fetch_env!("HEXDOCS_HEXPM_URL"), + hexpm_secret: System.fetch_env!("HEXDOCS_HEXPM_SECRET"), + fastly_key: System.fetch_env!("HEXDOCS_FASTLY_KEY"), + fastly_hexdocs: System.fetch_env!("HEXDOCS_FASTLY_HEXDOCS"), + queue_id: System.fetch_env!("HEXDOCS_QUEUE_ID"), + session_key_base: System.fetch_env!("HEXDOCS_SESSION_KEY_BASE"), + session_signing_salt: System.fetch_env!("HEXDOCS_SESSION_SIGNING_SALT"), + session_encryption_salt: System.fetch_env!("HEXDOCS_SESSION_ENCRYPTION_SALT"), + queue_concurrency: String.to_integer(System.fetch_env!("HEXDOCS_QUEUE_CONCURRENCY")), + host: System.fetch_env!("HEXDOCS_HOST") + + config :hexdocs, :repo_bucket, name: System.fetch_env!("HEXDOCS_REPO_BUCKET") + + config :hexdocs, :docs_private_bucket, name: System.fetch_env!("HEXDOCS_DOCS_PRIVATE_BUCKET") + + config :hexdocs, :docs_public_bucket, name: System.fetch_env!("HEXDOCS_DOCS_PUBLIC_BUCKET") + + config :ex_aws, + access_key_id: System.fetch_env!("HEXDOCS_AWS_ACCESS_KEY_ID"), + secret_access_key: System.fetch_env!("HEXDOCS_AWS_ACCESS_KEY_SECRET") + + config :rollbax, + access_token: System.fetch_env!("HEXDOCS_ROLLBAR_ACCESS_TOKEN") + + config :kernel, + inet_dist_listen_min: String.to_integer(System.fetch_env!("BEAM_PORT")), + inet_dist_listen_max: String.to_integer(System.fetch_env!("BEAM_PORT")) +end diff --git a/mix.exs b/mix.exs index 3cbbb2f..ead7e06 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule Hexdocs.MixProject do [ app: :hexdocs, version: "0.1.0", - elixir: "~> 1.14", + elixir: "~> 1.17", start_permanent: Mix.env() == :prod, releases: releases(), deps: deps() @@ -42,7 +42,8 @@ defmodule Hexdocs.MixProject do defp releases() do [ hexdocs: [ - include_executables_for: [:unix] + include_executables_for: [:unix], + reboot_system_after_config: true ] ] end