diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f405460 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: "CI tests" + +on: + pull_request: + branches: + - main + push: + branches: + - main + 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.3.4.11" + elixir-version: "1.13.3" + experimental-otp: true + - 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7feaa63..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -sudo: required - -language: elixir -elixir: - - '1.6.6' - - '1.7.4' - - '1.8.1' -otp_release: - - '20.3.8' - - '21.2.6' - -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 978838b..ec83278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,20 +9,137 @@ 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-10-09-181239` release, use: - runtime: gs://elixir-runtime/elixir-2019-01-19-000446.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 +## 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. +* 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 + +* 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 +* 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 +* 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 +* 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 +* 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 +* 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.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. +* 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. +* Supports the usage changes in distillery 2.1. +* 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.) +* 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. +* 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. +* 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. +* 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. +* 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). * 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/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 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/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/elixir-generate-dockerfile/Dockerfile b/elixir-generate-dockerfile/Dockerfile index 2b4991b..88e9b27 100644 --- a/elixir-generate-dockerfile/Dockerfile +++ b/elixir-generate-dockerfile/Dockerfile @@ -32,13 +32,17 @@ 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} \ 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_ERLANG_VERSION=${old_distillery_erlang_version} \ + OLD_DISTILLERY_ELIXIR_VERSION=${old_distillery_elixir_version} # Install the wrapper script and templates. COPY app/ /app/ 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..982cf90 100644 --- a/elixir-generate-dockerfile/src/lib/app_config.ex +++ b/elixir-generate-dockerfile/src/lib/app_config.ex @@ -66,7 +66,18 @@ 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_erlang_version = Keyword.fetch!(args, :old_distillery_erlang_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_erlang_version, + old_distillery_elixir_version + ) + {:ok, data} catch {:usage_error, message} -> {:ok, %{error: message}} @@ -77,15 +88,31 @@ 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_erlang_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" 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) + {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 + ) + {erlang_version, elixir_version} = get_tool_versions(workspace_dir, default_erlang_version, default_elixir_version) @@ -100,7 +127,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, 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 +151,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 +192,7 @@ defmodule GenerateDockerfile.AppConfig do {result, _} = Code.eval_file(mix_lock_path) - [:phoenix] + [:distillery, :phoenix] |> Enum.reduce(%{}, fn pkg, acc -> pkg_info = result[pkg] @@ -186,6 +217,30 @@ defmodule GenerateDockerfile.AppConfig do if Version.compare(version, "1.3.0") == :lt, do: "phoenix", else: "phx" end + 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_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_erlang_version, old_distillery_elixir_version} + else + {default_erlang_version, 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") @@ -256,7 +311,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) @@ -280,25 +335,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..4b14cff 100644 --- a/elixir-generate-dockerfile/src/lib/generator.ex +++ b/elixir-generate-dockerfile/src/lib/generator.ex @@ -47,6 +47,20 @@ 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, + :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 +75,13 @@ 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_erlang_version, + old_distillery_elixir_version + ) assigns = build_assigns( @@ -79,20 +99,58 @@ 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_erlang_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_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 + + defp start_app_config( + workspace_dir, + default_erlang_version, + default_elixir_version, + old_distillery_erlang_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_erlang_version: old_distillery_erlang_version, + old_distillery_elixir_version: old_distillery_elixir_version ) case AppConfig.status() do @@ -120,6 +178,13 @@ 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 +204,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 +248,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/lib/main.ex b/elixir-generate-dockerfile/src/lib/main.ex index 18d0154..d530058 100644 --- a/elixir-generate-dockerfile/src/lib/main.ex +++ b/elixir-generate-dockerfile/src/lib/main.ex @@ -27,6 +27,8 @@ 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 ], aliases: [p: :prebuilt_erlang_images] diff --git a/elixir-generate-dockerfile/src/mix.lock b/elixir-generate-dockerfile/src/mix.lock index 970b1c5..0c24232 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.1.0", "79ec163e0f379dadf4b0e8b5162567dc1feb96c3cfa793105869e2c616ab4342", [:mix], [{:yamerl, "~> 0.7", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm"}, + "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.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/phoenix_1_3/.tool-versions b/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions deleted file mode 100644 index fd08988..0000000 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_3/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -elixir 1.5.1 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 deleted file mode 100644 index 965206e..0000000 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_1_4/.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/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 deleted file mode 100644 index 03d31ca..0000000 --- a/elixir-generate-dockerfile/src/test/app_config/phoenix_umbrella_1_3/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -erlang 20.0 -elixir 1.5.1-otp-20 diff --git a/elixir-generate-dockerfile/src/test/app_config_test.exs b/elixir-generate-dockerfile/src/test/app_config_test.exs index 4624b14..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,10 @@ 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 "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 @@ -63,6 +65,8 @@ 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 ) @@ -164,7 +168,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 +226,30 @@ 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" + + 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) == @default_erlang_version + assert AppConfig.get!(:elixir_version, pid) == @default_elixir_version + 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" @@ -230,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) == "21.1" - assert AppConfig.get!(:elixir_version, pid) == "1.7.4-otp-21" + 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 @@ -246,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) == @default_erlang_version - assert AppConfig.get!(:elixir_version, pid) == "1.5.1" + 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 @@ -262,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) == "20.0" - assert AppConfig.get!(:elixir_version, pid) == "1.5.1-otp-20" + 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 ddf0f12..f62fe38 100644 --- a/elixir-generate-dockerfile/src/test/generator_test.exs +++ b/elixir-generate-dockerfile/src/test/generator_test.exs @@ -21,13 +21,18 @@ 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 """ 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) @@ -35,13 +40,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=\"#{@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\"") 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 @@ -53,12 +58,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 +75,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 +89,7 @@ defmodule GeneratorTest do VAR3: 123 """ - run_generator("minimal", config) + run_generator("minimal", config: config) expected = """ ENV VAR1="value1" \\ @@ -105,7 +110,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 +127,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 +140,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,15 +152,15 @@ 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=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.3-otp-20\"") + 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 --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 +169,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") + 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 test "minimal directory with release app and custom mix_env" do @@ -182,37 +187,60 @@ defmodule GeneratorTest do MIX_ENV: staging """ - run_generator("minimal", config) - assert_dockerfile_line("RUN mix release --env=staging --verbose") + 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 --env=prod --verbose") + 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=\"#{@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 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=\"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) + 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=\"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=\"#{@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 - test "phoenix 1.3 directory with release app and custom elixir" do + 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\"") + 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 default elixir" do config = @minimal_config <> """ @@ -220,13 +248,13 @@ defmodule GeneratorTest do release_app: blog """ - run_generator("phoenix_1_3", config) - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.1\"") + run_generator("phoenix_1_3", config: config) + 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 - test "phoenix umbrella 1.3 directory with release app and custom erlang and elixir" do + test "phoenix 1.3 directory with release app and custom elixir" do config = @minimal_config <> """ @@ -234,19 +262,117 @@ defmodule GeneratorTest do release_app: blog """ - 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\"") + 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 default elixir" do + config = + @minimal_config <> + """ + runtime_config: + release_app: blog + """ + + run_generator("phoenix_umbrella_1_3", config: config) + 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 + + 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") + 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: 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=\"#{@default_erlang_version}\"") + assert_dockerfile_line("ARG elixir_version=\"#{@default_elixir_version}\"") + 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 <> + """ + runtime_config: + release_app: blog + env_variables: + MIX_ENV: staging + """ + + 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: "20.2") - assert_dockerfile_line("ARG erlang_version=\"20.2\"") - assert_dockerfile_line("ARG elixir_version=\"1.5.3-otp-20\"") + 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-20.2:latest" + "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-#{@default_erlang_version}:latest" ) end @@ -258,19 +384,21 @@ 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: 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-20.2:latest" + "COPY --from=gcr.io/gcp-elixir/runtime/ubuntu18/prebuilt/otp-#{@default_erlang_version}:latest" ) 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) @@ -299,14 +427,22 @@ 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, 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: @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 143b346..8a5b28a 100644 --- a/elixir-pipeline/elixir.yaml.in +++ b/elixir-pipeline/elixir.yaml.in @@ -5,7 +5,9 @@ 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-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', '.'] images: 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 79bffc3..2f8d417 100644 --- a/erlang-versions.txt +++ b/erlang-versions.txt @@ -1,72 +1,81 @@ -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 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 -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.7.1 +21.3.8 +21.3.8.17 +22.0 +22.0.7 +22.1 +22.1.8 +22.1.8.1 +22.2 +22.2.8 +22.3 +22.3.4 +22.3.4.17 +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 +23.1.4.1 +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.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 c2e514b..e48d6db 100644 --- a/lib/tasks/build_local_images.ex +++ b/lib/tasks/build_local_images.ex @@ -20,12 +20,14 @@ defmodule Mix.Tasks.BuildLocalImages do @shortdoc "Build images locally." @os_name "ubuntu18" - @prebuilt_erlang_versions ["21.2.6"] - @base_erlang_version "21.2.6" - @base_elixir_version "1.8.1-otp-21" - @asdf_version "0.7.0" - @nodejs_version "10.15.2" - @gcloud_version "236.0.0" + @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" + @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-" @@ -187,6 +189,10 @@ defmodule Mix.Tasks.BuildLocalImages do "default_erlang_version=#{@base_erlang_version}", "--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}", "." ], into: IO.stream(:stdio, :line) 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 fe89fd5..73e86a6 100755 --- a/runtime-build.sh +++ b/runtime-build.sh @@ -15,11 +15,13 @@ # limitations under the License. -DEFAULT_ERLANG_VERSION=21.2.6 -DEFAULT_ELIXIR_VERSION=1.8.1-otp-21 -ASDF_VERSION=0.7.0 -GCLOUD_VERSION=236.0.0 -NODEJS_VERSION=10.15.2 +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.9.0 +GCLOUD_VERSION=378.0.0 +NODEJS_VERSION=16.14.2 set -e @@ -234,16 +236,18 @@ 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" \ < ${DIRNAME}/elixir-pipeline/elixir.yaml.in > ${DIRNAME}/tmp/elixir-${IMAGE_TAG}.yaml 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 diff --git a/test/sample_app_build_test.exs b/test/sample_app_build_test.exs index eb45cc2..1c6a545 100644 --- a/test/sample_app_build_test.exs +++ b/test/sample_app_build_test.exs @@ -16,26 +16,21 @@ defmodule SampleAppBuildTest do use ExUnit.Case import TestHelper - @moduletag timeout: 120_000 + @moduletag timeout: 300_000 - test "Minimal plug app" do - config = """ - env: flex - runtime: elixir - """ + @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!() - run_app_test("minimal_plug", config) + test "Minimal plug app" do + run_app_test("minimal_plug") end test "Minimal phoenix app" do - config = """ - env: flex - runtime: elixir - """ - run_app_test( "minimal_phoenix", - config, + 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"], @@ -44,7 +39,7 @@ defmodule SampleAppBuildTest do assert_cmd_output( ["docker", "run", "--rm", image, "elixir", "--version"], - ~r{1\.6\.6}, + ~r{1\.8\.2}, show: true ) end @@ -61,7 +56,8 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix", - config, + tool_versions: "elixir #{@old_elixir_version_long}\n", + config: config, check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-x", "/app/bin/minimal_phoenix"], @@ -71,7 +67,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.6.6", + @old_elixir_version_short, timeout: 10, show: true, verbose: true @@ -89,7 +85,12 @@ 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", + tool_versions: "elixir #{@old_elixir_version_long}\n", + config: config, + expected_output: ~r{from staging} + ) end test "Minimal phoenix app with release in staging environment" do @@ -102,34 +103,95 @@ defmodule SampleAppBuildTest do MIX_ENV: staging """ - run_app_test("minimal_phoenix", config, expected_output: ~r{from staging}) + run_app_test( + "minimal_phoenix", + tool_versions: "elixir #{@old_elixir_version_long}\n", + 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"], + @new_elixir_version_regex, + 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\.1}, + ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], + @new_elixir_version_short, + 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"], + @new_elixir_version_short, + 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 +201,19 @@ defmodule SampleAppBuildTest do run_app_test( "minimal_phoenix14", - config, + 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")) + end, check_image: fn image -> assert_cmd_succeeds( ["docker", "run", "--rm", image, "test", "-x", "/app/bin/minimal_phoenix14"], @@ -149,7 +223,7 @@ defmodule SampleAppBuildTest do check_container: fn _container -> assert_cmd_output( ["curl", "-s", "-S", "http://localhost:8080/elixir-version"], - "1.8.1", + @old_elixir_version_short, timeout: 10, show: true, verbose: true @@ -160,11 +234,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 +257,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 deleted file mode 100644 index 3076e80..0000000 --- a/test/sample_apps/minimal_phoenix/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -elixir 1.6.6-otp-21 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()