bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 396 forks source link

Adding version compatibility if not on Elixir 1.9 #684

Closed jeffrade closed 5 years ago

jeffrade commented 5 years ago

Summary of changes

Statement in README.md:

Distillery requires Elixir 1.6 or greater

But if someone is on 1.8 (or less) they will get an error (see below). I suggest simply changing to 1.9 or add a bit more explanation for someone new to the project (which this PR does).

I am on 1.8 and read requires Elixir 1.6 so I thought I was good to go. But the mix task distillery.release isn't available (but mix release is).

** (Mix) The task "distillery.release" could not be found

I had to spend some time finding out why and to downgrade to {:distillery, "~> 1.5"}.

Checklist

Licensing/Copyright

By submitting this PR, you agree to the following statement, please read before submission!

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for Distillery (the "Contribution"). My Contribution is licensed under the MIT License.

NOTE: If you submit a PR and remove the statement above, your PR will be rejected. For your PR to be considered, it must contain your agreement to license under the MIT license.

bitwalker commented 5 years ago

I'm not clear on the issue behind this PR. The distillery.release task should certainly be available back to Elixir 1.6 (using what is now on master, soon to be published as 2.1.0). The mix release task is now owned by the core team, and so isn't supported with any version of Distillery post-Elixir 1.9.

jeffrade commented 5 years ago

The distillery.release task should certainly be available back to Elixir 1.6

Hi @bitwalker

I do not see the distillery.release task when on Elixir version 1.8 and Distillery version 2.0.14. See my output below (some lines omitted for breverty):

$ elixir --version
Erlang/OTP 21 [erts-10.3.5.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Elixir 1.8.2 (compiled with Erlang/OTP 20)

$ cat mix.lock
%{
  "artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"},
  "distillery": {:hex, :distillery, "2.0.14", "25fc1cdad06282334dbf4a11b6e869cc002855c4e11825157498491df2eed594", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"},
}

$ mix distillery.release
** (Mix) The task "distillery.release" could not be found

$ mix help
...
mix deps.update       # Updates the given dependencies
mix do                # Executes the tasks separated by comma
...
mix release           # Build a release for the current mix application
mix release.clean     # Clean up any release-related files
mix release.gen.appup # Generate appup files for hot upgrades and downgrades
mix release.init      # initialize a new release configuration
bitwalker commented 5 years ago

The documentation you are referring to is for Distillery 2.1.0 though, which is the version that introduces mix distillery.release, the older 2.x versions still use mix release.

jeffrade commented 5 years ago

The documentation you are referring to is for Distillery 2.1.0 though, which is the version that introduces mix distillery.release, the older 2.x versions still use mix release.

Being new to the project, I was simply going off of what is in the README (showing version 2.0) and then stating: "use mix distillery.release".

https://github.com/bitwalker/distillery#installation

bitwalker commented 5 years ago

So the ~> 2.0 version specifier will include any minor version (i.e. 2.1.0), but I should update that to 2.1 to avoid ambiguity. I'm going to close this PR, but I'll push that change here in a moment. Thanks!

jeffrade commented 5 years ago

So the ~> 2.0 version specifier will include any minor version (i.e. 2.1.0),

TIL. I wasn't aware of that and assumed it would always stay on 2.0.<patch>.

bitwalker commented 5 years ago

For that you'll want ~> 2.0.0, I think the full specification is documented in the standard library Version module