From ce7bf5b5db0772b6758972c7e62c013502998d9c Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Fri, 18 Jan 2019 18:43:27 -0800 Subject: [PATCH 01/39] Update prebuilt erlangs and default erlang up to 21.2.3 --- CHANGELOG.md | 7 +++++++ README.md | 12 ++++-------- erlang-versions.txt | 5 +++++ runtime-build.sh | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6561095..b906ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## Unreleased + +* This is the last planned release on Ubuntu 16.04 (Xenial). Future releases will update to Ubuntu 18.04 (Bionic). To remain on Xenial, pin to this release by setting the runtime to `gs://elixir-runtime/elixir-ubuntu16.yaml` +* Prebuilt OTP 20.3 up to 20.3.8.18, and 21.2 up to 21.2.3. +* Update default OTP to 21.2.3. +* Update gcloud to 230.0.0. + ## elixir-2019-01-02-104948 * Prebuilt OTP 21.2, 21.2.1, and 21.2.2. diff --git a/README.md b/README.md index 8fe7a93..9a888d0 100644 --- a/README.md +++ b/README.md @@ -253,13 +253,13 @@ The Elixir Runtime comprises three parts: be used directly by applications. They are all based on a stable version of Debian (the same Debian base image used by Google's officially supported runtimes). - * `elixir-debian` contains an installation of Debian 8 plus a few + * `elixir-ubuntu16` contains an installation of Ubuntu 16.04 plus a few dependencies for the Erlang VM, and some common configuration for App Engine runtimes. However, it does not include an installation of Erlang or Elixir itself. This image is used as a runtime base image for release-based applications. An application release, with its embedded ERTS, is installed directly atop this image. - * `elixir-asdf` extends `elixir-debian` by installing + * `elixir-asdf` extends `elixir-ubuntu16` by installing [asdf](https://github.com/asdf-vm/asdf) and the erlang and elixir plugins, but does not include any actual installations. This image is used as a base image for most other images. @@ -279,7 +279,7 @@ The Elixir Runtime comprises three parts: to build the Docker image that gets pushed to App Engine servers. The generated Dockerfile generally contains two stages: a build stage based on `elixir-builder` that performs the build, and a runtime stage based on - either `elixir-debian` (for release-based builds) or `elixir-asdf` (for + either `elixir-ubuntu16` (for release-based builds) or `elixir-asdf` (for non-release-based). * A configuration file that references a specific build of the above analyzer-generator image. This file serves as the official definition of @@ -343,11 +343,7 @@ prebuilt Erlang binaries. First, choose the Erlang versions that will be covered. This list should include at least the default Erlang version specified in the `runtime-build.sh` script. Write them, one per line, in a file in this directory called -`erlang-versions.txt`. For example: - - 19.3 - 20.0 - 20.1 +`erlang-versions.txt`. Next, execute the `erlang-build.sh` script to build these versions of Erlang. This script uses the "elixir-asdf" base image so you must first build the diff --git a/erlang-versions.txt b/erlang-versions.txt index 590eae4..2bed169 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -27,6 +27,7 @@ 20.1.7 20.1.7.1 20.2 +20.2.0.1 20.2.1 20.2.2 20.2.3 @@ -55,6 +56,9 @@ 20.3.8.13 20.3.8.14 20.3.8.15 +20.3.8.16 +20.3.8.17 +20.3.8.18 21.0 21.0.1 21.0.2 @@ -73,3 +77,4 @@ 21.2 21.2.1 21.2.2 +21.2.3 diff --git a/runtime-build.sh b/runtime-build.sh index 53552a1..9397caa 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,10 +15,10 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=21.2.2 +DEFAULT_ERLANG_VERSION=21.2.3 DEFAULT_ELIXIR_VERSION=1.7.4-otp-21 ASDF_VERSION=0.6.2 -GCLOUD_VERSION=228.0.0 +GCLOUD_VERSION=230.0.0 NODEJS_VERSION=10.15.0 From 767eb93e61f170d619847882f37c1726f7dadc09 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Sat, 19 Jan 2019 20:30:04 -0800 Subject: [PATCH 02/39] Update changelog for release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b906ebc..ac0d6ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## Unreleased +## elixir-2019-01-19-000446 * This is the last planned release on Ubuntu 16.04 (Xenial). Future releases will update to Ubuntu 18.04 (Bionic). To remain on Xenial, pin to this release by setting the runtime to `gs://elixir-runtime/elixir-ubuntu16.yaml` * Prebuilt OTP 20.3 up to 20.3.8.18, and 21.2 up to 21.2.3. From 6c3b84966544cf55ed15abf9088dfd18b89f968c Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Mon, 4 Mar 2019 16:33:21 -0800 Subject: [PATCH 03/39] Update changelog for release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 978838b..ce61925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## Unreleased +## elixir-2019-03-04-150411 * Updated the underlying OS from Ubuntu 16.04 (Xenial) to Ubuntu 18.04 (Bionic). * Prebuilt OTP 20.3 up to 20.3.8.20, and 21.2 up to 21.2.6. From 5539be009678a56bbde29a597c65ac4d3fd0161e Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 21 Mar 2019 18:18:18 -0700 Subject: [PATCH 04/39] Update default erlang to 21.3.2 --- CHANGELOG.md | 2 +- erlang-versions.txt | 4 ++++ lib/tasks/build_local_images.ex | 6 +++--- runtime-build.sh | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce61925..2afa18c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ soon as possible. * Updated the underlying OS from Ubuntu 16.04 (Xenial) to Ubuntu 18.04 (Bionic). * Prebuilt OTP 20.3 up to 20.3.8.20, and 21.2 up to 21.2.6. -* Update default OTP to 21.2.6, and default Elixir to 18.1 +* Update default OTP to 21.2.6, and default Elixir to 1.8.1 * Update asdf to 0.7.0. * Update gcloud to 236.0.0. * Update nodejs to 10.15.2. diff --git a/erlang-versions.txt b/erlang-versions.txt index 79bffc3..87a2a38 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -70,3 +70,7 @@ 21.2.4 21.2.5 21.2.6 +21.2.7 +21.3 +21.3.1 +21.3.2 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index c2e514b..014e39d 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,12 +20,12 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["21.2.6"] - @base_erlang_version "21.2.6" + @prebuilt_erlang_versions ["21.3.2"] + @base_erlang_version "21.3.2" @base_elixir_version "1.8.1-otp-21" @asdf_version "0.7.0" @nodejs_version "10.15.2" - @gcloud_version "236.0.0" + @gcloud_version "239.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index fe89fd5..99457b4 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,10 +15,10 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=21.2.6 +DEFAULT_ERLANG_VERSION=21.3.2 DEFAULT_ELIXIR_VERSION=1.8.1-otp-21 ASDF_VERSION=0.7.0 -GCLOUD_VERSION=236.0.0 +GCLOUD_VERSION=239.0.0 NODEJS_VERSION=10.15.2 From 172574a00e0c146e3d65f84edd94296392ffcff9 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 26 Mar 2019 14:33:28 -0700 Subject: [PATCH 05/39] Update changelog for release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2afa18c..afb8781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,12 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## elixir-2019-03-21-181846 + +* Prebuilt OTP 21.2 up to 21.2.7, and 21.3 up to 21.3.2. +* Update default OTP to 21.3.2. +* Update gcloud to 239.0.0. + ## elixir-2019-03-04-150411 * Updated the underlying OS from Ubuntu 16.04 (Xenial) to Ubuntu 18.04 (Bionic). From e19ef9ed3fae08403bea82c449dddd3215985b19 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Fri, 19 Apr 2019 12:55:32 -0700 Subject: [PATCH 06/39] Prebuild erlang to 21.3.6 and update software versions --- erlang-versions.txt | 5 +++++ lib/tasks/build_local_images.ex | 8 ++++---- runtime-build.sh | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/erlang-versions.txt b/erlang-versions.txt index 87a2a38..7f076f3 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -48,6 +48,7 @@ 20.3.8.18 20.3.8.19 20.3.8.20 +20.3.8.21 21.0 21.0.1 21.0.2 @@ -74,3 +75,7 @@ 21.3 21.3.1 21.3.2 +21.3.3 +21.3.4 +21.3.5 +21.3.6 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 014e39d..09bdf92 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,12 +20,12 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["21.3.2"] - @base_erlang_version "21.3.2" + @prebuilt_erlang_versions ["21.3.6"] + @base_erlang_version "21.3.6" @base_elixir_version "1.8.1-otp-21" - @asdf_version "0.7.0" + @asdf_version "0.7.1" @nodejs_version "10.15.2" - @gcloud_version "239.0.0" + @gcloud_version "242.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 99457b4..963adc0 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,10 +15,10 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=21.3.2 +DEFAULT_ERLANG_VERSION=21.3.6 DEFAULT_ELIXIR_VERSION=1.8.1-otp-21 -ASDF_VERSION=0.7.0 -GCLOUD_VERSION=239.0.0 +ASDF_VERSION=0.7.1 +GCLOUD_VERSION=242.0.0 NODEJS_VERSION=10.15.2 From 88934adc7daba5600037281ee02b264e97fca393 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Fri, 19 Apr 2019 14:51:23 -0700 Subject: [PATCH 07/39] Update changelog for release --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afb8781..c4e4f0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## elixir-2019-04-19-135626 + +* Prebuilt OTP 20.3.8.21, and 21.3.3 thru 21.3.6. +* Update default OTP to 21.3.6. +* Update gcloud to 242.0.0. +* Update asdf to 0.7.1. + ## elixir-2019-03-21-181846 * Prebuilt OTP 21.2 up to 21.2.7, and 21.3 up to 21.3.2. From bec265f31265f7ee9cef130ac58f435a09adc426 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Fri, 24 May 2019 15:04:48 -0700 Subject: [PATCH 08/39] Update prebuilt versions --- elixir-generate-dockerfile/src/mix.lock | 2 +- erlang-versions.txt | 7 +++++++ lib/tasks/build_local_images.ex | 12 ++++++------ runtime-build.sh | 10 +++++----- test/sample_app_build_test.exs | 10 +++++----- test/sample_apps/minimal_phoenix/.tool-versions | 2 +- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/elixir-generate-dockerfile/src/mix.lock b/elixir-generate-dockerfile/src/mix.lock index 970b1c5..e938b60 100644 --- a/elixir-generate-dockerfile/src/mix.lock +++ b/elixir-generate-dockerfile/src/mix.lock @@ -3,5 +3,5 @@ "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, "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"}, "yamerl": {:hex, :yamerl, "0.7.0", "e51dba652dce74c20a88294130b48051ebbbb0be7d76f22de064f0f3ccf0aaf5", [:rebar3], [], "hexpm"}, - "yaml_elixir": {:hex, :yaml_elixir, "2.1.0", "79ec163e0f379dadf4b0e8b5162567dc1feb96c3cfa793105869e2c616ab4342", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm"}, + "yaml_elixir": {:hex, :yaml_elixir, "2.4.0", "2f444abc3c994c902851fde56b6a9cb82895c291c05a0490a289035c2e62ae71", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm"}, } diff --git a/erlang-versions.txt b/erlang-versions.txt index 7f076f3..42a65df 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -79,3 +79,10 @@ 21.3.4 21.3.5 21.3.6 +21.3.7 +21.3.7.1 +21.3.8 +21.3.8.1 +21.3.8.2 +22.0 +22.0.1 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 09bdf92..4aeadfe 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,12 +20,12 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["21.3.6"] - @base_erlang_version "21.3.6" - @base_elixir_version "1.8.1-otp-21" - @asdf_version "0.7.1" - @nodejs_version "10.15.2" - @gcloud_version "242.0.0" + @prebuilt_erlang_versions ["21.3.8.2"] + @base_erlang_version "21.3.8.2" + @base_elixir_version "1.8.2-otp-21" + @asdf_version "0.7.2" + @nodejs_version "10.15.3" + @gcloud_version "247.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 963adc0..6b74cdf 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,11 +15,11 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=21.3.6 -DEFAULT_ELIXIR_VERSION=1.8.1-otp-21 -ASDF_VERSION=0.7.1 -GCLOUD_VERSION=242.0.0 -NODEJS_VERSION=10.15.2 +DEFAULT_ERLANG_VERSION=21.3.8.2 +DEFAULT_ELIXIR_VERSION=1.8.2-otp-21 +ASDF_VERSION=0.7.2 +GCLOUD_VERSION=247.0.0 +NODEJS_VERSION=10.15.3 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index eb45cc2..cbf71d5 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -16,7 +16,7 @@ defmodule SampleAppBuildTest do use ExUnit.Case import TestHelper - @moduletag timeout: 120_000 + @moduletag timeout: 300_000 test "Minimal plug app" do config = """ @@ -44,7 +44,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.6\.6}, + ~r{1\.7\.4}, show: true ) end @@ -71,7 +71,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.6.6", + "1.7.4", timeout: 10, show: true, verbose: true @@ -122,7 +122,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.8\.1}, + ~r{1\.8\.2}, show: true ) end @@ -149,7 +149,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.8.1", + "1.8.2", timeout: 10, show: true, verbose: true diff --git a/test/sample_apps/minimal_phoenix/.tool-versions b/test/sample_apps/minimal_phoenix/.tool-versions index 3076e80..7683f4d 100644 --- a/test/sample_apps/minimal_phoenix/.tool-versions +++ b/test/sample_apps/minimal_phoenix/.tool-versions @@ -1 +1 @@ -elixir 1.6.6-otp-21 +elixir 1.7.4-otp-21 From 396218fc58f147f77ccc401533e311686467f974 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 29 May 2019 07:22:31 -0700 Subject: [PATCH 09/39] Update changelog for release --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4e4f0f..42f6f79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## elixir-2019-05-28-222238 + +* Prebuilt OTP through 21.3.7.1, 21.3.8.2, and 22.0.1. +* Update default OTP to 21.3.8.2, and default Elixir to 1.8.2. +* Update default gcloud to 247.0.0. +* Update asdf to 0.7.2 + ## elixir-2019-04-19-135626 * Prebuilt OTP 20.3.8.21, and 21.3.3 thru 21.3.6. From 97b2adb647ce6859bce63b9a8c0ed8089d663773 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Sun, 30 Jun 2019 23:08:14 -0700 Subject: [PATCH 10/39] Prebuild erlang to 22.0.4 and update software versions --- .travis.yml | 2 +- CHANGELOG.md | 11 +++++++++-- erlang-versions.txt | 5 +++++ lib/tasks/build_local_images.ex | 10 +++++----- runtime-build.sh | 8 ++++---- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7feaa63..933221d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: elixir elixir: - '1.6.6' - '1.7.4' - - '1.8.1' + - '1.8.2' otp_release: - '20.3.8' - '21.2.6' diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f6f79..cdaf2aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,22 @@ choosing the following in your `app.yaml` config file: However, you may also pin to a specific version of the runtime by specifying the version name as the yaml file name. For example, to pin to the -`elixir-2019-01-19-000446` release, use: +`elixir-2019-05-28-222238` release, use: - runtime: gs://elixir-runtime/elixir-2019-01-19-000446.yaml + runtime: gs://elixir-runtime/elixir-2019-05-28-222238.yaml There is currently no guarantee regarding how long older runtime releases will continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## Unreleased + +* Prebuilt OTP through 21.3.8.4 and 22.0.4. +* Update default OTP to 22.0.4. +* Update default gcloud to 252.0.0. +* Update nodejs to 10.16.0. + ## elixir-2019-05-28-222238 * Prebuilt OTP through 21.3.7.1, 21.3.8.2, and 22.0.1. diff --git a/erlang-versions.txt b/erlang-versions.txt index 42a65df..47bcb5c 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -84,5 +84,10 @@ 21.3.8 21.3.8.1 21.3.8.2 +21.3.8.3 +21.3.8.4 22.0 22.0.1 +22.0.2 +22.0.3 +22.0.4 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 4aeadfe..6f301d4 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,12 +20,12 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["21.3.8.2"] - @base_erlang_version "21.3.8.2" - @base_elixir_version "1.8.2-otp-21" + @prebuilt_erlang_versions ["22.0.4"] + @base_erlang_version "22.0.4" + @base_elixir_version "1.8.2-otp-22" @asdf_version "0.7.2" - @nodejs_version "10.15.3" - @gcloud_version "247.0.0" + @nodejs_version "10.16.0" + @gcloud_version "252.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 6b74cdf..f0adad7 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,11 +15,11 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=21.3.8.2 -DEFAULT_ELIXIR_VERSION=1.8.2-otp-21 +DEFAULT_ERLANG_VERSION=22.0.4 +DEFAULT_ELIXIR_VERSION=1.8.2-otp-22 ASDF_VERSION=0.7.2 -GCLOUD_VERSION=247.0.0 -NODEJS_VERSION=10.15.3 +GCLOUD_VERSION=252.0.0 +NODEJS_VERSION=10.16.0 set -e From 13005e76d3128dd8a272e4229689769869f21656 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Mon, 1 Jul 2019 10:30:44 -0700 Subject: [PATCH 11/39] Update changelog for release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdaf2aa..a075bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## Unreleased +## elixir-2019-07-01-065508 * Prebuilt OTP through 21.3.8.4 and 22.0.4. * Update default OTP to 22.0.4. From 73fe220593297c790380336822c09a3d81b70a2f Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 17 Jul 2019 22:09:47 -0700 Subject: [PATCH 12/39] Updates for Elixir 1.9 --- .travis.yml | 7 +- CHANGELOG.md | 11 ++ .../app/Dockerfile-release.eex | 2 +- .../src/lib/app_config.ex | 20 ++- .../src/lib/generator.ex | 16 +++ .../app_config/phoenix_1_3/.tool-versions | 3 +- .../src/test/app_config/phoenix_1_3/mix.exs | 3 +- .../src/test/app_config/phoenix_1_3/mix.lock | 29 +++-- .../app_config/phoenix_1_4/.tool-versions | 4 +- .../src/test/app_config/phoenix_1_4/mix.exs | 2 +- .../src/test/app_config/phoenix_1_4/mix.lock | 36 ++--- .../phoenix_umbrella_1_3/.tool-versions | 4 +- .../src/test/app_config_test.exs | 42 ++++-- .../src/test/generator_test.exs | 99 +++++++++----- erlang-versions.txt | 45 +------ lib/tasks/build_local_images.ex | 10 +- runtime-build.sh | 8 +- test/sample_app_build_test.exs | 123 ++++++++++++++---- .../minimal_phoenix/.tool-versions | 2 +- test/sample_apps/minimal_phoenix/mix.exs | 4 +- test/sample_apps/minimal_phoenix/mix.lock | 26 ++-- .../minimal_phoenix14/config/prod.exs | 3 +- .../minimal_phoenix14/mix-dist20.exs | 38 ++++++ .../minimal_phoenix14/mix-dist20.lock | 19 +++ .../minimal_phoenix14/mix-dist21.exs | 38 ++++++ .../minimal_phoenix14/mix-dist21.lock | 19 +++ test/sample_apps/minimal_phoenix14/mix.exs | 16 ++- test/sample_apps/minimal_phoenix14/mix.lock | 23 ++-- .../minimal_phoenix14/rel/config.exs | 2 +- 29 files changed, 454 insertions(+), 200 deletions(-) create mode 100644 test/sample_apps/minimal_phoenix14/mix-dist20.exs create mode 100644 test/sample_apps/minimal_phoenix14/mix-dist20.lock create mode 100644 test/sample_apps/minimal_phoenix14/mix-dist21.exs create mode 100644 test/sample_apps/minimal_phoenix14/mix-dist21.lock diff --git a/.travis.yml b/.travis.yml index 933221d..fa3de47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,7 @@ sudo: required language: elixir elixir: - - '1.6.6' - - '1.7.4' - - '1.8.2' -otp_release: - - '20.3.8' - - '21.2.6' + - '1.9.0' services: - docker diff --git a/CHANGELOG.md b/CHANGELOG.md index a075bc4..088559d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,17 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## (unreleased) + +* Supports building releases using the built-in mix release in elixir 1.9. +* Supports the usage changes in distillery 2.1. +* Update default elixir to 1.9.0. +* Update default OTP to 22.0.7. +* Prebuilt OTP through 21.3.8.6 and 22.0.7. +* Removed intermediate OTP 20.x versions from the prebuilt list. (The primary and latest versions are still present.) +* Update default gcloud to 253.0.0. +* Update asdf to 0.7.3. + ## elixir-2019-07-01-065508 * Prebuilt OTP through 21.3.8.4 and 22.0.4. diff --git a/elixir-generate-dockerfile/app/Dockerfile-release.eex b/elixir-generate-dockerfile/app/Dockerfile-release.eex index 635e742..637520d 100644 --- a/elixir-generate-dockerfile/app/Dockerfile-release.eex +++ b/elixir-generate-dockerfile/app/Dockerfile-release.eex @@ -127,7 +127,7 @@ RUN mix do deps.get, deps.compile, compile <% end %> ## Create the release. -RUN mix release --env=<%= @mix_env %> --verbose +RUN <%= @release_command %> ################################################################################ diff --git a/elixir-generate-dockerfile/src/lib/app_config.ex b/elixir-generate-dockerfile/src/lib/app_config.ex index 1c13327..05a2d12 100644 --- a/elixir-generate-dockerfile/src/lib/app_config.ex +++ b/elixir-generate-dockerfile/src/lib/app_config.ex @@ -83,6 +83,7 @@ defmodule GenerateDockerfile.AppConfig do project_id_for_example = project_id || "my-project-id" deps_info = analyze_deps(workspace_dir) + distillery_version = Map.get(deps_info, :distillery) phoenix_version = Map.get(deps_info, :phoenix) phoenix_prefix = get_phoenix_prefix(phoenix_version) @@ -100,7 +101,7 @@ defmodule GenerateDockerfile.AppConfig do mix_env = Map.get(env_variables, "MIX_ENV", @default_mix_env) install_packages = get_install_packages(runtime_config, app_config) cloud_sql_instances = get_cloud_sql_instances(beta_settings) - entrypoint = get_entrypoint(runtime_config, app_config, phoenix_prefix, release_app) + entrypoint = get_entrypoint(runtime_config, app_config, phoenix_prefix, distillery_version, release_app) assets_dir = get_assets_dir(workspace_dir, phoenix_version) assets_builder = get_assets_builder(workspace_dir, assets_dir) build_scripts = get_build_scripts(runtime_config, assets_dir, assets_builder, phoenix_prefix) @@ -121,6 +122,7 @@ defmodule GenerateDockerfile.AppConfig do install_packages: install_packages, cloud_sql_instances: cloud_sql_instances, phoenix_version: phoenix_version, + distillery_version: distillery_version, assets_dir: assets_dir, assets_builder: assets_builder, entrypoint: entrypoint, @@ -161,7 +163,7 @@ defmodule GenerateDockerfile.AppConfig do {result, _} = Code.eval_file(mix_lock_path) - [:phoenix] + [:distillery, :phoenix] |> Enum.reduce(%{}, fn pkg, acc -> pkg_info = result[pkg] @@ -280,25 +282,29 @@ defmodule GenerateDockerfile.AppConfig do cloud_sql_instances end - defp get_entrypoint(runtime_config, app_config, phoenix_prefix, release_app) do + defp get_entrypoint(runtime_config, app_config, phoenix_prefix, distillery_version, release_app) do Map.get_lazy(runtime_config, "entrypoint", fn -> Map.get_lazy(app_config, "entrypoint", fn -> - default_entrypoint(phoenix_prefix, release_app) + default_entrypoint(phoenix_prefix, release_app, distillery_version) end) end) |> validate_entrypoint |> decorate_entrypoint end - defp default_entrypoint(nil, nil) do + defp default_entrypoint(nil, nil, _) do warn_default_entrypoint("mix run --no-halt") end - defp default_entrypoint(phoenix_prefix, nil) do + defp default_entrypoint(phoenix_prefix, nil, _) do warn_default_entrypoint("mix #{phoenix_prefix}.server") end - defp default_entrypoint(_phoenix_prefix, release_app) do + defp default_entrypoint(_phoenix_prefix, release_app, nil) do + ["/app/bin/#{release_app}", "start"] + end + + defp default_entrypoint(_phoenix_prefix, release_app, _distillery_version) do ["/app/bin/#{release_app}", "foreground"] end diff --git a/elixir-generate-dockerfile/src/lib/generator.ex b/elixir-generate-dockerfile/src/lib/generator.ex index e107a28..d5e7a26 100644 --- a/elixir-generate-dockerfile/src/lib/generator.ex +++ b/elixir-generate-dockerfile/src/lib/generator.ex @@ -120,6 +120,9 @@ defmodule GenerateDockerfile.Generator do end end) + release_command = render_release_command( + AppConfig.get!(:distillery_version), AppConfig.get!(:mix_env), AppConfig.get!(:release_app)) + [ os_image: os_image, asdf_image: asdf_image, @@ -139,6 +142,7 @@ defmodule GenerateDockerfile.Generator do env_variables: AppConfig.get!(:env_variables) |> render_env, mix_env: AppConfig.get!(:mix_env), cloud_sql_instances: AppConfig.get!(:cloud_sql_instances) |> Enum.join(","), + release_command: release_command, build_scripts: AppConfig.get!(:build_scripts) |> render_commands, entrypoint: AppConfig.get!(:entrypoint) ] @@ -182,6 +186,18 @@ defmodule GenerateDockerfile.Generator do |> Enum.join(" \\\n ") end + defp render_release_command(nil, _mix_env, release_app) do + "mix release #{release_app}" + end + + defp render_release_command(distillery_version, mix_env, _release_app) do + if Version.compare(distillery_version, "2.1.0") == :lt do + "mix release --env=#{mix_env} --verbose" + else + "mix distillery.release --env=#{mix_env} --verbose" + end + end + defp render_commands(cmds) do cmds |> Enum.map(fn cmd -> "RUN #{cmd}" end) diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions index fd08988..965206e 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions @@ -1 +1,2 @@ -elixir 1.5.1 +erlang 21.1 +elixir 1.7.4-otp-21 diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.exs b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.exs index e053bd4..0ae8d24 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.exs +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.exs @@ -37,7 +37,8 @@ defmodule Blog.Mixfile do {:phoenix_html, "~> 2.10"}, {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, - {:cowboy, "~> 1.0"} + {:cowboy, "~> 1.0"}, + {:distillery, "~> 2.0.0"} ] end end diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.lock b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.lock index 7a48979..829fd65 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.lock +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/mix.lock @@ -1,12 +1,17 @@ -%{"cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5a65601460162d370a70018afe6f949a29dca91f3bb0", [], [{:cowlib, "~> 1.0.2", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3.2", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, - "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [], [], "hexpm"}, - "file_system": {:hex, :file_system, "0.1.5", "4f20ec7d186cd84ad478bd5477061aeb993b36b5458872041bbabba8b09d36ff", [], [], "hexpm"}, - "gettext": {:hex, :gettext, "0.13.1", "5e0daf4e7636d771c4c71ad5f3f53ba09a9ae5c250e1ab9c42ba9edccc476263", [], [], "hexpm"}, - "mime": {:hex, :mime, "1.1.0", "01c1d6f4083d8aa5c7b8c246ade95139620ef8effb009edde934e0ec3b28090a", [], [], "hexpm"}, - "phoenix": {:hex, :phoenix, "1.3.0", "1c01124caa1b4a7af46f2050ff11b267baa3edb441b45dbf243e979cd4c5891b", [], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_html": {:hex, :phoenix_html, "2.10.4", "d4f99c32d5dc4918b531fdf163e1fd7cf20acdd7703f16f5d02d4db36de803b7", [], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.1.0", "975d6bba8d75d20a63659b6f057eecaa1e96b42fa19cebc304031ac3184d744e", [], [{:file_system, "~> 0.1", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.0 or ~> 1.2 or ~> 1.3", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.0.2", "bfa7fd52788b5eaa09cb51ff9fcad1d9edfeb68251add458523f839392f034c1", [], [], "hexpm"}, - "plug": {:hex, :plug, "1.4.3", "236d77ce7bf3e3a2668dc0d32a9b6f1f9b1f05361019946aae49874904be4aed", [], [{:cowboy, "~> 1.0.1 or ~> 1.1", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"}, - "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [], [], "hexpm"}, - "ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [], [], "hexpm"}} +%{ + "artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"}, + "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"}, + "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], [], "hexpm"}, + "distillery": {:hex, :distillery, "2.0.14", "25fc1cdad06282334dbf4a11b6e869cc002855c4e11825157498491df2eed594", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, + "file_system": {:hex, :file_system, "0.2.7", "e6f7f155970975789f26e77b8b8d8ab084c59844d8ecfaf58cbda31c494d14aa", [:mix], [], "hexpm"}, + "gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"}, + "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.3.0", "1c01124caa1b4a7af46f2050ff11b267baa3edb441b45dbf243e979cd4c5891b", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.1.7", "425fff579085f7eacaf009e71940be07338c8d8b78d16e307c50c7d82a381497", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.0 or ~> 1.2 or ~> 1.3 or ~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, + "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, + "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, + "ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [:rebar3], [], "hexpm"}, +} diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions index 965206e..b505314 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions @@ -1,2 +1,2 @@ -erlang 21.1 -elixir 1.7.4-otp-21 +erlang 22.0.7 +elixir 1.8.2-otp-22 diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.exs b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.exs index ab489c8..3afba74 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.exs +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.exs @@ -43,7 +43,7 @@ defmodule Phx14.MixProject do {:gettext, "~> 0.11"}, {:jason, "~> 1.0"}, {:plug_cowboy, "~> 2.0"}, - {:distillery, "~> 2.0"} + {:distillery, "~> 2.1.0"} ] end diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.lock b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.lock index bd12436..dc19d35 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.lock +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/mix.lock @@ -1,26 +1,26 @@ %{ - "artificery": {:hex, :artificery, "0.2.6", "f602909757263f7897130cbd006b0e40514a541b148d366ad65b89236b93497a", [:mix], [], "hexpm"}, + "artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"}, "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"}, - "cowboy": {:hex, :cowboy, "2.6.1", "f2e06f757c337b3b311f9437e6e072b678fcd71545a7b2865bdaa154d078593f", [:rebar3], [{:cowlib, "~> 2.7.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, - "cowlib": {:hex, :cowlib, "2.7.0", "3ef16e77562f9855a2605900cedb15c1462d76fb1be6a32fc3ae91973ee543d2", [:rebar3], [], "hexpm"}, - "db_connection": {:hex, :db_connection, "2.0.3", "b4e8aa43c100e16f122ccd6798cd51c48c79fd391c39d411f42b3cd765daccb0", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, - "decimal": {:hex, :decimal, "1.6.0", "bfd84d90ff966e1f5d4370bdd3943432d8f65f07d3bab48001aebd7030590dcc", [:mix], [], "hexpm"}, - "distillery": {:hex, :distillery, "2.0.12", "6e78fe042df82610ac3fa50bd7d2d8190ad287d120d3cd1682d83a44e8b34dfb", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, - "ecto": {:hex, :ecto, "3.0.5", "bf9329b56f781a67fdb19e92e6d9ed79c5c8b31d41653b79dafb7ceddfbe87e0", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, - "ecto_sql": {:hex, :ecto_sql, "3.0.3", "dd17f2401a69bb2ec91d5564bd259ad0bc63ee32c2cb2e616d04f1559801dba6", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0.4", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.2.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, - "file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"}, - "gettext": {:hex, :gettext, "0.16.1", "e2130b25eebcbe02bb343b119a07ae2c7e28bd4b146c4a154da2ffb2b3507af2", [:mix], [], "hexpm"}, + "cowboy": {:hex, :cowboy, "2.6.3", "99aa50e94e685557cad82e704457336a453d4abcb77839ad22dbe71f311fcc06", [:rebar3], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, + "cowlib": {:hex, :cowlib, "2.7.3", "a7ffcd0917e6d50b4d5fb28e9e2085a0ceb3c97dea310505f7460ff5ed764ce9", [:rebar3], [], "hexpm"}, + "db_connection": {:hex, :db_connection, "2.1.1", "a51e8a2ee54ef2ae6ec41a668c85787ed40cb8944928c191280fe34c15b76ae5", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, + "decimal": {:hex, :decimal, "1.8.0", "ca462e0d885f09a1c5a342dbd7c1dcf27ea63548c65a65e67334f4b61803822e", [:mix], [], "hexpm"}, + "distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, + "ecto": {:hex, :ecto, "3.1.7", "fa21d06ef56cdc2fdaa62574e8c3ba34a2751d44ea34c30bc65f0728421043e5", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "ecto_sql": {:hex, :ecto_sql, "3.1.6", "1e80e30d16138a729c717f73dcb938590bcdb3a4502f3012414d0cbb261045d8", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:myxql, "~> 0.2.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0 or ~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, + "file_system": {:hex, :file_system, "0.2.7", "e6f7f155970975789f26e77b8b8d8ab084c59844d8ecfaf58cbda31c494d14aa", [:mix], [], "hexpm"}, + "gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"}, "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, - "phoenix": {:hex, :phoenix, "1.4.0", "56fe9a809e0e735f3e3b9b31c1b749d4b436e466d8da627b8d82f90eaae714d2", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.4.9", "746d098e10741c334d88143d3c94cab1756435f94387a63441792e66ec0ee974", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.0.0", "c43117a136e7399ea04ecaac73f8f23ee0ffe3e07acfcb8062fe5f4c9f0f6531", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_html": {:hex, :phoenix_html, "2.13.0", "3bad10de5efb6c590f7aa5b316ad0d3faa054715414c9b562c410de4ffb885c5", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.0", "3bb31a9fbd40ffe8652e60c8660dffd72dd231efcdf49b744fb75b9ef7db5dd2", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"}, - "plug": {:hex, :plug, "1.7.1", "8516d565fb84a6a8b2ca722e74e2cd25ca0fc9d64f364ec9dbec09d33eb78ccd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.0.0", "ab0c92728f2ba43c544cce85f0f220d8d30fc0c90eaa1e6203683ab039655062", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.1", "274a4b07c4adbdd7785d45a8b0bb57634d0b4f45b18d2c508b26c0344bd59b8f", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, + "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.1.0", "b75768153c3a8a9e8039d4b25bb9b14efbc58e9c4a6e6a270abff1cd30cbe320", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, - "postgrex": {:hex, :postgrex, "0.14.1", "63247d4a5ad6b9de57a0bac5d807e1c32d41e39c04b8a4156a26c63bcd8a2e49", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "postgrex": {:hex, :postgrex, "0.14.3", "5754dee2fdf6e9e508cbf49ab138df964278700b764177e8f3871e658b345a1e", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm"}, - "telemetry": {:hex, :telemetry, "0.2.0", "5b40caa3efe4deb30fb12d7cd8ed4f556f6d6bd15c374c2366772161311ce377", [:mix], [], "hexpm"}, + "telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"}, } diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions index 03d31ca..ee12cf4 100644 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions +++ b/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions @@ -1,2 +1,2 @@ -erlang 20.0 -elixir 1.5.1-otp-20 +erlang 21.1 +elixir 1.8.2-otp-21 diff --git a/elixir-generate-dockerfile/src/test/app_config_test.exs b/elixir-generate-dockerfile/src/test/app_config_test.exs index 4624b14..b3525f4 100644 --- a/elixir-generate-dockerfile/src/test/app_config_test.exs +++ b/elixir-generate-dockerfile/src/test/app_config_test.exs @@ -19,8 +19,8 @@ defmodule AppConfigTest do @test_dir __DIR__ @cases_dir Path.join(@test_dir, "app_config") @tmp_dir Path.join(@test_dir, "tmp") - @default_erlang_version "20.2" - @default_elixir_version "1.5.3-otp-20" + @default_erlang_version "22.0.7" + @default_elixir_version "1.9.0-otp-22" @minimal_config """ env: flex @@ -164,7 +164,7 @@ defmodule AppConfigTest do pid = AppConfigTest.setup_test("minimal", config) assert AppConfig.status(pid) == :ok assert AppConfig.get!(:release_app, pid) == "my_app" - assert AppConfig.get!(:entrypoint, pid) == "[\"/app/bin/my_app\",\"foreground\"]" + assert AppConfig.get!(:entrypoint, pid) == "[\"/app/bin/my_app\",\"start\"]" end test "release_app with custom entrypoint" do @@ -222,7 +222,7 @@ defmodule AppConfigTest do pid = AppConfigTest.setup_test("phoenix_1_4", @minimal_config) assert AppConfig.status(pid) == :ok assert AppConfig.get!(:entrypoint, pid) == "exec mix phx.server" - assert AppConfig.get!(:phoenix_version, pid) == "1.4.0" + assert AppConfig.get!(:phoenix_version, pid) == "1.4.9" assert AppConfig.get!(:assets_dir, pid) == "assets" assert AppConfig.get!(:assets_builder, pid) == "webpack" @@ -230,8 +230,30 @@ 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) == "21.1" - assert AppConfig.get!(:elixir_version, pid) == "1.7.4-otp-21" + assert AppConfig.get!(:erlang_version, pid) == "22.0.7" + assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-22" + end + + test "phoenix 1.4 with release" do + config = """ + env: flex + runtime: gs://elixir-runtime/elixir.yaml + runtime_config: + release_app: my_app + """ + pid = AppConfigTest.setup_test("phoenix_1_4", config) + assert AppConfig.status(pid) == :ok + assert AppConfig.get!(:entrypoint, pid) == "[\"/app/bin/my_app\",\"foreground\"]" + assert AppConfig.get!(:phoenix_version, pid) == "1.4.9" + assert AppConfig.get!(:assets_dir, pid) == "assets" + assert AppConfig.get!(:assets_builder, pid) == "webpack" + + assert AppConfig.get!(:build_scripts, pid) == [ + "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.8.2-otp-22" end test "phoenix 1.3 defaults" do @@ -246,8 +268,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) == @default_erlang_version - assert AppConfig.get!(:elixir_version, pid) == "1.5.1" + assert AppConfig.get!(:erlang_version, pid) == "21.1" + assert AppConfig.get!(:elixir_version, pid) == "1.7.4-otp-21" end test "phoenix umbrella 1.3 defaults" do @@ -262,8 +284,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) == "20.0" - assert AppConfig.get!(:elixir_version, pid) == "1.5.1-otp-20" + assert AppConfig.get!(:erlang_version, pid) == "21.1" + assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-21" 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 ddf0f12..2d37500 100644 --- a/elixir-generate-dockerfile/src/test/generator_test.exs +++ b/elixir-generate-dockerfile/src/test/generator_test.exs @@ -35,13 +35,13 @@ 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=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.3-otp-20\"") + assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") + assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") 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\"") assert_dockerfile_line("# ENV BUILD_CLOUDSQL_INSTANCES=\"my-project-id:db-region:db-name\"") - refute_dockerfile_line("RUN mix release --env=prod --verbose") + refute_dockerfile_line("RUN mix distillery.release --env=prod --verbose") assert_dockerfile_line("FROM gcr.io/gcp-elixir/runtime/ubuntu18/asdf") assert_dockerfile_line("CMD exec mix run --no-halt") end @@ -149,13 +149,13 @@ defmodule GeneratorTest do run_generator("minimal", config) assert_dockerfile_line("FROM gcr.io/gcp-elixir/runtime/ubuntu18/builder AS app-build") - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.3-otp-20\"") + assert_dockerfile_line("ARG erlang_version=\"22.0.7\"") + assert_dockerfile_line("ARG elixir_version=\"1.9.0-otp-22\"") assert_dockerfile_line("RUN asdf plugin-update erlang") - assert_dockerfile_line("RUN mix release --env=prod --verbose") + assert_dockerfile_line("RUN mix release") assert_dockerfile_line("COPY --from=app-build /app/_build/prod/rel/my_app /app/") assert_dockerfile_line("FROM gcr.io/gcp-elixir/runtime/ubuntu18") - assert_dockerfile_line("CMD [\"/app/bin/my_app\",\"foreground\"]") + assert_dockerfile_line("CMD [\"/app/bin/my_app\",\"start\"]") end test "minimal directory with release app and custom entrypoint" do @@ -164,12 +164,12 @@ defmodule GeneratorTest do """ runtime_config: release_app: my_app - entrypoint: /app/bin/my_app foreground --blah + entrypoint: /app/bin/my_app start --blah """ run_generator("minimal", config) - assert_dockerfile_line("RUN mix release --env=prod --verbose") - assert_dockerfile_line("CMD exec /app/bin/my_app foreground --blah") + assert_dockerfile_line("RUN mix release my_app") + assert_dockerfile_line("CMD exec /app/bin/my_app start --blah") end test "minimal directory with release app and custom mix_env" do @@ -183,7 +183,7 @@ defmodule GeneratorTest do """ run_generator("minimal", config) - assert_dockerfile_line("RUN mix release --env=staging --verbose") + assert_dockerfile_line("RUN mix release my_app") assert_dockerfile_line("COPY --from=app-build /app/_build/staging/rel/my_app /app/") end @@ -191,25 +191,28 @@ defmodule GeneratorTest do run_generator("phoenix_1_2", @minimal_config) assert_ignore_line("priv/static") assert_ignore_line("node_modules") - refute_dockerfile_line("RUN mix release --env=prod --verbose") + refute_dockerfile_line("RUN mix release") + refute_dockerfile_line("RUN mix distillery.release") end test "phoenix 1.3 directory with custom elixir" do run_generator("phoenix_1_3", @minimal_config) assert_ignore_line("priv/static") assert_ignore_line("assets/node_modules") - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.1\"") - refute_dockerfile_line("RUN mix release --env=prod --verbose") + assert_dockerfile_line("ARG erlang_version=\"21.1\"") + assert_dockerfile_line("ARG elixir_version=\"1.7.4-otp-21\"") + refute_dockerfile_line("RUN mix release") + refute_dockerfile_line("RUN mix distillery.release") end test "phoenix umbrella 1.3 directory with custom erlang and elixir" do run_generator("phoenix_umbrella_1_3", @minimal_config) assert_ignore_line("priv/static") assert_ignore_line("apps/blog_web/assets/node_modules") - assert_dockerfile_line("ARG erlang_version=\"20.0\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.1-otp-20\"") - refute_dockerfile_line("RUN mix release --env=prod --verbose") + assert_dockerfile_line("ARG erlang_version=\"21.1\"") + assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-21\"") + refute_dockerfile_line("RUN mix release") + refute_dockerfile_line("RUN mix distillery.release") end test "phoenix 1.3 directory with release app and custom elixir" do @@ -221,8 +224,8 @@ defmodule GeneratorTest do """ run_generator("phoenix_1_3", config) - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.1\"") + assert_dockerfile_line("ARG erlang_version=\"21.1\"") + assert_dockerfile_line("ARG elixir_version=\"1.7.4-otp-21\"") assert_dockerfile_line("RUN mix release --env=prod --verbose") end @@ -235,18 +238,48 @@ defmodule GeneratorTest do """ run_generator("phoenix_umbrella_1_3", config) - assert_dockerfile_line("ARG erlang_version=\"20.0\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.1-otp-20\"") - assert_dockerfile_line("RUN mix release --env=prod --verbose") + assert_dockerfile_line("ARG erlang_version=\"21.1\"") + assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-21\"") + assert_dockerfile_line("RUN mix release blog") + end + + test "phoenix 1.3 directory with release app and custom mix_env" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + env_variables: + MIX_ENV: staging + """ + + run_generator("phoenix_1_3", config) + assert_dockerfile_line("RUN mix release --env=staging --verbose") + assert_dockerfile_line("COPY --from=app-build /app/_build/staging/rel/blog /app/") + end + + test "phoenix 1.4 directory with release app and custom mix_env" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + env_variables: + MIX_ENV: staging + """ + + run_generator("phoenix_1_4", config) + assert_dockerfile_line("RUN mix distillery.release --env=staging --verbose") + assert_dockerfile_line("COPY --from=app-build /app/_build/staging/rel/blog /app/") end test "minimal directory with prebuilt erlang" do - run_generator("minimal", @minimal_config, prebuilt_erlang_versions: "20.2") - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.3-otp-20\"") + run_generator("minimal", @minimal_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\"") assert_dockerfile_line( - "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-20.2:latest" + "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-22.0.7:latest" ) end @@ -258,12 +291,12 @@ defmodule GeneratorTest do release_app: my_app """ - run_generator("minimal", config, prebuilt_erlang_versions: "20.2") - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.3-otp-20\"") + run_generator("minimal", 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\"") assert_dockerfile_line( - "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-20.2:latest" + "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-22.0.7:latest" ) end @@ -305,8 +338,8 @@ 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: "20.2", - default_elixir_version: "1.5.3-otp-20" + default_erlang_version: "22.0.7", + default_elixir_version: "1.9.0-otp-22" ] opts = diff --git a/erlang-versions.txt b/erlang-versions.txt index 47bcb5c..c6810d0 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -1,53 +1,13 @@ 20.0 -20.0.1 -20.0.2 -20.0.3 -20.0.4 20.0.5 20.1 -20.1.1 -20.1.2 -20.1.3 -20.1.4 -20.1.5 -20.1.6 20.1.7 20.1.7.1 20.2 20.2.0.1 -20.2.1 -20.2.2 -20.2.3 20.2.4 20.3 -20.3.1 -20.3.2 -20.3.3 -20.3.4 -20.3.5 -20.3.6 -20.3.7 20.3.8 -20.3.8.1 -20.3.8.2 -20.3.8.3 -20.3.8.4 -20.3.8.5 -20.3.8.6 -20.3.8.7 -20.3.8.8 -20.3.8.9 -20.3.8.10 -20.3.8.11 -20.3.8.12 -20.3.8.13 -20.3.8.14 -20.3.8.15 -20.3.8.16 -20.3.8.17 -20.3.8.18 -20.3.8.19 -20.3.8.20 20.3.8.21 21.0 21.0.1 @@ -86,8 +46,13 @@ 21.3.8.2 21.3.8.3 21.3.8.4 +21.3.8.5 +21.3.8.6 22.0 22.0.1 22.0.2 22.0.3 22.0.4 +22.0.5 +22.0.6 +22.0.7 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 6f301d4..93695d8 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,12 +20,12 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.0.4"] - @base_erlang_version "22.0.4" - @base_elixir_version "1.8.2-otp-22" - @asdf_version "0.7.2" + @prebuilt_erlang_versions ["22.0.7"] + @base_erlang_version "22.0.7" + @base_elixir_version "1.9.0-otp-22" + @asdf_version "0.7.3" @nodejs_version "10.16.0" - @gcloud_version "252.0.0" + @gcloud_version "253.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index f0adad7..d137434 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,10 +15,10 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.0.4 -DEFAULT_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.7.2 -GCLOUD_VERSION=252.0.0 +DEFAULT_ERLANG_VERSION=22.0.7 +DEFAULT_ELIXIR_VERSION=1.9.0-otp-22 +ASDF_VERSION=0.7.3 +GCLOUD_VERSION=253.0.0 NODEJS_VERSION=10.16.0 diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index cbf71d5..231ed05 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -19,23 +19,12 @@ defmodule SampleAppBuildTest do @moduletag timeout: 300_000 test "Minimal plug app" do - config = """ - env: flex - runtime: elixir - """ - - run_app_test("minimal_plug", config) + run_app_test("minimal_plug") end test "Minimal phoenix app" do - config = """ - env: flex - runtime: elixir - """ - run_app_test( "minimal_phoenix", - config, check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-f", "/app/priv/static/cache_manifest.json"], @@ -44,13 +33,14 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.7\.4}, + ~r{1\.8\.2}, show: true ) end ) end + @tag meme: true test "Minimal phoenix app with release" do config = """ env: flex @@ -61,7 +51,7 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix", - config, + config: config, check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-x", "/app/bin/minimal_phoenix"], @@ -71,7 +61,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.7.4", + "1.8.2", timeout: 10, show: true, verbose: true @@ -89,9 +79,10 @@ defmodule SampleAppBuildTest do entrypoint: MIX_ENV=staging mix phx.server """ - run_app_test("minimal_phoenix", config, expected_output: ~r{from staging}) + run_app_test("minimal_phoenix", config: config, expected_output: ~r{from staging}) end + @tag meme: true test "Minimal phoenix app with release in staging environment" do config = """ env: flex @@ -102,34 +93,90 @@ defmodule SampleAppBuildTest do MIX_ENV: staging """ - run_app_test("minimal_phoenix", config, expected_output: ~r{from staging}) + run_app_test("minimal_phoenix", config: config, expected_output: ~r{from staging}) end test "Minimal phoenix 1.4 app" do + run_app_test( + "minimal_phoenix14", + check_image: fn image -> + assert_cmd_succeeds( + ["docker", "run", "--rm", image, "test", "-f", "/app/priv/static/cache_manifest.json"], + show: true + ) + + assert_cmd_output( + ["docker", "run", "--rm", image, "elixir", "--version"], + ~r{1\.9\.0}, + show: true + ) + end + ) + end + + test "Minimal phoenix 1.4 app with elixir 1.9 release" do config = """ env: flex runtime: elixir + runtime_config: + release_app: minimal_phoenix14 """ run_app_test( "minimal_phoenix14", - config, + config: config, check_image: fn image -> assert_cmd_succeeds( - ["docker", "run", "--rm", image, "test", "-f", "/app/priv/static/cache_manifest.json"], + ["docker", "run", "--rm", image, "test", "-x", "/app/bin/minimal_phoenix14"], show: true ) - + end, + check_container: fn _container -> assert_cmd_output( - ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.8\.2}, + ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], + "1.9.0", + timeout: 10, + show: true, + verbose: true + ) + end + ) + end + + test "Minimal phoenix 1.4 app with distillery 2.1 release" do + config = """ + env: flex + runtime: elixir + runtime_config: + release_app: minimal_phoenix14 + """ + + run_app_test( + "minimal_phoenix14", + config: config, + postprocess_dir: fn dir -> + File.rename!(Path.join(dir, "mix-dist21.exs"), Path.join(dir, "mix.exs")) + File.rename!(Path.join(dir, "mix-dist21.lock"), Path.join(dir, "mix.lock")) + end, + check_image: fn image -> + assert_cmd_succeeds( + ["docker", "run", "--rm", image, "test", "-x", "/app/bin/minimal_phoenix14"], show: true ) + end, + check_container: fn _container -> + assert_cmd_output( + ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], + "1.9.0", + timeout: 10, + show: true, + verbose: true + ) end ) end - test "Minimal phoenix 1.4 app with release" do + test "Minimal phoenix 1.4 app with distillery 2.0 release" do config = """ env: flex runtime: elixir @@ -139,7 +186,18 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix14", - config, + config: config, + tool_versions: "elixir 1.8.2-otp-22\n", + postprocess_dir: fn dir -> + config_path = Path.join([dir, "rel", "config.exs"]) + str = + config_path + |> File.read!() + |> String.replace("Distillery.Releases.Config", "Mix.Releases.Config") + File.write!(config_path, str) + File.rename!(Path.join(dir, "mix-dist20.exs"), Path.join(dir, "mix.exs")) + File.rename!(Path.join(dir, "mix-dist20.lock"), Path.join(dir, "mix.lock")) + end, check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-x", "/app/bin/minimal_phoenix14"], @@ -160,11 +218,18 @@ defmodule SampleAppBuildTest do @apps_dir Path.join(__DIR__, "sample_apps") @tmp_dir Path.join(__DIR__, "tmp") + @default_config """ + env: flex + runtime: elixir + """ - def run_app_test(app_name, config, opts \\ []) do + def run_app_test(app_name, opts \\ []) do check_container = Keyword.get(opts, :check_container, nil) check_image = Keyword.get(opts, :check_image, nil) expected_output = Keyword.get(opts, :expected_output, ~r{Hello, world!}) + config = Keyword.get(opts, :config, @default_config) + tool_versions = Keyword.get(opts, :tool_versions, nil) + postprocess_dir = Keyword.get(opts, :postprocess_dir, nil) File.rm_rf!(@tmp_dir) @@ -176,6 +241,14 @@ defmodule SampleAppBuildTest do |> Path.join("app.yaml") |> File.write!(config) + if tool_versions != nil do + @tmp_dir + |> Path.join(".tool-versions") + |> File.write!(tool_versions) + end + + if postprocess_dir != nil, do: postprocess_dir.(@tmp_dir) + assert_cmd_succeeds( [ "docker", diff --git a/test/sample_apps/minimal_phoenix/.tool-versions b/test/sample_apps/minimal_phoenix/.tool-versions index 7683f4d..8df17ff 100644 --- a/test/sample_apps/minimal_phoenix/.tool-versions +++ b/test/sample_apps/minimal_phoenix/.tool-versions @@ -1 +1 @@ -elixir 1.7.4-otp-21 +elixir 1.8.2-otp-22 diff --git a/test/sample_apps/minimal_phoenix/mix.exs b/test/sample_apps/minimal_phoenix/mix.exs index 967cd36..1040449 100644 --- a/test/sample_apps/minimal_phoenix/mix.exs +++ b/test/sample_apps/minimal_phoenix/mix.exs @@ -5,7 +5,7 @@ defmodule MinimalPhoenix.Mixfile do [ app: :minimal_phoenix, version: "0.0.1", - elixir: "~> 1.4", + elixir: "~> 1.7", compilers: [:phoenix] ++ Mix.compilers, start_permanent: Mix.env == :prod, deps: deps() @@ -24,7 +24,7 @@ defmodule MinimalPhoenix.Mixfile do {:phoenix, "~> 1.3.0"}, {:phoenix_pubsub, "~> 1.0"}, {:phoenix_html, "~> 2.10"}, - {:cowboy, "~> 1.0"}, + {:plug_cowboy, "~> 1.0"}, {:distillery, "~> 1.5"} ] end diff --git a/test/sample_apps/minimal_phoenix/mix.lock b/test/sample_apps/minimal_phoenix/mix.lock index 520ed42..c136c65 100644 --- a/test/sample_apps/minimal_phoenix/mix.lock +++ b/test/sample_apps/minimal_phoenix/mix.lock @@ -1,12 +1,14 @@ -%{"cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5a65601460162d370a70018afe6f949a29dca91f3bb0", [], [{:cowlib, "~> 1.0.2", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3.2", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, - "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [], [], "hexpm"}, - "file_system": {:hex, :file_system, "0.2.2", "7f1e9de4746f4eb8a4ca8f2fbab582d84a4e40fa394cce7bfcb068b988625b06", [], [], "hexpm"}, - "gettext": {:hex, :gettext, "0.13.1", "5e0daf4e7636d771c4c71ad5f3f53ba09a9ae5c250e1ab9c42ba9edccc476263", [], [], "hexpm"}, - "mime": {:hex, :mime, "1.1.0", "01c1d6f4083d8aa5c7b8c246ade95139620ef8effb009edde934e0ec3b28090a", [], [], "hexpm"}, - "phoenix": {:hex, :phoenix, "1.3.0", "1c01124caa1b4a7af46f2050ff11b267baa3edb441b45dbf243e979cd4c5891b", [], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_html": {:hex, :phoenix_html, "2.10.5", "4f9df6b0fb7422a9440a73182a566cb9cbe0e3ffe8884ef9337ccf284fc1ef0a", [], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.1.3", "1d178429fc8950b12457d09c6afec247bfe1fcb6f36209e18fbb0221bdfe4d41", [], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.0 or ~> 1.2 or ~> 1.3", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.0.2", "bfa7fd52788b5eaa09cb51ff9fcad1d9edfeb68251add458523f839392f034c1", [], [], "hexpm"}, - "plug": {:hex, :plug, "1.4.3", "236d77ce7bf3e3a2668dc0d32a9b6f1f9b1f05361019946aae49874904be4aed", [], [{:cowboy, "~> 1.0.1 or ~> 1.1", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"}, - "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [], [], "hexpm"}, - "ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [], [], "hexpm"}} +%{ + "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"}, + "cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], [], "hexpm"}, + "distillery": {:hex, :distillery, "1.5.5", "c6132d5c0152bdce6850fb6c942d58f1971b169b6965d908dc4e8767cfa51a95", [:mix], [], "hexpm"}, + "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.3.4", "aaa1b55e5523083a877bcbe9886d9ee180bf2c8754905323493c2ac325903dc5", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, + "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "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"}, + "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, + "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, + "ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [:rebar3], [], "hexpm"}, +} diff --git a/test/sample_apps/minimal_phoenix14/config/prod.exs b/test/sample_apps/minimal_phoenix14/config/prod.exs index 9f3534a..32e55b3 100644 --- a/test/sample_apps/minimal_phoenix14/config/prod.exs +++ b/test/sample_apps/minimal_phoenix14/config/prod.exs @@ -1,7 +1,8 @@ use Mix.Config config :minimal_phoenix14, MinimalPhoenix14Web.Endpoint, - http: [:inet6, port: System.get_env("PORT") || 4000], + load_from_system_env: true, + http: [:inet6, port: {:system, "PORT"}], url: [host: "example.com", port: 80], cache_static_manifest: "priv/static/cache_manifest.json" diff --git a/test/sample_apps/minimal_phoenix14/mix-dist20.exs b/test/sample_apps/minimal_phoenix14/mix-dist20.exs new file mode 100644 index 0000000..a996271 --- /dev/null +++ b/test/sample_apps/minimal_phoenix14/mix-dist20.exs @@ -0,0 +1,38 @@ +defmodule MinimalPhoenix14.MixProject do + use Mix.Project + + def project do + [ + app: :minimal_phoenix14, + version: "0.1.0", + elixir: "~> 1.8", + elixirc_paths: elixirc_paths(Mix.env()), + compilers: [:phoenix, :gettext] ++ Mix.compilers(), + start_permanent: Mix.env() == :prod, + deps: deps() + ] + end + + def application do + [ + mod: {MinimalPhoenix14.Application, []}, + extra_applications: [:logger, :runtime_tools] + ] + end + + defp elixirc_paths(:test), do: ["lib", "test/support"] + defp elixirc_paths(_), do: ["lib"] + + defp deps do + [ + {:phoenix, "~> 1.4.0"}, + {:phoenix_pubsub, "~> 1.1"}, + {:phoenix_html, "~> 2.11"}, + {:phoenix_live_reload, "~> 1.2", only: :dev}, + {:gettext, "~> 0.11"}, + {:jason, "~> 1.0"}, + {:plug_cowboy, "~> 2.0"}, + {:distillery, "~> 2.0.0"} + ] + end +end diff --git a/test/sample_apps/minimal_phoenix14/mix-dist20.lock b/test/sample_apps/minimal_phoenix14/mix-dist20.lock new file mode 100644 index 0000000..748a656 --- /dev/null +++ b/test/sample_apps/minimal_phoenix14/mix-dist20.lock @@ -0,0 +1,19 @@ +%{ + "artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"}, + "cowboy": {:hex, :cowboy, "2.6.3", "99aa50e94e685557cad82e704457336a453d4abcb77839ad22dbe71f311fcc06", [:rebar3], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, + "cowlib": {:hex, :cowlib, "2.7.3", "a7ffcd0917e6d50b4d5fb28e9e2085a0ceb3c97dea310505f7460ff5ed764ce9", [:rebar3], [], "hexpm"}, + "distillery": {:hex, :distillery, "2.0.14", "25fc1cdad06282334dbf4a11b6e869cc002855c4e11825157498491df2eed594", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, + "file_system": {:hex, :file_system, "0.2.7", "e6f7f155970975789f26e77b8b8d8ab084c59844d8ecfaf58cbda31c494d14aa", [:mix], [], "hexpm"}, + "gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"}, + "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, + "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.4.9", "746d098e10741c334d88143d3c94cab1756435f94387a63441792e66ec0ee974", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.1", "274a4b07c4adbdd7785d45a8b0bb57634d0b4f45b18d2c508b26c0344bd59b8f", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, + "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.1.0", "b75768153c3a8a9e8039d4b25bb9b14efbc58e9c4a6e6a270abff1cd30cbe320", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, + "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm"}, + "telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"}, +} diff --git a/test/sample_apps/minimal_phoenix14/mix-dist21.exs b/test/sample_apps/minimal_phoenix14/mix-dist21.exs new file mode 100644 index 0000000..f9faf7d --- /dev/null +++ b/test/sample_apps/minimal_phoenix14/mix-dist21.exs @@ -0,0 +1,38 @@ +defmodule MinimalPhoenix14.MixProject do + use Mix.Project + + def project do + [ + app: :minimal_phoenix14, + version: "0.1.0", + elixir: "~> 1.9", + elixirc_paths: elixirc_paths(Mix.env()), + compilers: [:phoenix, :gettext] ++ Mix.compilers(), + start_permanent: Mix.env() == :prod, + deps: deps() + ] + end + + def application do + [ + mod: {MinimalPhoenix14.Application, []}, + extra_applications: [:logger, :runtime_tools] + ] + end + + defp elixirc_paths(:test), do: ["lib", "test/support"] + defp elixirc_paths(_), do: ["lib"] + + defp deps do + [ + {:phoenix, "~> 1.4.0"}, + {:phoenix_pubsub, "~> 1.1"}, + {:phoenix_html, "~> 2.11"}, + {:phoenix_live_reload, "~> 1.2", only: :dev}, + {:gettext, "~> 0.11"}, + {:jason, "~> 1.0"}, + {:plug_cowboy, "~> 2.0"}, + {:distillery, "~> 2.1.0"} + ] + end +end diff --git a/test/sample_apps/minimal_phoenix14/mix-dist21.lock b/test/sample_apps/minimal_phoenix14/mix-dist21.lock new file mode 100644 index 0000000..06f8c88 --- /dev/null +++ b/test/sample_apps/minimal_phoenix14/mix-dist21.lock @@ -0,0 +1,19 @@ +%{ + "artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"}, + "cowboy": {:hex, :cowboy, "2.6.3", "99aa50e94e685557cad82e704457336a453d4abcb77839ad22dbe71f311fcc06", [:rebar3], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, + "cowlib": {:hex, :cowlib, "2.7.3", "a7ffcd0917e6d50b4d5fb28e9e2085a0ceb3c97dea310505f7460ff5ed764ce9", [:rebar3], [], "hexpm"}, + "distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, + "file_system": {:hex, :file_system, "0.2.7", "e6f7f155970975789f26e77b8b8d8ab084c59844d8ecfaf58cbda31c494d14aa", [:mix], [], "hexpm"}, + "gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"}, + "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, + "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.4.9", "746d098e10741c334d88143d3c94cab1756435f94387a63441792e66ec0ee974", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.1", "274a4b07c4adbdd7785d45a8b0bb57634d0b4f45b18d2c508b26c0344bd59b8f", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, + "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.1.0", "b75768153c3a8a9e8039d4b25bb9b14efbc58e9c4a6e6a270abff1cd30cbe320", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, + "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm"}, + "telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"}, +} diff --git a/test/sample_apps/minimal_phoenix14/mix.exs b/test/sample_apps/minimal_phoenix14/mix.exs index 3666619..2744a36 100644 --- a/test/sample_apps/minimal_phoenix14/mix.exs +++ b/test/sample_apps/minimal_phoenix14/mix.exs @@ -3,9 +3,10 @@ defmodule MinimalPhoenix14.MixProject do def project do [ + releases: releases(), app: :minimal_phoenix14, version: "0.1.0", - elixir: "~> 1.5", + elixir: "~> 1.9", elixirc_paths: elixirc_paths(Mix.env()), compilers: [:phoenix, :gettext] ++ Mix.compilers(), start_permanent: Mix.env() == :prod, @@ -31,8 +32,17 @@ defmodule MinimalPhoenix14.MixProject do {:phoenix_live_reload, "~> 1.2", only: :dev}, {:gettext, "~> 0.11"}, {:jason, "~> 1.0"}, - {:plug_cowboy, "~> 2.0"}, - {:distillery, "~> 2.0"} + {:plug_cowboy, "~> 2.0"} + ] + end + + defp releases do + [ + minimal_phoenix14: [ + include_erts: true, + include_executables_for: [:unix], + applications: [runtime_tools: :permanent] + ] ] end end diff --git a/test/sample_apps/minimal_phoenix14/mix.lock b/test/sample_apps/minimal_phoenix14/mix.lock index 40e5a24..7244de7 100644 --- a/test/sample_apps/minimal_phoenix14/mix.lock +++ b/test/sample_apps/minimal_phoenix14/mix.lock @@ -1,18 +1,17 @@ %{ - "artificery": {:hex, :artificery, "0.2.6", "f602909757263f7897130cbd006b0e40514a541b148d366ad65b89236b93497a", [:mix], [], "hexpm"}, - "cowboy": {:hex, :cowboy, "2.6.1", "f2e06f757c337b3b311f9437e6e072b678fcd71545a7b2865bdaa154d078593f", [:rebar3], [{:cowlib, "~> 2.7.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, - "cowlib": {:hex, :cowlib, "2.7.0", "3ef16e77562f9855a2605900cedb15c1462d76fb1be6a32fc3ae91973ee543d2", [:rebar3], [], "hexpm"}, - "distillery": {:hex, :distillery, "2.0.12", "6e78fe042df82610ac3fa50bd7d2d8190ad287d120d3cd1682d83a44e8b34dfb", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, - "file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"}, - "gettext": {:hex, :gettext, "0.16.1", "e2130b25eebcbe02bb343b119a07ae2c7e28bd4b146c4a154da2ffb2b3507af2", [:mix], [], "hexpm"}, + "cowboy": {:hex, :cowboy, "2.6.3", "99aa50e94e685557cad82e704457336a453d4abcb77839ad22dbe71f311fcc06", [:rebar3], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, + "cowlib": {:hex, :cowlib, "2.7.3", "a7ffcd0917e6d50b4d5fb28e9e2085a0ceb3c97dea310505f7460ff5ed764ce9", [:rebar3], [], "hexpm"}, + "file_system": {:hex, :file_system, "0.2.7", "e6f7f155970975789f26e77b8b8d8ab084c59844d8ecfaf58cbda31c494d14aa", [:mix], [], "hexpm"}, + "gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"}, "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, - "phoenix": {:hex, :phoenix, "1.4.0", "56fe9a809e0e735f3e3b9b31c1b749d4b436e466d8da627b8d82f90eaae714d2", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, - "phoenix_html": {:hex, :phoenix_html, "2.13.0", "3bad10de5efb6c590f7aa5b316ad0d3faa054715414c9b562c410de4ffb885c5", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.0", "3bb31a9fbd40ffe8652e60c8660dffd72dd231efcdf49b744fb75b9ef7db5dd2", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"}, - "plug": {:hex, :plug, "1.7.1", "8516d565fb84a6a8b2ca722e74e2cd25ca0fc9d64f364ec9dbec09d33eb78ccd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.0.0", "ab0c92728f2ba43c544cce85f0f220d8d30fc0c90eaa1e6203683ab039655062", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.4.9", "746d098e10741c334d88143d3c94cab1756435f94387a63441792e66ec0ee974", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.1", "274a4b07c4adbdd7785d45a8b0bb57634d0b4f45b18d2c508b26c0344bd59b8f", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, + "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.1.0", "b75768153c3a8a9e8039d4b25bb9b14efbc58e9c4a6e6a270abff1cd30cbe320", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm"}, + "telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"}, } diff --git a/test/sample_apps/minimal_phoenix14/rel/config.exs b/test/sample_apps/minimal_phoenix14/rel/config.exs index d33e9e8..c0927f7 100644 --- a/test/sample_apps/minimal_phoenix14/rel/config.exs +++ b/test/sample_apps/minimal_phoenix14/rel/config.exs @@ -1,4 +1,4 @@ -use Mix.Releases.Config, +use Distillery.Releases.Config, default_release: :default, default_environment: Mix.env() From 63d1a331fceb8759f50c464bdde7bbd95c76fcb4 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 18 Jul 2019 11:04:08 -0700 Subject: [PATCH 13/39] Default elixir remains on 1.8.2 if using distillery < 2.1 --- CHANGELOG.md | 2 +- elixir-generate-dockerfile/Dockerfile | 4 +- .../src/lib/app_config.ex | 18 ++- .../src/lib/generator.ex | 18 ++- elixir-generate-dockerfile/src/lib/main.ex | 1 + .../app_config/phoenix_1_3/.tool-versions | 2 - .../app_config/phoenix_1_4/.tool-versions | 2 - .../phoenix_umbrella_1_3/.tool-versions | 2 - .../src/test/app_config_test.exs | 14 +- .../src/test/generator_test.exs | 133 ++++++++++++++---- elixir-pipeline/elixir.yaml.in | 3 +- lib/tasks/build_local_images.ex | 3 + runtime-build.sh | 2 + test/sample_app_build_test.exs | 21 ++- .../minimal_phoenix/.tool-versions | 1 - 15 files changed, 173 insertions(+), 53 deletions(-) delete mode 100644 elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions delete mode 100644 elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions delete mode 100644 elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions delete mode 100644 test/sample_apps/minimal_phoenix/.tool-versions diff --git a/CHANGELOG.md b/CHANGELOG.md index 088559d..e55aa86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ soon as possible. * Supports building releases using the built-in mix release in elixir 1.9. * Supports the usage changes in distillery 2.1. -* Update default elixir to 1.9.0. +* Update default elixir to 1.9.0, unless pre-2.1 distillery is in use in which case it remains on 1.8.2. * Update default OTP to 22.0.7. * Prebuilt OTP through 21.3.8.6 and 22.0.7. * Removed intermediate OTP 20.x versions from the prebuilt list. (The primary and latest versions are still present.) diff --git a/elixir-generate-dockerfile/Dockerfile b/elixir-generate-dockerfile/Dockerfile index 2b4991b..ed2fc34 100644 --- a/elixir-generate-dockerfile/Dockerfile +++ b/elixir-generate-dockerfile/Dockerfile @@ -32,13 +32,15 @@ ARG builder_image="" ARG prebuilt_erlang_images="" ARG default_erlang_version="" ARG default_elixir_version="" +ARG old_distillery_elixir_version="" ENV DEFAULT_OS_IMAGE=${os_image} \ DEFAULT_ASDF_IMAGE=${asdf_image} \ DEFAULT_BUILDER_IMAGE=${builder_image} \ DEFAULT_PREBUILT_ERLANG_IMAGES=${prebuilt_erlang_images} \ DEFAULT_ERLANG_VERSION=${default_erlang_version} \ - DEFAULT_ELIXIR_VERSION=${default_elixir_version} + DEFAULT_ELIXIR_VERSION=${default_elixir_version} \ + OLD_DISTILLERY_ELIXIR_VERSION=${old_distillery_elixir_version} # Install the wrapper script and templates. COPY app/ /app/ diff --git a/elixir-generate-dockerfile/src/lib/app_config.ex b/elixir-generate-dockerfile/src/lib/app_config.ex index 05a2d12..819fa87 100644 --- a/elixir-generate-dockerfile/src/lib/app_config.ex +++ b/elixir-generate-dockerfile/src/lib/app_config.ex @@ -66,7 +66,8 @@ 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) - data = build_data(workspace_dir, default_erlang_version, default_elixir_version) + old_distillery_elixir_version = Keyword.fetch!(args, :old_distillery_elixir_version) + data = build_data(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) {:ok, data} catch {:usage_error, message} -> {:ok, %{error: message}} @@ -77,7 +78,7 @@ defmodule GenerateDockerfile.AppConfig do {:reply, Map.fetch(data, key), data} end - defp build_data(workspace_dir, default_erlang_version, default_elixir_version) do + defp build_data(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) do project_id = get_project() project_id_for_display = project_id || "(unknown)" project_id_for_example = project_id || "my-project-id" @@ -87,6 +88,7 @@ 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_elixir_version, old_distillery_elixir_version, distillery_version) {erlang_version, elixir_version} = get_tool_versions(workspace_dir, default_erlang_version, default_elixir_version) @@ -188,6 +190,18 @@ 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 + end + + defp adjust_default_elixir_version(default_elixir_version, old_distillery_elixir_version, distillery_version) do + if Version.compare(distillery_version, "2.1.0") == :lt do + old_distillery_elixir_version + else + default_elixir_version + end + end + defp get_tool_versions(workspace_dir, default_erlang_version, default_elixir_version) do tool_versions_path = Path.join(workspace_dir, ".tool-versions") diff --git a/elixir-generate-dockerfile/src/lib/generator.ex b/elixir-generate-dockerfile/src/lib/generator.ex index d5e7a26..1dce0da 100644 --- a/elixir-generate-dockerfile/src/lib/generator.ex +++ b/elixir-generate-dockerfile/src/lib/generator.ex @@ -47,6 +47,9 @@ defmodule GenerateDockerfile.Generator do default_elixir_version = Keyword.get(opts, :default_elixir_version, System.get_env("DEFAULT_ELIXIR_VERSION")) + old_distillery_elixir_version = + Keyword.get(opts, :old_distillery_elixir_version, System.get_env("OLD_DISTILLERY_ELIXIR_VERSION")) + prebuilt_erlang_images = Keyword.get_values(opts, :prebuilt_erlang_images) ++ case System.get_env("DEFAULT_PREBUILT_ERLANG_IMAGES") do @@ -61,7 +64,7 @@ defmodule GenerateDockerfile.Generator do |> Path.expand() File.cd!(workspace_dir, fn -> - start_app_config(workspace_dir, default_erlang_version, default_elixir_version) + start_app_config(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) assigns = build_assigns( @@ -79,20 +82,25 @@ defmodule GenerateDockerfile.Generator do :ok end - defp start_app_config(_workspace_dir, "", _default_elixir_version) do + defp start_app_config(_workspace_dir, "", _default_elixir_version, _old_distillery_elixir_version) do GenerateDockerfile.error("Missing default erlang version") end - defp start_app_config(_workspace_dir, _default_erlang_version, "") do + defp start_app_config(_workspace_dir, _default_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, "") do + GenerateDockerfile.error("Missing default elixir version for old distillery") + end + + defp start_app_config(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) do {:ok, _} = AppConfig.start_link( workspace_dir: workspace_dir, default_erlang_version: default_erlang_version, - default_elixir_version: default_elixir_version + default_elixir_version: default_elixir_version, + old_distillery_elixir_version: old_distillery_elixir_version ) case AppConfig.status() do diff --git a/elixir-generate-dockerfile/src/lib/main.ex b/elixir-generate-dockerfile/src/lib/main.ex index 18d0154..d6d9b36 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_elixir_version: :string, template_dir: :string ], aliases: [p: :prebuilt_erlang_images] diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions deleted file mode 100644 index 965206e..0000000 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -erlang 21.1 -elixir 1.7.4-otp-21 diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions deleted file mode 100644 index b505314..0000000 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -erlang 22.0.7 -elixir 1.8.2-otp-22 diff --git a/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions deleted file mode 100644 index ee12cf4..0000000 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -erlang 21.1 -elixir 1.8.2-otp-21 diff --git a/elixir-generate-dockerfile/src/test/app_config_test.exs b/elixir-generate-dockerfile/src/test/app_config_test.exs index b3525f4..d719660 100644 --- a/elixir-generate-dockerfile/src/test/app_config_test.exs +++ b/elixir-generate-dockerfile/src/test/app_config_test.exs @@ -21,6 +21,7 @@ defmodule AppConfigTest do @tmp_dir Path.join(@test_dir, "tmp") @default_erlang_version "22.0.7" @default_elixir_version "1.9.0-otp-22" + @old_distillery_elixir_version "1.8.2-otp-22" @minimal_config """ env: flex @@ -63,6 +64,7 @@ defmodule AppConfigTest do workspace_dir: @tmp_dir, default_erlang_version: @default_erlang_version, default_elixir_version: @default_elixir_version, + old_distillery_elixir_version: @old_distillery_elixir_version, register_module: false ) @@ -231,7 +233,7 @@ defmodule AppConfigTest do ] assert AppConfig.get!(:erlang_version, pid) == "22.0.7" - assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-22" + assert AppConfig.get!(:elixir_version, pid) == "1.9.0-otp-22" end test "phoenix 1.4 with release" do @@ -253,7 +255,7 @@ defmodule AppConfigTest do ] assert AppConfig.get!(:erlang_version, pid) == "22.0.7" - assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-22" + assert AppConfig.get!(:elixir_version, pid) == "1.9.0-otp-22" end test "phoenix 1.3 defaults" do @@ -268,8 +270,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) == "21.1" - assert AppConfig.get!(:elixir_version, pid) == "1.7.4-otp-21" + assert AppConfig.get!(:erlang_version, pid) == "22.0.7" + assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-22" end test "phoenix umbrella 1.3 defaults" do @@ -284,8 +286,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) == "21.1" - assert AppConfig.get!(:elixir_version, pid) == "1.8.2-otp-21" + assert AppConfig.get!(:erlang_version, pid) == "22.0.7" + assert AppConfig.get!(:elixir_version, pid) == "1.9.0-otp-22" 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 2d37500..f97f400 100644 --- a/elixir-generate-dockerfile/src/test/generator_test.exs +++ b/elixir-generate-dockerfile/src/test/generator_test.exs @@ -27,7 +27,7 @@ defmodule GeneratorTest do """ test "minimal directory with minimal config" do - run_generator("minimal", @minimal_config) + run_generator("minimal") assert_ignore_line("Dockerfile") refute_ignore_line("priv/static") refute_file_contents(Path.join(@tmp_dir, ".dockerignore"), ~r{node_modules}m) @@ -53,12 +53,12 @@ defmodule GeneratorTest do service: elixir_app """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line("## Service: elixir_app") end test "minimal directory with custom project" do - run_generator("minimal", @minimal_config, project: "actual-project") + run_generator("minimal", project: "actual-project") assert_dockerfile_line("## Project: actual-project") assert_dockerfile_line("RUN gcloud config set project actual-project") end @@ -70,7 +70,7 @@ defmodule GeneratorTest do entrypoint: my-entrypoint.sh """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line("CMD exec my-entrypoint.sh") end @@ -84,7 +84,7 @@ defmodule GeneratorTest do VAR3: 123 """ - run_generator("minimal", config) + run_generator("minimal", config: config) expected = """ ENV VAR1="value1" \\ @@ -105,7 +105,7 @@ defmodule GeneratorTest do - instance3 """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line( "ENV BUILD_CLOUDSQL_INSTANCES=\"cloud-sql-instance-name,instance2:hi:there,instance3\"" @@ -122,7 +122,7 @@ defmodule GeneratorTest do - brunch build """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line("RUN npm install") assert_dockerfile_line("RUN brunch build") end @@ -135,7 +135,7 @@ defmodule GeneratorTest do packages: libgeos """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line(" && apt-get install -y -q libgeos") end @@ -147,7 +147,7 @@ defmodule GeneratorTest do release_app: my_app """ - run_generator("minimal", config) + 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\"") @@ -167,7 +167,7 @@ defmodule GeneratorTest do entrypoint: /app/bin/my_app start --blah """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line("RUN mix release my_app") assert_dockerfile_line("CMD exec /app/bin/my_app start --blah") end @@ -182,21 +182,31 @@ defmodule GeneratorTest do MIX_ENV: staging """ - run_generator("minimal", config) + run_generator("minimal", config: config) assert_dockerfile_line("RUN mix release my_app") assert_dockerfile_line("COPY --from=app-build /app/_build/staging/rel/my_app /app/") end test "phoenix 1.2 directory" do - run_generator("phoenix_1_2", @minimal_config) + run_generator("phoenix_1_2") assert_ignore_line("priv/static") assert_ignore_line("node_modules") refute_dockerfile_line("RUN mix release") refute_dockerfile_line("RUN mix distillery.release") end + test "phoenix 1.3 directory with default elixir" 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\"") + refute_dockerfile_line("RUN mix release") + refute_dockerfile_line("RUN mix distillery.release") + end + test "phoenix 1.3 directory with custom elixir" do - run_generator("phoenix_1_3", @minimal_config) + run_generator("phoenix_1_3", tool_versions: "erlang 21.1\nelixir 1.7.4-otp-21\n") assert_ignore_line("priv/static") assert_ignore_line("assets/node_modules") assert_dockerfile_line("ARG erlang_version=\"21.1\"") @@ -205,8 +215,18 @@ defmodule GeneratorTest do refute_dockerfile_line("RUN mix distillery.release") end - test "phoenix umbrella 1.3 directory with custom erlang and elixir" do - run_generator("phoenix_umbrella_1_3", @minimal_config) + test "phoenix umbrella 1.3 directory with default elixir" 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\"") + refute_dockerfile_line("RUN mix release") + refute_dockerfile_line("RUN mix distillery.release") + end + + test "phoenix umbrella 1.3 directory with custom elixir" do + run_generator("phoenix_umbrella_1_3", tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n") assert_ignore_line("priv/static") assert_ignore_line("apps/blog_web/assets/node_modules") assert_dockerfile_line("ARG erlang_version=\"21.1\"") @@ -215,6 +235,20 @@ defmodule GeneratorTest do refute_dockerfile_line("RUN mix distillery.release") end + test "phoenix 1.3 directory with release app and default elixir" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + """ + + 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("RUN mix release --env=prod --verbose") + end + test "phoenix 1.3 directory with release app and custom elixir" do config = @minimal_config <> @@ -223,13 +257,13 @@ defmodule GeneratorTest do release_app: blog """ - run_generator("phoenix_1_3", config) + run_generator("phoenix_1_3", config: config, tool_versions: "erlang 21.1\nelixir 1.7.4-otp-21\n") assert_dockerfile_line("ARG erlang_version=\"21.1\"") assert_dockerfile_line("ARG elixir_version=\"1.7.4-otp-21\"") assert_dockerfile_line("RUN mix release --env=prod --verbose") end - test "phoenix umbrella 1.3 directory with release app and custom erlang and elixir" do + test "phoenix umbrella 1.3 directory with release app and default elixir" do config = @minimal_config <> """ @@ -237,7 +271,21 @@ defmodule GeneratorTest do release_app: blog """ - run_generator("phoenix_umbrella_1_3", config) + 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("RUN mix release blog") + end + + test "phoenix umbrella 1.3 directory with release app and custom elixir" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + """ + + run_generator("phoenix_umbrella_1_3", config: config, tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n") assert_dockerfile_line("ARG erlang_version=\"21.1\"") assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-21\"") assert_dockerfile_line("RUN mix release blog") @@ -253,11 +301,39 @@ defmodule GeneratorTest do MIX_ENV: staging """ - run_generator("phoenix_1_3", config) + run_generator("phoenix_1_3", config: config) assert_dockerfile_line("RUN mix release --env=staging --verbose") assert_dockerfile_line("COPY --from=app-build /app/_build/staging/rel/blog /app/") end + test "phoenix 1.4 directory with release app and default elixir" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + """ + + 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("RUN mix distillery.release --env=prod --verbose") + end + + test "phoenix 1.4 directory with release app and custom elixir" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + """ + + run_generator("phoenix_1_4", config: config, tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n") + assert_dockerfile_line("ARG erlang_version=\"21.1\"") + assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-21\"") + assert_dockerfile_line("RUN mix distillery.release --env=prod --verbose") + end + test "phoenix 1.4 directory with release app and custom mix_env" do config = @minimal_config <> @@ -268,13 +344,13 @@ defmodule GeneratorTest do MIX_ENV: staging """ - run_generator("phoenix_1_4", config) + run_generator("phoenix_1_4", config: config) assert_dockerfile_line("RUN mix distillery.release --env=staging --verbose") assert_dockerfile_line("COPY --from=app-build /app/_build/staging/rel/blog /app/") end test "minimal directory with prebuilt erlang" do - run_generator("minimal", @minimal_config, prebuilt_erlang_versions: "22.0.7") + 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\"") @@ -291,7 +367,7 @@ defmodule GeneratorTest do release_app: my_app """ - run_generator("minimal", config, prebuilt_erlang_versions: "22.0.7") + 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\"") @@ -300,10 +376,12 @@ defmodule GeneratorTest do ) end - defp run_generator(dir, config, args \\ []) do + defp run_generator(dir, args \\ []) do config_file = Keyword.get(args, :config_file, nil) project = Keyword.get(args, :project, nil) prebuilt_erlang_versions = Keyword.get(args, :prebuilt_erlang_versions, "") + config = Keyword.get(args, :config, @minimal_config) + tool_versions = Keyword.get(args, :tool_versions, nil) File.rm_rf!(@tmp_dir) @@ -332,6 +410,12 @@ defmodule GeneratorTest do |> File.write!(config) end + if tool_versions do + @tmp_dir + |> Path.join(".tool-versions") + |> File.write!(tool_versions) + end + opts = [ workspace_dir: @tmp_dir, template_dir: @template_dir, @@ -339,7 +423,8 @@ defmodule GeneratorTest do 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" + default_elixir_version: "1.9.0-otp-22", + old_distillery_elixir_version: "1.8.2-otp-22" ] opts = diff --git a/elixir-pipeline/elixir.yaml.in b/elixir-pipeline/elixir.yaml.in index 143b346..ca37193 100644 --- a/elixir-pipeline/elixir.yaml.in +++ b/elixir-pipeline/elixir.yaml.in @@ -5,7 +5,8 @@ steps: '--asdf-image=@@ASDF_BASE_IMAGE@@:@@TAG@@', '--builder-image=@@BUILDER_IMAGE@@:@@TAG@@', '--default-erlang-version=@@DEFAULT_ERLANG_VERSION@@', - '--default-elixir-version=@@DEFAULT_ELIXIR_VERSION@@'] + '--default-elixir-version=@@DEFAULT_ELIXIR_VERSION@@', + '--old-distillery-elixir-version=@@OLD_DISTILLERY_ELIXIR_VERSION@@'] - name: 'gcr.io/cloud-builders/docker:latest' args: ['build', '--network=cloudbuild', '-t', '$_OUTPUT_IMAGE', '.'] images: diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 93695d8..738f696 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -23,6 +23,7 @@ defmodule Mix.Tasks.BuildLocalImages do @prebuilt_erlang_versions ["22.0.7"] @base_erlang_version "22.0.7" @base_elixir_version "1.9.0-otp-22" + @old_distillery_elixir_version "1.8.2-otp-22" @asdf_version "0.7.3" @nodejs_version "10.16.0" @gcloud_version "253.0.0" @@ -187,6 +188,8 @@ defmodule Mix.Tasks.BuildLocalImages do "default_erlang_version=#{@base_erlang_version}", "--build-arg", "default_elixir_version=#{@base_elixir_version}", + "--build-arg", + "old_distillery_elixir_version=#{@old_distillery_elixir_version}", "." ], into: IO.stream(:stdio, :line) diff --git a/runtime-build.sh b/runtime-build.sh index d137434..e60fc84 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -17,6 +17,7 @@ DEFAULT_ERLANG_VERSION=22.0.7 DEFAULT_ELIXIR_VERSION=1.9.0-otp-22 +OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 ASDF_VERSION=0.7.3 GCLOUD_VERSION=253.0.0 NODEJS_VERSION=10.16.0 @@ -234,6 +235,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_ELIXIR_VERSION@@|${OLD_DISTILLERY_ELIXIR_VERSION}|g;\ s|@@TAG@@|${IMAGE_TAG}|g;\ s|@@PREBUILT_IMAGE_ARGS@@|${PREBUILT_IMAGE_ARGS}|g" \ < ${DIRNAME}/elixir-pipeline/elixir.yaml.in > ${DIRNAME}/tmp/elixir-${IMAGE_TAG}.yaml diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 231ed05..6dd7e80 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -25,6 +25,7 @@ defmodule SampleAppBuildTest do test "Minimal phoenix app" do run_app_test( "minimal_phoenix", + tool_versions: "elixir 1.8.2-otp-22\n", check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-f", "/app/priv/static/cache_manifest.json"], @@ -40,7 +41,6 @@ defmodule SampleAppBuildTest do ) end - @tag meme: true test "Minimal phoenix app with release" do config = """ env: flex @@ -51,6 +51,7 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix", + tool_versions: "elixir 1.8.2-otp-22\n", config: config, check_image: fn image -> assert_cmd_succeeds( @@ -79,10 +80,14 @@ defmodule SampleAppBuildTest do entrypoint: MIX_ENV=staging mix phx.server """ - run_app_test("minimal_phoenix", config: config, expected_output: ~r{from staging}) + run_app_test( + "minimal_phoenix", + tool_versions: "elixir 1.8.2-otp-22\n", + config: config, + expected_output: ~r{from staging} + ) end - @tag meme: true test "Minimal phoenix app with release in staging environment" do config = """ env: flex @@ -93,7 +98,12 @@ defmodule SampleAppBuildTest do MIX_ENV: staging """ - run_app_test("minimal_phoenix", config: config, expected_output: ~r{from staging}) + run_app_test( + "minimal_phoenix", + tool_versions: "elixir 1.8.2-otp-22\n", + config: config, + expected_output: ~r{from staging} + ) end test "Minimal phoenix 1.4 app" do @@ -187,7 +197,6 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix14", config: config, - tool_versions: "elixir 1.8.2-otp-22\n", postprocess_dir: fn dir -> config_path = Path.join([dir, "rel", "config.exs"]) str = @@ -246,7 +255,7 @@ defmodule SampleAppBuildTest do |> Path.join(".tool-versions") |> File.write!(tool_versions) end - + if postprocess_dir != nil, do: postprocess_dir.(@tmp_dir) assert_cmd_succeeds( diff --git a/test/sample_apps/minimal_phoenix/.tool-versions b/test/sample_apps/minimal_phoenix/.tool-versions deleted file mode 100644 index 8df17ff..0000000 --- a/test/sample_apps/minimal_phoenix/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -elixir 1.8.2-otp-22 From 64d588bbf185f5728f0503ad7d0e3ab021c9b518 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 18 Jul 2019 11:09:33 -0700 Subject: [PATCH 14/39] Mix format --- .../src/lib/app_config.ex | 36 +++++++++++++--- .../src/lib/generator.ex | 42 +++++++++++++++---- .../src/test/app_config_test.exs | 1 + .../src/test/generator_test.exs | 18 ++++++-- test/sample_app_build_test.exs | 8 ++-- 5 files changed, 87 insertions(+), 18 deletions(-) diff --git a/elixir-generate-dockerfile/src/lib/app_config.ex b/elixir-generate-dockerfile/src/lib/app_config.ex index 819fa87..8064cab 100644 --- a/elixir-generate-dockerfile/src/lib/app_config.ex +++ b/elixir-generate-dockerfile/src/lib/app_config.ex @@ -67,7 +67,15 @@ defmodule GenerateDockerfile.AppConfig do default_erlang_version = Keyword.fetch!(args, :default_erlang_version) default_elixir_version = Keyword.fetch!(args, :default_elixir_version) old_distillery_elixir_version = Keyword.fetch!(args, :old_distillery_elixir_version) - data = build_data(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) + + data = + build_data( + workspace_dir, + default_erlang_version, + default_elixir_version, + old_distillery_elixir_version + ) + {:ok, data} catch {:usage_error, message} -> {:ok, %{error: message}} @@ -78,7 +86,12 @@ defmodule GenerateDockerfile.AppConfig do {:reply, Map.fetch(data, key), data} end - defp build_data(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) do + defp build_data( + workspace_dir, + default_erlang_version, + default_elixir_version, + old_distillery_elixir_version + ) do project_id = get_project() project_id_for_display = project_id || "(unknown)" project_id_for_example = project_id || "my-project-id" @@ -88,7 +101,13 @@ 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_elixir_version, old_distillery_elixir_version, distillery_version) + default_elixir_version = + adjust_default_elixir_version( + default_elixir_version, + old_distillery_elixir_version, + distillery_version + ) + {erlang_version, elixir_version} = get_tool_versions(workspace_dir, default_erlang_version, default_elixir_version) @@ -103,7 +122,10 @@ defmodule GenerateDockerfile.AppConfig do mix_env = Map.get(env_variables, "MIX_ENV", @default_mix_env) install_packages = get_install_packages(runtime_config, app_config) cloud_sql_instances = get_cloud_sql_instances(beta_settings) - entrypoint = get_entrypoint(runtime_config, app_config, phoenix_prefix, distillery_version, release_app) + + entrypoint = + get_entrypoint(runtime_config, app_config, phoenix_prefix, distillery_version, release_app) + assets_dir = get_assets_dir(workspace_dir, phoenix_version) assets_builder = get_assets_builder(workspace_dir, assets_dir) build_scripts = get_build_scripts(runtime_config, assets_dir, assets_builder, phoenix_prefix) @@ -194,7 +216,11 @@ defmodule GenerateDockerfile.AppConfig do default_elixir_version end - defp adjust_default_elixir_version(default_elixir_version, old_distillery_elixir_version, distillery_version) do + defp adjust_default_elixir_version( + default_elixir_version, + old_distillery_elixir_version, + distillery_version + ) do if Version.compare(distillery_version, "2.1.0") == :lt do old_distillery_elixir_version else diff --git a/elixir-generate-dockerfile/src/lib/generator.ex b/elixir-generate-dockerfile/src/lib/generator.ex index 1dce0da..7a516d4 100644 --- a/elixir-generate-dockerfile/src/lib/generator.ex +++ b/elixir-generate-dockerfile/src/lib/generator.ex @@ -48,7 +48,11 @@ defmodule GenerateDockerfile.Generator do Keyword.get(opts, :default_elixir_version, System.get_env("DEFAULT_ELIXIR_VERSION")) old_distillery_elixir_version = - Keyword.get(opts, :old_distillery_elixir_version, System.get_env("OLD_DISTILLERY_ELIXIR_VERSION")) + Keyword.get( + opts, + :old_distillery_elixir_version, + System.get_env("OLD_DISTILLERY_ELIXIR_VERSION") + ) prebuilt_erlang_images = Keyword.get_values(opts, :prebuilt_erlang_images) ++ @@ -64,7 +68,12 @@ defmodule GenerateDockerfile.Generator do |> Path.expand() File.cd!(workspace_dir, fn -> - start_app_config(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) + start_app_config( + workspace_dir, + default_erlang_version, + default_elixir_version, + old_distillery_elixir_version + ) assigns = build_assigns( @@ -82,11 +91,21 @@ defmodule GenerateDockerfile.Generator do :ok end - defp start_app_config(_workspace_dir, "", _default_elixir_version, _old_distillery_elixir_version) do + defp start_app_config( + _workspace_dir, + "", + _default_elixir_version, + _old_distillery_elixir_version + ) do GenerateDockerfile.error("Missing default erlang version") end - defp start_app_config(_workspace_dir, _default_erlang_version, "", _old_distillery_elixir_version) do + defp start_app_config( + _workspace_dir, + _default_erlang_version, + "", + _old_distillery_elixir_version + ) do GenerateDockerfile.error("Missing default elixir version") end @@ -94,7 +113,12 @@ defmodule GenerateDockerfile.Generator do GenerateDockerfile.error("Missing default elixir version for old distillery") end - defp start_app_config(workspace_dir, default_erlang_version, default_elixir_version, old_distillery_elixir_version) do + defp start_app_config( + workspace_dir, + default_erlang_version, + default_elixir_version, + old_distillery_elixir_version + ) do {:ok, _} = AppConfig.start_link( workspace_dir: workspace_dir, @@ -128,8 +152,12 @@ defmodule GenerateDockerfile.Generator do end end) - release_command = render_release_command( - AppConfig.get!(:distillery_version), AppConfig.get!(:mix_env), AppConfig.get!(:release_app)) + release_command = + render_release_command( + AppConfig.get!(:distillery_version), + AppConfig.get!(:mix_env), + AppConfig.get!(:release_app) + ) [ os_image: os_image, diff --git a/elixir-generate-dockerfile/src/test/app_config_test.exs b/elixir-generate-dockerfile/src/test/app_config_test.exs index d719660..9f9973e 100644 --- a/elixir-generate-dockerfile/src/test/app_config_test.exs +++ b/elixir-generate-dockerfile/src/test/app_config_test.exs @@ -243,6 +243,7 @@ defmodule AppConfigTest do runtime_config: release_app: my_app """ + pid = AppConfigTest.setup_test("phoenix_1_4", config) assert AppConfig.status(pid) == :ok assert AppConfig.get!(:entrypoint, pid) == "[\"/app/bin/my_app\",\"foreground\"]" diff --git a/elixir-generate-dockerfile/src/test/generator_test.exs b/elixir-generate-dockerfile/src/test/generator_test.exs index f97f400..b5b4981 100644 --- a/elixir-generate-dockerfile/src/test/generator_test.exs +++ b/elixir-generate-dockerfile/src/test/generator_test.exs @@ -257,7 +257,11 @@ defmodule GeneratorTest do release_app: blog """ - run_generator("phoenix_1_3", config: config, tool_versions: "erlang 21.1\nelixir 1.7.4-otp-21\n") + run_generator("phoenix_1_3", + config: config, + tool_versions: "erlang 21.1\nelixir 1.7.4-otp-21\n" + ) + assert_dockerfile_line("ARG erlang_version=\"21.1\"") assert_dockerfile_line("ARG elixir_version=\"1.7.4-otp-21\"") assert_dockerfile_line("RUN mix release --env=prod --verbose") @@ -285,7 +289,11 @@ defmodule GeneratorTest do release_app: blog """ - run_generator("phoenix_umbrella_1_3", config: config, tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n") + run_generator("phoenix_umbrella_1_3", + config: config, + tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n" + ) + assert_dockerfile_line("ARG erlang_version=\"21.1\"") assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-21\"") assert_dockerfile_line("RUN mix release blog") @@ -328,7 +336,11 @@ defmodule GeneratorTest do release_app: blog """ - run_generator("phoenix_1_4", config: config, tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n") + run_generator("phoenix_1_4", + config: config, + tool_versions: "erlang 21.1\nelixir 1.8.2-otp-21\n" + ) + assert_dockerfile_line("ARG erlang_version=\"21.1\"") assert_dockerfile_line("ARG elixir_version=\"1.8.2-otp-21\"") assert_dockerfile_line("RUN mix distillery.release --env=prod --verbose") diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 6dd7e80..2b63efc 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -199,10 +199,12 @@ defmodule SampleAppBuildTest do config: config, postprocess_dir: fn dir -> config_path = Path.join([dir, "rel", "config.exs"]) + str = config_path |> File.read!() |> String.replace("Distillery.Releases.Config", "Mix.Releases.Config") + File.write!(config_path, str) File.rename!(Path.join(dir, "mix-dist20.exs"), Path.join(dir, "mix.exs")) File.rename!(Path.join(dir, "mix-dist20.lock"), Path.join(dir, "mix.lock")) @@ -228,9 +230,9 @@ defmodule SampleAppBuildTest do @apps_dir Path.join(__DIR__, "sample_apps") @tmp_dir Path.join(__DIR__, "tmp") @default_config """ - env: flex - runtime: elixir - """ + env: flex + runtime: elixir + """ def run_app_test(app_name, opts \\ []) do check_container = Keyword.get(opts, :check_container, nil) From fbcc383baf6c2c808e45365f75a4856ae4c7b285 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 18 Jul 2019 13:10:44 -0700 Subject: [PATCH 15/39] Update changelog and readme for release --- CHANGELOG.md | 6 +++--- README.md | 47 +++++++++++++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e55aa86..0f594ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,16 +9,16 @@ choosing the following in your `app.yaml` config file: However, you may also pin to a specific version of the runtime by specifying the version name as the yaml file name. For example, to pin to the -`elixir-2019-05-28-222238` release, use: +`elixir-2019-07-01-065508` release, use: - runtime: gs://elixir-runtime/elixir-2019-05-28-222238.yaml + runtime: gs://elixir-runtime/elixir-2019-07-01-065508.yaml There is currently no guarantee regarding how long older runtime releases will continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## (unreleased) +## elixir-2019-07-18-112708 * Supports building releases using the built-in mix release in elixir 1.9. * Supports the usage changes in distillery 2.1. diff --git a/README.md b/README.md index 7268bbe..9cc7285 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,15 @@ You may consider deploying your Elixir application to Google App Engine if: You should consider a different hosting solution such as, e.g., [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) if: -* Your application uses websockets, as this feature is not yet supported by - Google App Engine. * Your application uses Erlang's hot upgrade feature because it stores critical state in long-running processes. App Engine is designed for "stateless" apps that use a separate store such as a database for long-term state. +Elixir support is specific to the +[flexible environment](https://cloud.google.com/appengine/docs/flexible/) of +App Engine. The standard environment does not currently support Elixir. + ## Using the Elixir Runtime The Elixir Runtime for Google Cloud Platform is an experimental runtime making @@ -56,12 +58,15 @@ need a Google Cloud project with billing enabled, and you must have the necessary with gcloud 175.0.0 and later, and you should now remove this config if you currently have it.) -### Configuring an app with Distillery releases +### Configuring an app with releases -Generally, we recommend that you set up releases for your application using -[Distillery](https://github.com/bitwalker/distillery). Releases are the -community's standard way to package and deploy your code, and they also help -optimize the size and performance of your deployed application. +Generally, we recommend that you set up releases for your application. Releases +are the community's standard way to package and deploy your code, and they also +help optimize the size and performance of your deployed application. Releases +can be built using the +[mix release](https://elixir-lang.org/getting-started/mix-otp/config-and-releases.html#releases) +feature of Elixir 1.9 or later, or using the +[Distillery](https://github.com/bitwalker/distillery) package. If your application uses releases, the Elixir Runtime will build a release automatically, in the `:prod` environment, when you deploy to App Engine. @@ -70,8 +75,8 @@ runtime is included. The release will be built in the cloud on the same OS and architecture that it will run on, so you do not need to worry about cross-compilation. -Once you have configured Distillery, create a file called `app.yaml` at the -root of your application directory, with the following contents: +Once you have configured releases, create a file called `app.yaml` at the root +of your application directory, with the following contents: env: flex runtime: gs://elixir-runtime/elixir.yaml @@ -90,8 +95,8 @@ will still apply. ### Configuring an app without releases The Elixir Runtime also supports deploying an application that does not build -releases. If your app does not use Distillery, create a file called `app.yaml` -at the root of your application directory, with the following contents: +releases. If your app does not use releases, create a file called `app.yaml` at +the root of your application directory, with the following contents: env: flex runtime: gs://elixir-runtime/elixir.yaml @@ -159,17 +164,23 @@ corresponding clause for the environment in your `rel/config.exs` file.) The Elixir Runtime uses the [asdf](https://github.com/asdf-vm/asdf) tool to install and manage Erlang and Elixir. By default, it will run your application -on recent stable releases of those languages. However, you may specify which -versions to use by providing a `.tool-versions` file with versions for `erlang` -and `elixir`. See the [asdf](https://github.com/asdf-vm/asdf) documentation for -more information on the format of the `.tool-versions` file. +on recent stable releases of those languages. However, the default versions may +change at any time, and indeed may depend on the type of application. (For +example, as of July 2019, the default Elixir version for most applications is +1.9.0, except if the application uses a version of Distillery prior to 2.1, in +which case it defaults to 1.8.2 to avoid mix task collisions.) + +If you need more stability in the language versions used, you may provide a +`.tool-versions` file with versions for `erlang` and `elixir`. See the +[asdf](https://github.com/asdf-vm/asdf) documentation for more information on +the format of the `.tool-versions` file. When you deploy an Elixir application, the Elixir runtime will install the requested releases of Erlang and Elixir into your application image "just-in-time". In most cases, this is pretty quick. Asdf installs Elixir directly from precompiled binaries hosted on hex.pm. For Erlang, the Elixir -Runtime itself provides prebuilt binaries of recent versions of Erlang since -Erlang 17, and can install any of these directly. +Runtime itself provides prebuilt binaries of most recent versions of Erlang +since Erlang 20, and can install any of these directly. However, if you request an Erlang version for which we do not have a prebuilt binary, the Elixir runtime will have to build Erlang from source. This can @@ -187,7 +198,7 @@ is not explicitly set, it defaults to 10 minutes. The Elixir Runtime provides a standard build script that includes installation of Erlang and Elixir, fetching dependencies, compiling your application, and -(for release-based applications) building the release using Distillery. +(for release-based applications) building the release. There is also a space for custom build commands that are executed after compilation but before release generation. Your application might use this From 05145e402df2458ad0481700558b1991d302d079 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 9 Oct 2019 18:10:15 -0700 Subject: [PATCH 16/39] Support newer default erlang and elixir versions (#27) --- .travis.yml | 2 +- CHANGELOG.md | 9 +++++++++ erlang-versions.txt | 3 +++ lib/tasks/build_local_images.ex | 12 ++++++------ runtime-build.sh | 10 +++++----- test/sample_app_build_test.exs | 6 +++--- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa3de47..6c01fe1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: required language: elixir elixir: - - '1.9.0' + - '1.9.1' services: - docker diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f594ca..a2d0d14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,15 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## (unreleased) + +* Prebuilt OTP 21.3.8.6, 22.1, and 22.1.1. +* Update default to elixir to 1.9.1. +* Update default OTP to 22.1.1. +* Update gcloud to 265.0.0 +* Update nodejs to 10.16.3 +* Update asdf to 0.7.4 + ## elixir-2019-07-18-112708 * Supports building releases using the built-in mix release in elixir 1.9. diff --git a/erlang-versions.txt b/erlang-versions.txt index c6810d0..4cceed6 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -48,6 +48,7 @@ 21.3.8.4 21.3.8.5 21.3.8.6 +21.3.8.7 22.0 22.0.1 22.0.2 @@ -56,3 +57,5 @@ 22.0.5 22.0.6 22.0.7 +22.1 +22.1.1 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 738f696..e13774a 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.0.7"] - @base_erlang_version "22.0.7" - @base_elixir_version "1.9.0-otp-22" + @prebuilt_erlang_versions ["22.1.1"] + @base_erlang_version "22.1.1" + @base_elixir_version "1.9.1-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" - @asdf_version "0.7.3" - @nodejs_version "10.16.0" - @gcloud_version "253.0.0" + @asdf_version "0.7.4" + @nodejs_version "10.16.3" + @gcloud_version "265.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index e60fc84..8c83919 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.0.7 -DEFAULT_ELIXIR_VERSION=1.9.0-otp-22 +DEFAULT_ERLANG_VERSION=22.1.1 +DEFAULT_ELIXIR_VERSION=1.9.1-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.7.3 -GCLOUD_VERSION=253.0.0 -NODEJS_VERSION=10.16.0 +ASDF_VERSION=0.7.4 +GCLOUD_VERSION=265.0.0 +NODEJS_VERSION=10.16.3 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 2b63efc..10d6643 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.9\.0}, + ~r{1\.9\.1}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.0", + "1.9.1", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.0", + "1.9.1", timeout: 10, show: true, verbose: true From 9ee82a3851ed1486e9c3ff6ac09c2b36009208b6 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 9 Oct 2019 18:10:24 -0700 Subject: [PATCH 17/39] Fix debian package name regex (#28) --- elixir-generate-dockerfile/src/lib/app_config.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir-generate-dockerfile/src/lib/app_config.ex b/elixir-generate-dockerfile/src/lib/app_config.ex index 8064cab..401d00e 100644 --- a/elixir-generate-dockerfile/src/lib/app_config.ex +++ b/elixir-generate-dockerfile/src/lib/app_config.ex @@ -298,7 +298,7 @@ defmodule GenerateDockerfile.AppConfig do |> List.wrap() Enum.each(install_packages, fn pkg -> - unless Regex.match?(~r{\A[\w.-]+\z}, pkg) do + unless Regex.match?(~r{\A[\w.+-]+\z}, pkg) do throw({:usage_error, "Illegal debian package name: `#{pkg}`."}) end end) From 0f473943d6894feea09e163a1420c7f099d4e091 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 9 Oct 2019 20:42:20 -0700 Subject: [PATCH 18/39] Release elixir-2019-10-09-181239 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2d0d14..19e92a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,11 +18,12 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## (unreleased) +## elixir-2019-10-09-181239 * Prebuilt OTP 21.3.8.6, 22.1, and 22.1.1. * Update default to elixir to 1.9.1. * Update default OTP to 22.1.1. +* Allow custom debian packages with plus signs in the name. * Update gcloud to 265.0.0 * Update nodejs to 10.16.3 * Update asdf to 0.7.4 From 3feacde9ebd70971381f43bb8a5357823dcbd440 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 29 Oct 2019 15:07:56 -0700 Subject: [PATCH 19/39] Update elixir, erlang, and software versions --- CHANGELOG.md | 15 ++++++++++++--- erlang-versions.txt | 15 +++++++-------- lib/tasks/build_local_images.ex | 10 +++++----- runtime-build.sh | 8 ++++---- test/sample_app_build_test.exs | 6 +++--- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19e92a7..805b3d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,18 +9,27 @@ choosing the following in your `app.yaml` config file: However, you may also pin to a specific version of the runtime by specifying the version name as the yaml file name. For example, to pin to the -`elixir-2019-07-01-065508` release, use: +`elixir-2019-10-09-181239` release, use: - runtime: gs://elixir-runtime/elixir-2019-07-01-065508.yaml + runtime: gs://elixir-runtime/elixir-2019-10-09-181239.yaml There is currently no guarantee regarding how long older runtime releases will continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## Unreleased + +* Prebuilt OTP up to 21.3.8.10 and 22.1.5 +* Removed prebuilt OTP 21.0.1 through 21.0.8 (but kept 21.0 and 21.0.9) +* Update default elixir to 1.9.2 +* Update default OTP to 22.1.5 +* Update gcloud to 268.0.0 +* Update nodejs to 12.13.0 + ## elixir-2019-10-09-181239 -* Prebuilt OTP 21.3.8.6, 22.1, and 22.1.1. +* Prebuilt OTP 21.3.8.7, 22.1, and 22.1.1. * Update default to elixir to 1.9.1. * Update default OTP to 22.1.1. * Allow custom debian packages with plus signs in the name. diff --git a/erlang-versions.txt b/erlang-versions.txt index 4cceed6..78eae69 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -10,14 +10,6 @@ 20.3.8 20.3.8.21 21.0 -21.0.1 -21.0.2 -21.0.3 -21.0.4 -21.0.5 -21.0.6 -21.0.7 -21.0.8 21.0.9 21.1 21.1.1 @@ -49,6 +41,9 @@ 21.3.8.5 21.3.8.6 21.3.8.7 +21.3.8.8 +21.3.8.9 +21.3.8.10 22.0 22.0.1 22.0.2 @@ -59,3 +54,7 @@ 22.0.7 22.1 22.1.1 +22.1.2 +22.1.3 +22.1.4 +22.1.5 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index e13774a..68f4c34 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.1.1"] - @base_erlang_version "22.1.1" - @base_elixir_version "1.9.1-otp-22" + @prebuilt_erlang_versions ["22.1.5"] + @base_erlang_version "22.1.5" + @base_elixir_version "1.9.2-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" @asdf_version "0.7.4" - @nodejs_version "10.16.3" - @gcloud_version "265.0.0" + @nodejs_version "12.13.0" + @gcloud_version "268.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 8c83919..9494f7d 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.1.1 -DEFAULT_ELIXIR_VERSION=1.9.1-otp-22 +DEFAULT_ERLANG_VERSION=22.1.5 +DEFAULT_ELIXIR_VERSION=1.9.2-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 ASDF_VERSION=0.7.4 -GCLOUD_VERSION=265.0.0 -NODEJS_VERSION=10.16.3 +GCLOUD_VERSION=268.0.0 +NODEJS_VERSION=12.13.0 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 10d6643..9f4279e 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.9\.1}, + ~r{1\.9\.2}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.1", + "1.9.2", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.1", + "1.9.2", timeout: 10, show: true, verbose: true From 4f9685b74a8d62d8604b5498c925dbfb8716f766 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 30 Oct 2019 17:47:09 -0700 Subject: [PATCH 20/39] Release elixir-2019-10-29-183530 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 805b3d2..9441627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## Unreleased +## elixir-2019-10-29-183530 * Prebuilt OTP up to 21.3.8.10 and 22.1.5 * Removed prebuilt OTP 21.0.1 through 21.0.8 (but kept 21.0 and 21.0.9) From 63b377b2e4162c54644a950797f3c6b0a29ee04c Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 14 Nov 2019 22:33:35 -0800 Subject: [PATCH 21/39] Update elixir and erlang versions --- CHANGELOG.md | 8 ++++++++ erlang-versions.txt | 2 ++ lib/tasks/build_local_images.ex | 10 +++++----- runtime-build.sh | 8 ++++---- test/sample_app_build_test.exs | 6 +++--- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9441627..5b72c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,14 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## unreleased + +* Prebuilt OTP up to 22.1.7 +* Update default elixir to 1.9.4 +* Update default OTP to 22.1.7 +* Update gcloud to 271.0.0 +* Update asdf to 0.7.5 + ## elixir-2019-10-29-183530 * Prebuilt OTP up to 21.3.8.10 and 22.1.5 diff --git a/erlang-versions.txt b/erlang-versions.txt index 78eae69..ccefca6 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -58,3 +58,5 @@ 22.1.3 22.1.4 22.1.5 +22.1.6 +22.1.7 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 68f4c34..0772f9d 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.1.5"] - @base_erlang_version "22.1.5" - @base_elixir_version "1.9.2-otp-22" + @prebuilt_erlang_versions ["22.1.7"] + @base_erlang_version "22.1.7" + @base_elixir_version "1.9.4-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" - @asdf_version "0.7.4" + @asdf_version "0.7.5" @nodejs_version "12.13.0" - @gcloud_version "268.0.0" + @gcloud_version "271.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 9494f7d..f64c82a 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,11 +15,11 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.1.5 -DEFAULT_ELIXIR_VERSION=1.9.2-otp-22 +DEFAULT_ERLANG_VERSION=22.1.7 +DEFAULT_ELIXIR_VERSION=1.9.4-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.7.4 -GCLOUD_VERSION=268.0.0 +ASDF_VERSION=0.7.5 +GCLOUD_VERSION=271.0.0 NODEJS_VERSION=12.13.0 diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 9f4279e..97d757a 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.9\.2}, + ~r{1\.9\.4}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.2", + "1.9.4", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.2", + "1.9.4", timeout: 10, show: true, verbose: true From eee31a257df8be5a8489623943b082c643e8f747 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 14 Nov 2019 23:56:17 -0800 Subject: [PATCH 22/39] Release elixir-2019-11-14-223500 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b72c1c..ccad1e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## unreleased +## elixir-2019-11-14-223500 * Prebuilt OTP up to 22.1.7 * Update default elixir to 1.9.4 From 03da94ef3ef538d33c8bf99559fd1e1243fb2afd Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 10 Dec 2019 14:28:43 -0800 Subject: [PATCH 23/39] Update versions --- CHANGELOG.md | 7 +++++++ erlang-versions.txt | 2 ++ lib/tasks/build_local_images.ex | 8 ++++---- runtime-build.sh | 6 +++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccad1e7..76e1d71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## unreleased + +* Prebuilt OTP 21.3.8.11 and 22.1.8 +* Update default OTP to 22.1.8 +* Update gcloud to 273.0.0 +* Update nodejs to 12.13.1 + ## elixir-2019-11-14-223500 * Prebuilt OTP up to 22.1.7 diff --git a/erlang-versions.txt b/erlang-versions.txt index ccefca6..a97fbf2 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -44,6 +44,7 @@ 21.3.8.8 21.3.8.9 21.3.8.10 +21.3.8.11 22.0 22.0.1 22.0.2 @@ -60,3 +61,4 @@ 22.1.5 22.1.6 22.1.7 +22.1.8 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 0772f9d..f596fb4 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.1.7"] - @base_erlang_version "22.1.7" + @prebuilt_erlang_versions ["22.1.8"] + @base_erlang_version "22.1.8" @base_elixir_version "1.9.4-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" @asdf_version "0.7.5" - @nodejs_version "12.13.0" - @gcloud_version "271.0.0" + @nodejs_version "12.13.1" + @gcloud_version "273.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index f64c82a..c5bee8f 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.1.7 +DEFAULT_ERLANG_VERSION=22.1.8 DEFAULT_ELIXIR_VERSION=1.9.4-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 ASDF_VERSION=0.7.5 -GCLOUD_VERSION=271.0.0 -NODEJS_VERSION=12.13.0 +GCLOUD_VERSION=273.0.0 +NODEJS_VERSION=12.13.1 set -e From 4e139cb11804001d05940e2def449aab112184f9 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 11 Dec 2019 11:06:52 -0800 Subject: [PATCH 24/39] Release elixir-2019-12-10-142915 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76e1d71..4d8a2af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## unreleased +## elixir-2019-12-10-142915 * Prebuilt OTP 21.3.8.11 and 22.1.8 * Update default OTP to 22.1.8 From ce3a65a4b5fedddce8ea6b6eff1fb7a57ad19556 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 22 Jan 2020 15:38:38 -0800 Subject: [PATCH 25/39] Update versions --- CHANGELOG.md | 8 ++++++++ elixir-asdf/structure-test.json | 2 +- lib/tasks/build_local_images.ex | 10 +++++----- runtime-build.sh | 8 ++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d8a2af..5e66512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,14 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## unreleased + +* Prebuilt OTP 21.3.8.12, 22.1.8.1, and 22.2 through 22.2.3 +* Update default OTP to 22.2.3 +* Update gcloud to 277.0.0 +* Update nodejs to 12.14.1 +* Update asdf to 0.7.6 + ## elixir-2019-12-10-142915 * Prebuilt OTP 21.3.8.11 and 22.1.8 diff --git a/elixir-asdf/structure-test.json b/elixir-asdf/structure-test.json index 8958865..d535a86 100644 --- a/elixir-asdf/structure-test.json +++ b/elixir-asdf/structure-test.json @@ -4,7 +4,7 @@ { "name": "test_asdf_installation", "command": ["asdf", "--version"], - "expectedOutput": ["v[0-9]+\\.[0-9]+\\.[0-9]+\n"] + "expectedOutput": ["v[0-9]+\\.[0-9]+\\.[0-9]+"] } ] } diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index f596fb4..bbb500a 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.1.8"] - @base_erlang_version "22.1.8" + @prebuilt_erlang_versions ["22.2.3"] + @base_erlang_version "22.2.3" @base_elixir_version "1.9.4-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" - @asdf_version "0.7.5" - @nodejs_version "12.13.1" - @gcloud_version "273.0.0" + @asdf_version "0.7.6" + @nodejs_version "12.14.1" + @gcloud_version "277.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index c5bee8f..68f7e2c 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.1.8 +DEFAULT_ERLANG_VERSION=22.2.3 DEFAULT_ELIXIR_VERSION=1.9.4-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.7.5 -GCLOUD_VERSION=273.0.0 -NODEJS_VERSION=12.13.1 +ASDF_VERSION=0.7.6 +GCLOUD_VERSION=277.0.0 +NODEJS_VERSION=12.14.1 set -e From b53bd825449f81fd18aea9794157866c35b6df1f Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 22 Jan 2020 15:39:37 -0800 Subject: [PATCH 26/39] Update list of erlang versions --- erlang-versions.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erlang-versions.txt b/erlang-versions.txt index a97fbf2..54247b2 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -45,6 +45,7 @@ 21.3.8.9 21.3.8.10 21.3.8.11 +21.3.8.12 22.0 22.0.1 22.0.2 @@ -62,3 +63,8 @@ 22.1.6 22.1.7 22.1.8 +22.1.8.1 +22.2 +22.2.1 +22.2.2 +22.2.3 From 7e10b70f3e42713a178c177bb9866d554ffbd1e6 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 22 Jan 2020 17:21:30 -0800 Subject: [PATCH 27/39] Release elixir-2020-01-22-160655 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e66512..7dfde26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## unreleased +## elixir-2020-01-22-160655 * Prebuilt OTP 21.3.8.12, 22.1.8.1, and 22.2 through 22.2.3 * Update default OTP to 22.2.3 From 6f55bf4e470ffd20f06cd74bdbffa7e54984ca91 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Sat, 4 Apr 2020 15:39:08 -0700 Subject: [PATCH 28/39] Update versions --- CHANGELOG.md | 9 +++++++++ elixir-generate-dockerfile/src/mix.lock | 10 +++++----- erlang-versions.txt | 8 ++++++++ lib/tasks/build_local_images.ex | 12 ++++++------ mix.lock | 2 +- runtime-build.sh | 10 +++++----- test/sample_app_build_test.exs | 6 +++--- 7 files changed, 37 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dfde26..4c47f40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,15 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## Unreleased + +* Update default Elixir to 1.10.2 +* Update default OTP to 22.2.8 +* Prebuilt OTP 21.3.8.13, 21.3.8.14, 22.2.4 through 22.2.8, and 22.3. +* Update gcloud to 287.0.0 +* Update nodejs to 12.16.1 +* Update asdf to 0.7.8 + ## elixir-2020-01-22-160655 * Prebuilt OTP 21.3.8.12, 22.1.8.1, and 22.2 through 22.2.3 diff --git a/elixir-generate-dockerfile/src/mix.lock b/elixir-generate-dockerfile/src/mix.lock index e938b60..abd2a41 100644 --- a/elixir-generate-dockerfile/src/mix.lock +++ b/elixir-generate-dockerfile/src/mix.lock @@ -1,7 +1,7 @@ %{ - "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, - "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, - "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"}, - "yamerl": {:hex, :yamerl, "0.7.0", "e51dba652dce74c20a88294130b48051ebbbb0be7d76f22de064f0f3ccf0aaf5", [:rebar3], [], "hexpm"}, - "yaml_elixir": {:hex, :yaml_elixir, "2.4.0", "2f444abc3c994c902851fde56b6a9cb82895c291c05a0490a289035c2e62ae71", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm"}, + "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, + "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.7.0", "e51dba652dce74c20a88294130b48051ebbbb0be7d76f22de064f0f3ccf0aaf5", [:rebar3], [], "hexpm", "cb5a4481e2e2ad36db83bd9962153e1a9208e2b2484185e33fc2caac6a50b108"}, + "yaml_elixir": {:hex, :yaml_elixir, "2.4.0", "2f444abc3c994c902851fde56b6a9cb82895c291c05a0490a289035c2e62ae71", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "4e25a6d5c873e393689c6f1062c5ec90f6cd1be2527b073178ae37eae4c78bee"}, } diff --git a/erlang-versions.txt b/erlang-versions.txt index 54247b2..22ed374 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -46,6 +46,8 @@ 21.3.8.10 21.3.8.11 21.3.8.12 +21.3.8.13 +21.3.8.14 22.0 22.0.1 22.0.2 @@ -68,3 +70,9 @@ 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 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index bbb500a..9726853 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.2.3"] - @base_erlang_version "22.2.3" - @base_elixir_version "1.9.4-otp-22" + @prebuilt_erlang_versions ["22.2.8"] + @base_erlang_version "22.2.8" + @base_elixir_version "1.10.2-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" - @asdf_version "0.7.6" - @nodejs_version "12.14.1" - @gcloud_version "277.0.0" + @asdf_version "0.7.8" + @nodejs_version "12.16.1" + @gcloud_version "287.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/mix.lock b/mix.lock index faec082..4a3ac36 100644 --- a/mix.lock +++ b/mix.lock @@ -1,3 +1,3 @@ %{ - "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, + "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, } diff --git a/runtime-build.sh b/runtime-build.sh index 68f7e2c..eb38554 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.2.3 -DEFAULT_ELIXIR_VERSION=1.9.4-otp-22 +DEFAULT_ERLANG_VERSION=22.2.8 +DEFAULT_ELIXIR_VERSION=1.10.2-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.7.6 -GCLOUD_VERSION=277.0.0 -NODEJS_VERSION=12.14.1 +ASDF_VERSION=0.7.8 +GCLOUD_VERSION=287.0.0 +NODEJS_VERSION=12.16.1 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 97d757a..2c1107e 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.9\.4}, + ~r{1\.10\.2}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.4", + "1.10.2", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.9.4", + "1.10.2", timeout: 10, show: true, verbose: true From ab5504a07cc0583e20cc5d1afe77712cb099104b Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 7 Apr 2020 18:50:07 -0700 Subject: [PATCH 29/39] Release elixir-2020-04-07-131853 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c47f40..27e7777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## Unreleased +## elixir-2020-04-07-131853 * Update default Elixir to 1.10.2 * Update default OTP to 22.2.8 From 24bac1e92b6528b188012559a65c9100039c6b5d Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Mon, 3 Aug 2020 13:11:19 -0700 Subject: [PATCH 30/39] Update versions --- CHANGELOG.md | 8 ++++++++ elixir-generate-dockerfile/src/mix.lock | 4 ++-- erlang-versions.txt | 26 +++++++++++++++---------- lib/tasks/build_local_images.ex | 10 +++++----- runtime-build.sh | 8 ++++---- test/sample_app_build_test.exs | 6 +++--- 6 files changed, 38 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e7777..ec59af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,14 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## Unreleased + +* Update default Elixir to 1.10.4. +* Update default OTP to 22.3.4.4. +* Prebuilt OTP 20.3.8.26, 21.3.8.17, 22.3.1 through 22.3.4.4, and 23.0 through 23.0.3. +* Update gcloud to 303.0.0 +* Update nodejs to 12.18.3 + ## elixir-2020-04-07-131853 * Update default Elixir to 1.10.2 diff --git a/elixir-generate-dockerfile/src/mix.lock b/elixir-generate-dockerfile/src/mix.lock index abd2a41..396a1b8 100644 --- a/elixir-generate-dockerfile/src/mix.lock +++ b/elixir-generate-dockerfile/src/mix.lock @@ -2,6 +2,6 @@ "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, "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.7.0", "e51dba652dce74c20a88294130b48051ebbbb0be7d76f22de064f0f3ccf0aaf5", [:rebar3], [], "hexpm", "cb5a4481e2e2ad36db83bd9962153e1a9208e2b2484185e33fc2caac6a50b108"}, - "yaml_elixir": {:hex, :yaml_elixir, "2.4.0", "2f444abc3c994c902851fde56b6a9cb82895c291c05a0490a289035c2e62ae71", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "4e25a6d5c873e393689c6f1062c5ec90f6cd1be2527b073178ae37eae4c78bee"}, + "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"}, } diff --git a/erlang-versions.txt b/erlang-versions.txt index 22ed374..e8878fc 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -8,21 +8,12 @@ 20.2.4 20.3 20.3.8 -20.3.8.21 +20.3.8.26 21.0 21.0.9 21.1 -21.1.1 -21.1.2 -21.1.3 21.1.4 21.2 -21.2.1 -21.2.2 -21.2.3 -21.2.4 -21.2.5 -21.2.6 21.2.7 21.3 21.3.1 @@ -48,6 +39,9 @@ 21.3.8.12 21.3.8.13 21.3.8.14 +21.3.8.15 +21.3.8.16 +21.3.8.17 22.0 22.0.1 22.0.2 @@ -76,3 +70,15 @@ 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 +23.0 +23.0.1 +23.0.2 +23.0.3 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 9726853..48be87c 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.2.8"] - @base_erlang_version "22.2.8" - @base_elixir_version "1.10.2-otp-22" + @prebuilt_erlang_versions ["22.3.4.4"] + @base_erlang_version "22.3.4.4" + @base_elixir_version "1.10.4-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" @asdf_version "0.7.8" - @nodejs_version "12.16.1" - @gcloud_version "287.0.0" + @nodejs_version "12.18.3" + @gcloud_version "303.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index eb38554..7342791 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.2.8 -DEFAULT_ELIXIR_VERSION=1.10.2-otp-22 +DEFAULT_ERLANG_VERSION=22.3.4.4 +DEFAULT_ELIXIR_VERSION=1.10.4-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 ASDF_VERSION=0.7.8 -GCLOUD_VERSION=287.0.0 -NODEJS_VERSION=12.16.1 +GCLOUD_VERSION=303.0.0 +NODEJS_VERSION=12.18.3 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 2c1107e..d88850d 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.10\.2}, + ~r{1\.10\.4}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.10.2", + "1.10.4", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.10.2", + "1.10.4", timeout: 10, show: true, verbose: true From 865eca203f896f6d2e6e196eba62e94813bc7819 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Mon, 3 Aug 2020 13:31:57 -0700 Subject: [PATCH 31/39] Release elixir-2020-08-03-131308 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec59af6..777c4b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## Unreleased +## elixir-2020-08-03-131308 * Update default Elixir to 1.10.4. * Update default OTP to 22.3.4.4. From 4f606d55d388703e76ac14a0aecacd443e75452c Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 1 Dec 2020 10:14:30 -0800 Subject: [PATCH 32/39] chore: Add GitHub Actions CI (#35) --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ca6c4d5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: "CI tests" + +on: + pull_request: + branches: + - master + push: + branches: + - master + workflow_dispatch: + +jobs: + tests: + if: ${{ github.repository == 'GoogleCloudPlatform/elixir-runtime' }} + runs-on: ubuntu-latest + steps: + - name: Install Elixir + uses: actions/setup-elixir@v1 + with: + otp-version: "23.1.4" + elixir-version: "1.11.2" + - name: Checkout repo + uses: actions/checkout@v2 + - name: Compile + run: | + mix do deps.get, compile + - name: Build + shell: bash + run: mix build_local_images --prebuilt-images-tag=staging + - name: Test + shell: bash + run: mix test From 658378184364e087f47cc4daff44238545f21612 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 1 Dec 2020 16:39:57 -0800 Subject: [PATCH 33/39] feat: Update versions (#34) --- .travis.yml | 17 ------------ CHANGELOG.md | 9 ++++++ elixir-generate-dockerfile/src/mix.lock | 2 +- erlang-versions.txt | 37 ++++++++++--------------- lib/tasks/build_local_images.ex | 12 ++++---- runtime-build.sh | 10 +++---- test/sample_app_build_test.exs | 6 ++-- 7 files changed, 38 insertions(+), 55 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6c01fe1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -sudo: required - -language: elixir -elixir: - - '1.9.1' - -services: - - docker - -before_install: - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - sudo apt-get update - - sudo apt-get -y install docker-ce - -script: - - mix build_local_images --prebuilt-images-tag=staging && mix test diff --git a/CHANGELOG.md b/CHANGELOG.md index 777c4b7..8f75e55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,15 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## (unreleased) + +* Update default Elixir to 1.11.2. +* Update default OTP to 22.3.4.12. +* Prebuilt OTP 22.3.4.5 through 22.3.4.12, 23.0.4, and 23.1 through 23.1.4. +* Update gcloud to 319.0.0. +* Update nodejs to 14.15.1. +* Update asdf to 0.8.0 + ## elixir-2020-08-03-131308 * Update default Elixir to 1.10.4. diff --git a/elixir-generate-dockerfile/src/mix.lock b/elixir-generate-dockerfile/src/mix.lock index 396a1b8..4499244 100644 --- a/elixir-generate-dockerfile/src/mix.lock +++ b/elixir-generate-dockerfile/src/mix.lock @@ -1,5 +1,5 @@ %{ - "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, + "mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"}, "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"}, diff --git a/erlang-versions.txt b/erlang-versions.txt index e8878fc..17cae0f 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -16,31 +16,8 @@ 21.2 21.2.7 21.3 -21.3.1 -21.3.2 -21.3.3 -21.3.4 -21.3.5 -21.3.6 -21.3.7 21.3.7.1 21.3.8 -21.3.8.1 -21.3.8.2 -21.3.8.3 -21.3.8.4 -21.3.8.5 -21.3.8.6 -21.3.8.7 -21.3.8.8 -21.3.8.9 -21.3.8.10 -21.3.8.11 -21.3.8.12 -21.3.8.13 -21.3.8.14 -21.3.8.15 -21.3.8.16 21.3.8.17 22.0 22.0.1 @@ -78,7 +55,21 @@ 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 23.0 23.0.1 23.0.2 23.0.3 +23.0.4 +23.1 +23.1.1 +23.1.2 +23.1.3 +23.1.4 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 48be87c..25a5782 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.3.4.4"] - @base_erlang_version "22.3.4.4" - @base_elixir_version "1.10.4-otp-22" + @prebuilt_erlang_versions ["22.3.4.12"] + @base_erlang_version "22.3.4.12" + @base_elixir_version "1.11.2-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" - @asdf_version "0.7.8" - @nodejs_version "12.18.3" - @gcloud_version "303.0.0" + @asdf_version "0.8.0" + @nodejs_version "14.15.1" + @gcloud_version "319.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 7342791..186f6b4 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.3.4.4 -DEFAULT_ELIXIR_VERSION=1.10.4-otp-22 +DEFAULT_ERLANG_VERSION=22.3.4.12 +DEFAULT_ELIXIR_VERSION=1.11.2-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 -ASDF_VERSION=0.7.8 -GCLOUD_VERSION=303.0.0 -NODEJS_VERSION=12.18.3 +ASDF_VERSION=0.8.0 +GCLOUD_VERSION=319.0.0 +NODEJS_VERSION=14.15.1 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index d88850d..6cbf975 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.10\.4}, + ~r{1\.11\.2}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.10.4", + "1.11.2", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.10.4", + "1.11.2", timeout: 10, show: true, verbose: true From ce3278f59256f7b7b77ec3b66599ea7013e9d0c5 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 21 Apr 2021 17:39:57 -0700 Subject: [PATCH 34/39] feat: Update versions (#36) --- .github/workflows/ci.yml | 5 +++-- elixir-builder/structure-test.json | 2 +- erlang-build.sh | 2 +- erlang-versions.txt | 29 ++++++++++++++++++----------- lib/tasks/build_local_images.ex | 10 +++++----- runtime-build.sh | 8 ++++---- test/sample_app_build_test.exs | 6 +++--- 7 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca6c4d5..688f2a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,9 @@ jobs: - name: Install Elixir uses: actions/setup-elixir@v1 with: - otp-version: "23.1.4" - elixir-version: "1.11.2" + otp-version: "23.3.1" + elixir-version: "1.11.4" + experimental-otp: true - name: Checkout repo uses: actions/checkout@v2 - name: Compile diff --git a/elixir-builder/structure-test.json b/elixir-builder/structure-test.json index 7160b01..34dcfe4 100644 --- a/elixir-builder/structure-test.json +++ b/elixir-builder/structure-test.json @@ -9,7 +9,7 @@ { "name": "test_cloudsqlproxy_installation", "command": ["cloud_sql_proxy", "--version"], - "expectedOutput": ["Cloud SQL Proxy"] + "expectedOutput": ["Cloud SQL Auth proxy"] }, { "name": "test_gcloud_installation", diff --git a/erlang-build.sh b/erlang-build.sh index b60c452..2df07fa 100755 --- a/erlang-build.sh +++ b/erlang-build.sh @@ -30,7 +30,7 @@ if [ -f ${DIRNAME}/erlang-versions.txt ]; then fi STAGING_FLAG= AUTO_YES= -BUILD_TIMEOUT=60m +BUILD_TIMEOUT=90m show_usage() { echo 'Usage: ./erlang-build.sh [flags...]' >&2 diff --git a/erlang-versions.txt b/erlang-versions.txt index 17cae0f..3d75a54 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -1,14 +1,3 @@ -20.0 -20.0.5 -20.1 -20.1.7 -20.1.7.1 -20.2 -20.2.0.1 -20.2.4 -20.3 -20.3.8 -20.3.8.26 21.0 21.0.9 21.1 @@ -63,6 +52,11 @@ 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 23.0.2 @@ -73,3 +67,16 @@ 23.1.2 23.1.3 23.1.4 +23.1.5 +23.2 +23.2.1 +23.2.2 +23.2.3 +23.2.4 +23.2.5 +23.2.6 +23.2.7 +23.2.7.1 +23.2.7.2 +23.3 +23.3.1 diff --git a/lib/tasks/build_local_images.ex b/lib/tasks/build_local_images.ex index 25a5782..8e49c60 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,13 +20,13 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["22.3.4.12"] - @base_erlang_version "22.3.4.12" - @base_elixir_version "1.11.2-otp-22" + @prebuilt_erlang_versions ["22.3.4.17"] + @base_erlang_version "22.3.4.17" + @base_elixir_version "1.11.4-otp-22" @old_distillery_elixir_version "1.8.2-otp-22" @asdf_version "0.8.0" - @nodejs_version "14.15.1" - @gcloud_version "319.0.0" + @nodejs_version "14.16.1" + @gcloud_version "334.0.0" @prebuilt_erlang_image_prefix "elixir-prebuilt-erlang-" diff --git a/runtime-build.sh b/runtime-build.sh index 186f6b4..c344b66 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,12 +15,12 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=22.3.4.12 -DEFAULT_ELIXIR_VERSION=1.11.2-otp-22 +DEFAULT_ERLANG_VERSION=22.3.4.17 +DEFAULT_ELIXIR_VERSION=1.11.4-otp-22 OLD_DISTILLERY_ELIXIR_VERSION=1.8.2-otp-22 ASDF_VERSION=0.8.0 -GCLOUD_VERSION=319.0.0 -NODEJS_VERSION=14.15.1 +GCLOUD_VERSION=334.0.0 +NODEJS_VERSION=14.16.1 set -e diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index 6cbf975..d5a3bba 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -117,7 +117,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.11\.2}, + ~r{1\.11\.4}, show: true ) end @@ -144,7 +144,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.11.2", + "1.11.4", timeout: 10, show: true, verbose: true @@ -177,7 +177,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.11.2", + "1.11.4", timeout: 10, show: true, verbose: true From 1746adf362444e3e0cc2daa5e461be24f1cb624a Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 27 Apr 2021 11:49:52 -0700 Subject: [PATCH 35/39] Release elixir-2021-04-26-035921 (#37) --- CHANGELOG.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f75e55..9994d89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,14 +18,15 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. -## (unreleased) - -* Update default Elixir to 1.11.2. -* Update default OTP to 22.3.4.12. -* Prebuilt OTP 22.3.4.5 through 22.3.4.12, 23.0.4, and 23.1 through 23.1.4. -* Update gcloud to 319.0.0. -* Update nodejs to 14.15.1. -* Update asdf to 0.8.0 +## elixir-2021-04-26-035921 + +* Update default Elixir to 1.11.4. +* Update default OTP to 22.3.4.17. +* Prebuilt OTP 22.3.4.5 through 22.3.4.17, 23.0.4, 23.1 through 23.1.5, 23.2 through 23.2.7.2, and 23.3 through 23.3.1. +* Dropped prebuilt binaries for OTP 20.x. +* Update gcloud to 334.0.0. +* Update nodejs to 14.16.1. +* Update asdf to 0.8.0. ## elixir-2020-08-03-131308 From d5069cceb43ba9391ebe32a570c615dcb7d62936 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 26 Oct 2021 10:52:38 -0700 Subject: [PATCH 36/39] chore: Update default branch name to main --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 688f2a3..7400ab4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,10 @@ name: "CI tests" on: pull_request: branches: - - master + - main push: branches: - - master + - main workflow_dispatch: jobs: From 879bcc19239760701ba7f028aacc873553d117dc Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Thu, 24 Mar 2022 22:21:00 -0700 Subject: [PATCH 37/39] 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 From b1510f3d216c5652d561b385c7408e17c586f046 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Mon, 28 Mar 2022 11:30:09 -0700 Subject: [PATCH 38/39] release: elixir-2022-03-25-173415 (#42) --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9994d89..ec83278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,16 @@ continue to be supported. It is generally best not to pin to a specific release unless absolutely necessary, and then you should return to latest as soon as possible. +## elixir-2022-03-25-173415 + +* Update default Elixir to 1.13.3. +* Update default OTP to 23.3.4.11. +* Prebuilt OTP 23.1.4.1, 23.2.7.3, 23.2.7.4, 23.3.2 through 23.3.4.11, and 24.0 through 24.3.2. +* Dropped prebuilt binaries for OTP 22.x except the "latest" patch of each branch. Currently, we provide prebuilt binaries for branch tips of OTP 21 and 22, and all released versions of OTP 23 and 24. +* Update gcloud to 378.0.0. +* Update nodejs to 16.14.2. +* Update asdf to 0.9.0. + ## elixir-2021-04-26-035921 * Update default Elixir to 1.11.4. From d03c5927d0630a45918dfd0c65d9ef8c6855e8eb Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Mon, 5 Jan 2026 12:45:16 +0000 Subject: [PATCH 39/39] chore: Migrate gsutil usage to gcloud storage --- runtime-build.sh | 4 ++-- runtime-release.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime-build.sh b/runtime-build.sh index 27927a8..73e86a6 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -244,10 +244,10 @@ sed -e "s|@@GENERATE_DOCKERFILE_IMAGE@@|${GENERATE_DOCKERFILE_IMAGE}|g;\ echo "**** Created runtime config: ${DIRNAME}/tmp/elixir-${IMAGE_TAG}.yaml" if [ -n "${UPLOAD_BUCKET}" ]; then - gsutil cp ${DIRNAME}/tmp/elixir-${IMAGE_TAG}.yaml gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml + gcloud storage cp ${DIRNAME}/tmp/elixir-${IMAGE_TAG}.yaml gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml echo "**** Uploaded runtime config to gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml" if [ "${STAGING_FLAG}" = "true" ]; then - gsutil cp gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml gs://${UPLOAD_BUCKET}/elixir-staging.yaml + gcloud storage cp gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml gs://${UPLOAD_BUCKET}/elixir-staging.yaml echo "**** Also promoted runtime config to gs://${UPLOAD_BUCKET}/elixir-staging.yaml" fi fi diff --git a/runtime-release.sh b/runtime-release.sh index 0a6e323..2f8c00f 100755 --- a/runtime-release.sh +++ b/runtime-release.sh @@ -101,6 +101,6 @@ gcloud container images add-tag --project ${PROJECT} \ echo "**** Tagged image ${GENERATE_DOCKERFILE_IMAGE}:${IMAGE_TAG} as latest" if [ -n "${UPLOAD_BUCKET}" ]; then - gsutil cp gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml gs://${UPLOAD_BUCKET}/elixir.yaml + gcloud storage cp gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml gs://${UPLOAD_BUCKET}/elixir.yaml echo "**** Promoted runtime config gs://${UPLOAD_BUCKET}/elixir-${IMAGE_TAG}.yaml to gs://${UPLOAD_BUCKET}/elixir.yaml" fi