From 63efcb6d01bbf18a8058768cb4989cadddf8449e Mon Sep 17 00:00:00 2001 From: SC-Samir Date: Wed, 14 Jan 2026 14:01:31 +0100 Subject: [PATCH] new version elexir and new buildpack url --- README.md | 4 ++-- elixir_buildpack.config | 4 ++-- lib/sample_elixir_plug.ex | 15 +++++++-------- lib/sample_elixir_plug/app_worker.ex | 4 ++-- mix.exs | 6 ++---- mix.lock | 16 +++++++++------- scalingo.json | 2 +- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index f2f3c1a..2f8ea76 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ mix run --no-halt Create an application on https://scalingo.com, then: ``` -git remote add scalingo git@scalingo.com:.git +scalingo --app my-app git-setup git push scalingo master ``` @@ -38,7 +38,7 @@ The application is running at this url: https://sample-elixir-plug.scalingo.io/ ## Deploy in one click -[![Deploy to Scalingo](https://cdn.scalingo.com/deploy/button.svg)](https://my.scalingo.com/deploy) +[![Deploy to Scalingo](https://cdn.scalingo.com/deploy/button.svg)](https://my.osc-fr1.scalingo.com/deploy?source=https://github.com/Scalingo/sample-elixir-plug) ## Links diff --git a/elixir_buildpack.config b/elixir_buildpack.config index 44c3046..ac9ceb8 100644 --- a/elixir_buildpack.config +++ b/elixir_buildpack.config @@ -1,8 +1,8 @@ # Erlang version -erlang_version=22.3 +erlang_version=27.1.2 # Elixir version -elixir_version=1.10.3 +elixir_version=1.17.3 # Always rebuild from scratch on every deploy? always_rebuild=false diff --git a/lib/sample_elixir_plug.ex b/lib/sample_elixir_plug.ex index 2933c97..4eb0499 100644 --- a/lib/sample_elixir_plug.ex +++ b/lib/sample_elixir_plug.ex @@ -1,18 +1,17 @@ defmodule SampleElixirPlug do use Application - # See http://elixir-lang.org/docs/stable/elixir/Application.html - # for more information on OTP Applications def start(_type, _args) do - import Supervisor.Spec, warn: false - children = [ - # Define workers and child supervisors to be supervised - worker(SampleElixirPlug.AppWorker, []) + %{ + id: SampleElixirPlug.AppWorker, + start: {SampleElixirPlug.AppWorker, :start_link, [[]]}, + type: :worker, + restart: :permanent, + shutdown: 500 + } ] - # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html - # for other strategies and supported options opts = [strategy: :one_for_one, name: SampleElixirPlug.Supervisor] Supervisor.start_link(children, opts) end diff --git a/lib/sample_elixir_plug/app_worker.ex b/lib/sample_elixir_plug/app_worker.ex index e92e81a..82a0436 100644 --- a/lib/sample_elixir_plug/app_worker.ex +++ b/lib/sample_elixir_plug/app_worker.ex @@ -1,6 +1,6 @@ defmodule SampleElixirPlug.AppWorker do - def start_link do + def start_link(_args) do port = System.get_env("PORT", "3000") |> String.to_integer() - Plug.Adapters.Cowboy.http(SampleElixirPlug.AppPipeline, [], port: port) + Plug.Cowboy.http(SampleElixirPlug.AppPipeline, [], port: port) end end diff --git a/mix.exs b/mix.exs index c096fe6..9955dbd 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule SampleElixirPlug.MixProject do [ app: :sample_elixir_plug, version: "1.0.0", - elixir: "~> 1.10", + elixir: "~> 1.17", build_embedded: Mix.env() == :prod, start_permanent: Mix.env() == :prod, deps: deps() @@ -23,9 +23,7 @@ defmodule SampleElixirPlug.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:plug, "~> 1.0"}, - {:plug_cowboy, "~> 1.0"}, - {:cowboy, "~> 1.0"} + {:plug_cowboy, "~> 2.7"}, ] end end diff --git a/mix.lock b/mix.lock index dc0f812..0819fc6 100644 --- a/mix.lock +++ b/mix.lock @@ -1,9 +1,11 @@ %{ - "cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5a65601460162d370a70018afe6f949a29dca91f3bb0", [:rebar3], [{:cowlib, "~> 1.0.2", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3.2", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "f4763bbe08233eceed6f24bc4fcc8d71c17cfeafa6439157c57349aa1bb4f17c"}, - "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], [], "hexpm", "db622da03aa039e6366ab953e31186cc8190d32905e33788a1acb22744e6abd2"}, - "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, - "plug": {:hex, :plug, "1.10.0", "6508295cbeb4c654860845fb95260737e4a8838d34d115ad76cd487584e2fc4d", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "422a9727e667be1bf5ab1de03be6fa0ad67b775b2d84ed908f3264415ef29d4a"}, - "plug_cowboy": {:hex, :plug_cowboy, "1.0.0", "2e2a7d3409746d335f451218b8bb0858301c3de6d668c3052716c909936eb57a", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "01d201427a8a1f4483be2465a98b45f5e82263327507fe93404a61c51eb9e9a8"}, - "plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"}, - "ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [:rebar3], [], "hexpm", "6e56493a862433fccc3aca3025c946d6720d8eedf6e3e6fb911952a7071c357f"}, + "cowboy": {:hex, :cowboy, "2.14.2", "4008be1df6ade45e4f2a4e9e2d22b36d0b5aba4e20b0a0d7049e28d124e34847", [:make, :rebar3], [{:cowlib, ">= 2.16.0 and < 3.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, ">= 1.8.0 and < 3.0.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "569081da046e7b41b5df36aa359be71a0c8874e5b9cff6f747073fc57baf1ab9"}, + "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, + "cowlib": {:hex, :cowlib, "2.16.0", "54592074ebbbb92ee4746c8a8846e5605052f29309d3a873468d76cdf932076f", [:make, :rebar3], [], "hexpm", "7f478d80d66b747344f0ea7708c187645cfcc08b11aa424632f78e25bf05db51"}, + "mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"}, + "plug": {:hex, :plug, "1.19.1", "09bac17ae7a001a68ae393658aa23c7e38782be5c5c00c80be82901262c394c0", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "560a0017a8f6d5d30146916862aaf9300b7280063651dd7e532b8be168511e62"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.7.5", "261f21b67aea8162239b2d6d3b4c31efde4daa22a20d80b19c2c0f21b34b270e", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "20884bf58a90ff5a5663420f5d2c368e9e15ed1ad5e911daf0916ea3c57f77ac"}, + "plug_crypto": {:hex, :plug_crypto, "2.1.1", "19bda8184399cb24afa10be734f84a16ea0a2bc65054e23a62bb10f06bc89491", [:mix], [], "hexpm", "6470bce6ffe41c8bd497612ffde1a7e4af67f36a15eea5f921af71cf3e11247c"}, + "ranch": {:hex, :ranch, "2.2.0", "25528f82bc8d7c6152c57666ca99ec716510fe0925cb188172f41ce93117b1b0", [:make, :rebar3], [], "hexpm", "fa0b99a1780c80218a4197a59ea8d3bdae32fbff7e88527d7d8a4787eff4f8e7"}, + "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, } diff --git a/scalingo.json b/scalingo.json index d070766..8dcd998 100644 --- a/scalingo.json +++ b/scalingo.json @@ -7,7 +7,7 @@ "env": { "BUILDPACK_URL": { "description": "Buildpack url", - "value": "https://github.com/HashNuke/heroku-buildpack-elixir" + "value": "https://github.com/nwittstruck/heroku-buildpack-elixir#scalingo" } } }