bitwalker/distillery

Deployment is not working

ijunaid8989 opened this issue · 3 comments

Steps to reproduce

  1. clone any phoenix application
  2. let say directory is /tmp/build-meida
  3. run MIX_ENV=prod PORT=4000 mix distillery.release
  4. create a new directory /opt/evercam_media
  5. extract the release zip to the above directory (release zip "/tmp/build-media/_build/prod/rel/evercam_media/releases/1.0.1564983472/evercam_media.tar.gz")
  6. It works fine.
  7. Repeat above process again without creating /opt/evercam_media again. everything is fine. but the newly added code is not there in /opt/evercam_media.. there is no errors but the newly deployed application is not working. even after start and stop changes are not there.

Description of issue

  • What are the expected results?
    • Newly added code should be updated din release.
  • What version of Distillery?
    • {:distillery, "~> 2.1"}
  • What OS, Erlang/Elixir versions are you seeing this issue on?
    • Elixir 1.9.1 Erlang 21.0
  • If possible, also provide your rel/config.exs, as it is often
    my first troubleshooting question, and you'll save us both time :)
# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Distillery.Releases.Config,
    # This sets the default release built by `mix distillery.release`
    default_release: :default,
    # This sets the default environment used by `mix distillery.release`
    default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/config/distillery.html


# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: :"k2THOoD].DS}9DgxvhWdNm{D%PPQ81M4aN8m9auPwT3_n:2IEwre{CO;y|)[mdit"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"l(qLwCV4Rk1@{3/?45s|.u$v{d1(Vz=moYf65aMcBd6Lo2JY?}OyR9(3npt`s;Jc"
  set vm_args: "rel/vm.args"
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix distillery.release`, the first release in the file
# will be used by default

release :evercam_media do
  set version: current_version(:evercam_media)
  set applications: [
    :runtime_tools
  ]
end

As far as I can see, it is running the wrong release. You can run the latest release by doing the following in your release directory: cp releases/start_erl.data var/start_erl.data (At least in my case, the file in var still points to the old release, you might want to check that)

However, I would be happy about a fix for this (or hint what's wrong) as well, doing this on every release is pretty annoying.

Edit: Nevermind, this was caused by a custom version string generator I wrote ages ago that was not compatible with the latest distillery version.

This seems to be a duplicate of #693, PR #703 should fix this

Okay thanks, I am closing this.