Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for start_erl.data - old release getting started after deployment #718

Merged
merged 1 commit into from
Feb 17, 2020

Conversation

delta1
Copy link
Contributor

@delta1 delta1 commented Nov 22, 2019

Summary of changes

This is a simple change to fix the issue in #693 - where the start_erl.data file in releases/ does not get copied into the mutable dir when the directory already exists.

It is a slightly better fix than #703 since it checks if the start_erl.data file in releases dir is newer than the var version first, instead of blindly copying it every single time.

Checklist

  • [ n/a] New functions have typespecs, changed functions were updated
  • [ n/a] Same for documentation, including moduledocs
  • [?] Tests were added or updated to cover changes - not sure how to test this change, please advise
  • Commits were squashed into a single coherent commit

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.

…, and replace start_erl.data in var directory if the file in releases dir is newer
@delta1 delta1 changed the title fix for start_erl.data - copy it to var if newer fix for start_erl.data - old release getting started after deployment Nov 23, 2019
@delta1
Copy link
Contributor Author

delta1 commented Dec 14, 2019

@bitwalker ?

@aselder
Copy link

aselder commented Dec 31, 2019

@bitwalker Can we get this merged? This is a fix for a serious issue.

@tmartin8080
Copy link

tmartin8080 commented Jan 14, 2020

As a temp workaround for edeliver, added this hook to the .deliver/config.

post_extract_release_archive() {
  status "Copying new release version start_erl.data file"
  __sync_remote "
    [ -f ~/.profile ] && source ~/.profile
    set -e
    if [ -f /home/deploy/apps/phxroad/var/start_erl.data ]; then
      rm /home/deploy/apps/phxroad/var/start_erl.data
    fi
  "
}

Thanks for the PR @delta1

@noozo
Copy link

noozo commented Jan 16, 2020

If you happen to be using bootleg instead, here's a similar fix: labzero/bootleg#313

@Scarysize
Copy link

Nice fix. Would be awesome to have a new patch release for the distillery package!

@Ninigi
Copy link

Ninigi commented Jul 17, 2020

@bitwalker thank you so much for making most of Elixir deployment a breeze. This PR has been merged for a few months now, but I still have to deal with this issue on every single project. Can we get a hex release please? I would prefer broken distillery (which I know might be broken) over playing Groundhog Day. (and no, I do not want to install from master, that is even worse than dealing with the same problem over and over again.)

@delta1
Copy link
Contributor Author

delta1 commented Jul 17, 2020

@Ninigi save your sanity by just forking and then referencing your fork in mix.exs so you have full control

{:distillery, github: "user/distillery", ref: "1234hash"} # or branch: or tag:

Docs: https://hexdocs.pm/mix/Mix.Tasks.Deps.html#module-git-options-git

brian-armstrong-discord pushed a commit to discord/distillery that referenced this pull request Sep 14, 2021
…, and replace start_erl.data in var directory if the file in releases dir is newer (bitwalker#718)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants