bitwalker / distillery

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

Deployment is not working #702

Closed ijunaid8989 closed 4 years ago

ijunaid8989 commented 4 years ago

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

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

cybrox commented 4 years ago

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.

bartj3 commented 4 years ago

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

ijunaid8989 commented 4 years ago

Okay thanks, I am closing this.