From 879bcc19239760701ba7f028aacc873553d117dc Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 24 Mar 2022 22:21:00 -0700 Subject: [PATCH] feat: Update elixir and erlang versions (#41) --- .github/workflows/ci.yml | 4 +- elixir-generate-dockerfile/Dockerfile | 2 + .../src/lib/app_config.ex | 27 +++++-- .../src/lib/generator.ex | 28 ++++++- elixir-generate-dockerfile/src/lib/main.ex | 1 + elixir-generate-dockerfile/src/mix.lock | 6 +- .../src/test/app_config_test.exs | 22 +++--- .../src/test/generator_test.exs | 56 ++++++++------ elixir-pipeline/elixir.yaml.in | 1 + erlang-versions.txt | 77 +++++++++---------- lib/tasks/build_local_images.ex | 15 ++-- runtime-build.sh | 12 +-- test/sample_app_build_test.exs | 23 +++--- 13 files changed, 167 insertions(+), 107 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7400ab4..f405460 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,8 @@ jobs: - name: Install Elixir uses: actions/setup-elixir@v1 with: - otp-version: "23.3.1" - elixir-version: "1.11.4" + otp-version: "23.3.4.11" + elixir-version: "1.13.3" experimental-otp: true - name: Checkout repo uses: actions/checkout@v2 diff --git a/elixir-generate-dockerfile/Dockerfile b/elixir-generate-dockerfile/Dockerfile index ed2fc34..88e9b27 100644 --- a/elixir-generate-dockerfile/Dockerfile +++ b/elixir-generate-dockerfile/Dockerfile @@ -32,6 +32,7 @@ ARG builder_image="" ARG prebuilt_erlang_images="" ARG default_erlang_version="" ARG default_elixir_version="" +ARG old_distillery_erlang_version="" ARG old_distillery_elixir_version="" ENV DEFAULT_OS_IMAGE=${os_image} \ @@ -40,6 +41,7 @@ ENV DEFAULT_OS_IMAGE=${os_image} \ DEFAULT_PREBUILT_ERLANG_IMAGES=${prebuilt_erlang_images} \ DEFAULT_ERLANG_VERSION=${default_erlang_version} \ DEFAULT_ELIXIR_VERSION=${default_elixir_version} \ + OLD_DISTILLERY_ERLANG_VERSION=${old_distillery_erlang_version} \ OLD_DISTILLERY_ELIXIR_VERSION=${old_distillery_elixir_version} # Install the wrapper script and templates. diff --git a/elixir-generate-dockerfile/src/lib/app_config.ex b/elixir-generate-dockerfile/src/lib/app_config.ex index 401d00e..982cf90 100644 --- a/elixir-generate-dockerfile/src/lib/app_config.ex +++ b/elixir-generate-dockerfile/src/lib/app_config.ex @@ -66,6 +66,7 @@ defmodule GenerateDockerfile.AppConfig do workspace_dir = Keyword.fetch!(args, :workspace_dir) default_erlang_version = Keyword.fetch!(args, :default_erlang_version) default_elixir_version = Keyword.fetch!(args, :default_elixir_version) + old_distillery_erlang_version = Keyword.fetch!(args, :old_distillery_erlang_version) old_distillery_elixir_version = Keyword.fetch!(args, :old_distillery_elixir_version) data = @@ -73,6 +74,7 @@ defmodule GenerateDockerfile.AppConfig do workspace_dir, default_erlang_version, default_elixir_version, + old_distillery_erlang_version, old_distillery_elixir_version ) @@ -90,6 +92,7 @@ defmodule GenerateDockerfile.AppConfig do workspace_dir, default_erlang_version, default_elixir_version, + old_distillery_erlang_version, old_distillery_elixir_version ) do project_id = get_project() @@ -101,9 +104,11 @@ defmodule GenerateDockerfile.AppConfig do phoenix_version = Map.get(deps_info, :phoenix) phoenix_prefix = get_phoenix_prefix(phoenix_version) - default_elixir_version = - adjust_default_elixir_version( + {default_erlang_version, default_elixir_version} = + adjust_default_erlang_and_elixir_versions( + default_erlang_version, default_elixir_version, + old_distillery_erlang_version, old_distillery_elixir_version, distillery_version ) @@ -212,19 +217,27 @@ defmodule GenerateDockerfile.AppConfig do if Version.compare(version, "1.3.0") == :lt, do: "phoenix", else: "phx" end - defp adjust_default_elixir_version(default_elixir_version, _old_distillery_elixir_version, nil) do - default_elixir_version + defp adjust_default_erlang_and_elixir_versions( + default_erlang_version, + default_elixir_version, + _old_distillery_erlang_version, + _old_distillery_elixir_version, + nil + ) do + {default_erlang_version, default_elixir_version} end - defp adjust_default_elixir_version( + defp adjust_default_erlang_and_elixir_versions( + default_erlang_version, default_elixir_version, + old_distillery_erlang_version, old_distillery_elixir_version, distillery_version ) do if Version.compare(distillery_version, "2.1.0") == :lt do - old_distillery_elixir_version + {old_distillery_erlang_version, old_distillery_elixir_version} else - default_elixir_version + {default_erlang_version, default_elixir_version} end end diff --git a/elixir-generate-dockerfile/src/lib/generator.ex b/elixir-generate-dockerfile/src/lib/generator.ex index 7a516d4..4b14cff 100644 --- a/elixir-generate-dockerfile/src/lib/generator.ex +++ b/elixir-generate-dockerfile/src/lib/generator.ex @@ -47,6 +47,13 @@ defmodule GenerateDockerfile.Generator do default_elixir_version = Keyword.get(opts, :default_elixir_version, System.get_env("DEFAULT_ELIXIR_VERSION")) + old_distillery_erlang_version = + Keyword.get( + opts, + :old_distillery_erlang_version, + System.get_env("OLD_DISTILLERY_ERLANG_VERSION") + ) + old_distillery_elixir_version = Keyword.get( opts, @@ -72,6 +79,7 @@ defmodule GenerateDockerfile.Generator do workspace_dir, default_erlang_version, default_elixir_version, + old_distillery_erlang_version, old_distillery_elixir_version ) @@ -95,6 +103,7 @@ defmodule GenerateDockerfile.Generator do _workspace_dir, "", _default_elixir_version, + _old_distillery_erlang_version, _old_distillery_elixir_version ) do GenerateDockerfile.error("Missing default erlang version") @@ -104,12 +113,27 @@ defmodule GenerateDockerfile.Generator do _workspace_dir, _default_erlang_version, "", + _old_distillery_erlang_version, _old_distillery_elixir_version ) do GenerateDockerfile.error("Missing default elixir version") end - defp start_app_config(_workspace_dir, _default_erlang_version, _default_elixir_version, "") do + defp start_app_config( + _workspace_dir, + _default_erlang_version, + _default_elixir_version, + "", + _old_distillery_elixir_version) do + GenerateDockerfile.error("Missing default erlang version for old distillery") + end + + defp start_app_config( + _workspace_dir, + _default_erlang_version, + _default_elixir_version, + _old_distillery_erlang_version, + "") do GenerateDockerfile.error("Missing default elixir version for old distillery") end @@ -117,6 +141,7 @@ defmodule GenerateDockerfile.Generator do workspace_dir, default_erlang_version, default_elixir_version, + old_distillery_erlang_version, old_distillery_elixir_version ) do {:ok, _} = @@ -124,6 +149,7 @@ defmodule GenerateDockerfile.Generator do workspace_dir: workspace_dir, default_erlang_version: default_erlang_version, default_elixir_version: default_elixir_version, + old_distillery_erlang_version: old_distillery_erlang_version, old_distillery_elixir_version: old_distillery_elixir_version ) diff --git a/elixir-generate-dockerfile/src/lib/main.ex b/elixir-generate-dockerfile/src/lib/main.ex index d6d9b36..d530058 100644 --- a/elixir-generate-dockerfile/src/lib/main.ex +++ b/elixir-generate-dockerfile/src/lib/main.ex @@ -27,6 +27,7 @@ defmodule GenerateDockerfile do prebuilt_erlang_images: :keep, default_erlang_version: :string, default_elixir_version: :string, + old_distillery_erlang_version: :string, old_distillery_elixir_version: :string, template_dir: :string ], diff --git a/elixir-generate-dockerfile/src/mix.lock b/elixir-generate-dockerfile/src/mix.lock index 4499244..0c24232 100644 --- a/elixir-generate-dockerfile/src/mix.lock +++ b/elixir-generate-dockerfile/src/mix.lock @@ -1,7 +1,7 @@ %{ - "mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"}, + "mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"}, "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "tesla": {:hex, :tesla, "0.10.0", "e588c7e7f1c0866c81eeed5c38f02a4a94d6309eede336c1e6ca08b0a95abd3f", [:mix], [{:exjsx, ">= 0.1.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.2", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm", "bb10f37d124e2a04950e1642437fc30368cd992bd7370b38eeb3af1ebf1c2029"}, - "yamerl": {:hex, :yamerl, "0.8.0", "8214cfe16bbabe5d1d6c14a14aea11c784b9a21903dd6a7c74f8ce180adae5c7", [:rebar3], [], "hexpm", "010634477bf9c208a0767dcca89116c2442cf0b5e87f9c870f85cd1c3e0c2aab"}, - "yaml_elixir": {:hex, :yaml_elixir, "2.5.0", "45de762be6d75fa5a8b5f44ddff8c30f64c26526eab5b1d72e36d616007b7796", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "80fe4e43f05582f2a90f2dcd73fc6171fbd65f2e6836f71fe4ce2154ef358c36"}, + "yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"}, + "yaml_elixir": {:hex, :yaml_elixir, "2.8.0", "c7ff0034daf57279c2ce902788ce6fdb2445532eb4317e8df4b044209fae6832", [:mix], [{:yamerl, "~> 0.8", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "4b674bd881e373d1ac6a790c64b2ecb69d1fd612c2af3b22de1619c15473830b"}, } diff --git a/elixir-generate-dockerfile/src/test/app_config_test.exs b/elixir-generate-dockerfile/src/test/app_config_test.exs index 9f9973e..f80dac3 100644 --- a/elixir-generate-dockerfile/src/test/app_config_test.exs +++ b/elixir-generate-dockerfile/src/test/app_config_test.exs @@ -19,8 +19,9 @@ defmodule AppConfigTest do @test_dir __DIR__ @cases_dir Path.join(@test_dir, "app_config") @tmp_dir Path.join(@test_dir, "tmp") - @default_erlang_version "22.0.7" - @default_elixir_version "1.9.0-otp-22" + @default_erlang_version "23.3.4.11" + @default_elixir_version "1.13.3-otp-23" + @old_distillery_erlang_version "22.3.4.17" @old_distillery_elixir_version "1.8.2-otp-22" @minimal_config """ @@ -64,6 +65,7 @@ defmodule AppConfigTest do workspace_dir: @tmp_dir, default_erlang_version: @default_erlang_version, default_elixir_version: @default_elixir_version, + old_distillery_erlang_version: @old_distillery_erlang_version, old_distillery_elixir_version: @old_distillery_elixir_version, register_module: false ) @@ -232,8 +234,8 @@ defmodule AppConfigTest do "cd assets && npm install && node_modules/webpack/bin/webpack.js --mode production && cd .. && mix phx.digest" ] - assert AppConfig.get!(:erlang_version, pid) == "22.0.7" - assert AppConfig.get!(:elixir_version, pid) == "1.9.0-otp-22" + assert AppConfig.get!(:erlang_version, pid) == @default_erlang_version + assert AppConfig.get!(:elixir_version, pid) == @default_elixir_version end test "phoenix 1.4 with release" do @@ -255,8 +257,8 @@ defmodule AppConfigTest do "cd assets && npm install && node_modules/webpack/bin/webpack.js --mode production && cd .. && mix phx.digest" ] - assert AppConfig.get!(:erlang_version, pid) == "22.0.7" - assert AppConfig.get!(:elixir_version, pid) == "1.9.0-otp-22" + assert AppConfig.get!(:erlang_version, pid) == @default_erlang_version + assert AppConfig.get!(:elixir_version, pid) == @default_elixir_version end test "phoenix 1.3 defaults" do @@ -271,8 +273,8 @@ defmodule AppConfigTest do "cd assets && npm install && node_modules/brunch/bin/brunch build --production && cd .. && mix phx.digest" ] - assert AppConfig.get!(:erlang_version, pid) == "22.0.7" - assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-22" + assert AppConfig.get!(:erlang_version, pid) == @old_distillery_erlang_version + assert AppConfig.get!(:elixir_version, pid) == @old_distillery_elixir_version end test "phoenix umbrella 1.3 defaults" do @@ -287,8 +289,8 @@ defmodule AppConfigTest do "cd apps/blog_web/assets && npm install && node_modules/brunch/bin/brunch build --production && cd .. && mix phx.digest" ] - assert AppConfig.get!(:erlang_version, pid) == "22.0.7" - assert AppConfig.get!(:elixir_version, pid) == "1.9.0-otp-22" + assert AppConfig.get!(:erlang_version, pid) == @default_erlang_version + assert AppConfig.get!(:elixir_version, pid) == @default_elixir_version end test "phoenix 1.2 defaults" do diff --git a/elixir-generate-dockerfile/src/test/generator_test.exs b/elixir-generate-dockerfile/src/test/generator_test.exs index b5b4981..f62fe38 100644 --- a/elixir-generate-dockerfile/src/test/generator_test.exs +++ b/elixir-generate-dockerfile/src/test/generator_test.exs @@ -21,6 +21,11 @@ defmodule GeneratorTest do @tmp_dir Path.join(@test_dir, "tmp") @template_dir Path.expand("../../app", @test_dir) + @default_erlang_version "23.3.4.11" + @default_elixir_version "1.13.3-otp-23" + @old_distillery_erlang_version "22.3.4.17" + @old_distillery_elixir_version "1.8.2-otp-22" + @minimal_config """ env: flex runtime: gs://elixir-runtime/elixir.yaml @@ -35,8 +40,8 @@ defmodule GeneratorTest do assert_dockerfile_line("## Project: (unknown)") assert_dockerfile_line("FROM gcr.io/gcp-elixir/runtime/ubuntu18/builder AS app-build") assert_dockerfile_line("# && apt-get install -y -q package-name") - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") assert_dockerfile_line("RUN asdf plugin-update erlang") assert_dockerfile_line("# RUN gcloud config set project my-project-id") assert_dockerfile_line("# ENV NAME=\"value\"") @@ -149,8 +154,8 @@ defmodule GeneratorTest do run_generator("minimal", config: config) assert_dockerfile_line("FROM gcr.io/gcp-elixir/runtime/ubuntu18/builder AS app-build") - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") assert_dockerfile_line("RUN asdf plugin-update erlang") assert_dockerfile_line("RUN mix release") assert_dockerfile_line("COPY --from=app-build /app/_build/prod/rel/my_app /app/") @@ -199,8 +204,8 @@ defmodule GeneratorTest do run_generator("phoenix_1_3") assert_ignore_line("priv/static") assert_ignore_line("assets/node_modules") - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@old_distillery_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@old_distillery_elixir_version}\"") refute_dockerfile_line("RUN mix release") refute_dockerfile_line("RUN mix distillery.release") end @@ -219,8 +224,8 @@ defmodule GeneratorTest do run_generator("phoenix_umbrella_1_3") assert_ignore_line("priv/static") assert_ignore_line("apps/blog_web/assets/node_modules") - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") refute_dockerfile_line("RUN mix release") refute_dockerfile_line("RUN mix distillery.release") end @@ -244,8 +249,8 @@ defmodule GeneratorTest do """ run_generator("phoenix_1_3", config: config) - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@old_distillery_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@old_distillery_elixir_version}\"") assert_dockerfile_line("RUN mix release --env=prod --verbose") end @@ -276,8 +281,8 @@ defmodule GeneratorTest do """ run_generator("phoenix_umbrella_1_3", config: config) - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") assert_dockerfile_line("RUN mix release blog") end @@ -323,8 +328,8 @@ defmodule GeneratorTest do """ run_generator("phoenix_1_4", config: config) - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") assert_dockerfile_line("RUN mix distillery.release --env=prod --verbose") end @@ -362,12 +367,12 @@ defmodule GeneratorTest do end test "minimal directory with prebuilt erlang" do - run_generator("minimal", prebuilt_erlang_versions: "22.0.7") - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + run_generator("minimal", prebuilt_erlang_versions: @default_erlang_version) + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") assert_dockerfile_line( - "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-22.0.7:latest" + "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-#{@default_erlang_version}:latest" ) end @@ -379,12 +384,12 @@ defmodule GeneratorTest do release_app: my_app """ - run_generator("minimal", config: config, prebuilt_erlang_versions: "22.0.7") - assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") - assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") + run_generator("minimal", config: config, prebuilt_erlang_versions: @default_erlang_version) + assert_dockerfile_line("ARG erlang_version=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") assert_dockerfile_line( - "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-22.0.7:latest" + "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-#{@default_erlang_version}:latest" ) end @@ -434,9 +439,10 @@ defmodule GeneratorTest do os_image: "gcr.io/gcp-elixir/runtime/ubuntu18", asdf_image: "gcr.io/gcp-elixir/runtime/ubuntu18/asdf", builder_image: "gcr.io/gcp-elixir/runtime/ubuntu18/builder", - default_erlang_version: "22.0.7", - default_elixir_version: "1.9.0-otp-22", - old_distillery_elixir_version: "1.8.2-otp-22" + default_erlang_version: @default_erlang_version, + default_elixir_version: @default_elixir_version, + old_distillery_erlang_version: @old_distillery_erlang_version, + old_distillery_elixir_version: @old_distillery_elixir_version ] opts = diff --git a/elixir-pipeline/elixir.yaml.in b/elixir-pipeline/elixir.yaml.in index ca37193..8a5b28a 100644 --- a/elixir-pipeline/elixir.yaml.in +++ b/elixir-pipeline/elixir.yaml.in @@ -6,6 +6,7 @@ steps: '--builder-image=@@BUILDER_IMAGE@@:@@TAG@@', '--default-erlang-version=@@DEFAULT_ERLANG_VERSION@@', '--default-elixir-version=@@DEFAULT_ELIXIR_VERSION@@', + '--old-distillery-erlang-version=@@OLD_DISTILLERY_ERLANG_VERSION@@', '--old-distillery-elixir-version=@@OLD_DISTILLERY_ELIXIR_VERSION@@'] - name: 'gcr.io/cloud-builders/docker:latest' args: ['build', '--network=cloudbuild', '-t', '$_OUTPUT_IMAGE', '.'] diff --git a/erlang-versions.txt b/erlang-versions.txt index 3d75a54..2f8d417 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -9,53 +9,14 @@ 21.3.8 21.3.8.17 22.0 -22.0.1 -22.0.2 -22.0.3 -22.0.4 -22.0.5 -22.0.6 22.0.7 22.1 -22.1.1 -22.1.2 -22.1.3 -22.1.4 -22.1.5 -22.1.6 -22.1.7 22.1.8 22.1.8.1 22.2 -22.2.1 -22.2.2 -22.2.3 -22.2.4 -22.2.5 -22.2.6 -22.2.7 22.2.8 22.3 -22.3.1 -22.3.2 -22.3.3 22.3.4 -22.3.4.1 -22.3.4.2 -22.3.4.3 -22.3.4.4 -22.3.4.5 -22.3.4.6 -22.3.4.7 -22.3.4.8 -22.3.4.9 -22.3.4.10 -22.3.4.11 -22.3.4.12 -22.3.4.13 -22.3.4.14 -22.3.4.15 -22.3.4.16 22.3.4.17 23.0 23.0.1 @@ -67,6 +28,7 @@ 23.1.2 23.1.3 23.1.4 +23.1.4.1 23.1.5 23.2 23.2.1 @@ -78,5 +40,42 @@ 23.2.7 23.2.7.1 23.2.7.2 +23.2.7.3 +23.2.7.4 23.3 23.3.1 +23.3.2 +23.3.3 +23.3.4 +23.3.4.1 +23.3.4.2 +23.3.4.3 +23.3.4.4 +23.3.4.5 +23.3.4.6 +23.3.4.7 +23.3.4.8 +23.3.4.9 +23.3.4.10 +23.3.4.11 +24.0 +24.0.1 +24.0.2 +24.0.3 +24.0.4 +24.0.5 +24.0.6 +24.1 +24.1.1 +24.1.2 +24.1.3 +24.1.4 +24.1.5 +24.1.6 +24.1.7 +24.2 +24.2.1 +24.2.2 +24.3 +24.3.1 +24.3.2 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 8e49c60..e48d6db 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,14 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.3.4.17"] - @base_erlang_version "22.3.4.17" - @base_elixir_version "1.11.4-otp-22" + @base_erlang_version "23.3.4.11" + @base_elixir_version "1.13.3-otp-23" + @old_distillery_erlang_version "22.3.4.17" @old_distillery_elixir_version "1.8.2-otp-22" - @asdf_version "0.8.0" - @nodejs_version "14.16.1" - @gcloud_version "334.0.0" + @prebuilt_erlang_versions [@old_distillery_erlang_version, @base_erlang_version] + @asdf_version "0.9.0" + @nodejs_version "16.14.2" + @gcloud_version "378.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" @@ -189,6 +190,8 @@ defmodule Mix.Tasks.BuildLocalImages do "--build-arg", "default_elixir_version=#{@base_elixir_version}", "--build-arg", + "old_distillery_erlang_version=#{@old_distillery_erlang_version}", + "--build-arg", "old_distillery_elixir_version=#{@old_distillery_elixir_version}", "." ], diff --git a/runtime-build.sh b/runtime-build.sh index c344b66..27927a8 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,13 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.3.4.17 -DEFAULT_ELIXIR_VERSION=1.11.4-otp-22 +DEFAULT_ERLANG_VERSION=23.3.4.11 +DEFAULT_ELIXIR_VERSION=1.13.3-otp-23 +OLD_DISTILLERY_ERLANG_VERSION=22.3.4.17 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.8.0 -GCLOUD_VERSION=334.0.0 -NODEJS_VERSION=14.16.1 +ASDF_VERSION=0.9.0 +GCLOUD_VERSION=378.0.0 +NODEJS_VERSION=16.14.2 set -e @@ -235,6 +236,7 @@ sed -e "s|@@GENERATE_DOCKERFILE_IMAGE@@|${GENERATE_DOCKERFILE_IMAGE}|g;\ s|@@BUILDER_IMAGE@@|${BUILDER_IMAGE}|g;\ s|@@DEFAULT_ERLANG_VERSION@@|${DEFAULT_ERLANG_VERSION}|g;\ s|@@DEFAULT_ELIXIR_VERSION@@|${DEFAULT_ELIXIR_VERSION}|g;\ + s|@@OLD_DISTILLERY_ERLANG_VERSION@@|${OLD_DISTILLERY_ERLANG_VERSION}|g;\ s|@@OLD_DISTILLERY_ELIXIR_VERSION@@|${OLD_DISTILLERY_ELIXIR_VERSION}|g;\ s|@@TAG@@|${IMAGE_TAG}|g;\ s|@@PREBUILT_IMAGE_ARGS@@|${PREBUILT_IMAGE_ARGS}|g" \ diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index d5a3bba..1c6a545 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -18,6 +18,11 @@ defmodule SampleAppBuildTest do @moduletag timeout: 300_000 + @old_elixir_version_short "1.8.2" + @old_elixir_version_long "#{@old_elixir_version_short}-otp-22" + @new_elixir_version_short "1.13.3" + @new_elixir_version_regex @new_elixir_version_short |> Regex.escape() |> Regex.compile!() + test "Minimal plug app" do run_app_test("minimal_plug") end @@ -25,7 +30,7 @@ defmodule SampleAppBuildTest do test "Minimal phoenix app" do run_app_test( "minimal_phoenix", - tool_versions: "elixir 1.8.2-otp-22\n", + tool_versions: "elixir #{@old_elixir_version_long}\n", check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-f", "/app/priv/static/cache_manifest.json"], @@ -51,7 +56,7 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix", - tool_versions: "elixir 1.8.2-otp-22\n", + tool_versions: "elixir #{@old_elixir_version_long}\n", config: config, check_image: fn image -> assert_cmd_succeeds( @@ -62,7 +67,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.8.2", + @old_elixir_version_short, timeout: 10, show: true, verbose: true @@ -82,7 +87,7 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix", - tool_versions: "elixir 1.8.2-otp-22\n", + tool_versions: "elixir #{@old_elixir_version_long}\n", config: config, expected_output: ~r{from staging} ) @@ -100,7 +105,7 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix", - tool_versions: "elixir 1.8.2-otp-22\n", + tool_versions: "elixir #{@old_elixir_version_long}\n", config: config, expected_output: ~r{from staging} ) @@ -117,7 +122,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.11\.4}, + @new_elixir_version_regex, show: true ) end @@ -144,7 +149,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.11.4", + @new_elixir_version_short, timeout: 10, show: true, verbose: true @@ -177,7 +182,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.11.4", + @new_elixir_version_short, timeout: 10, show: true, verbose: true @@ -218,7 +223,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.8.2", + @old_elixir_version_short, timeout: 10, show: true, verbose: true