bitwalker / exrm

Automatically generate a release for your Elixir project!
MIT License
924 stars 110 forks source link

Specify version to build from #373

Closed pdilyard closed 8 years ago

pdilyard commented 8 years ago

My releases are automatically versioned using Git SHAs, so for example, I might have the following releases:

1.1.1-123xyz
1.1.1-def456
1.1.1-abcdef <-- currently running version, most recent commit

1.1.1-zyx321 <-- newly built version, want to upgrade to this

The problem I'm encountering is that when I try to build an upgrade, instead of building an appup file from 1.1.1-abcdef to 1.1.1-zyx321, it builds an appup from 1.1.1-def456 to 1.1.1-abcdef. So when I try to perform the hot upgrade, it fails because there is no appup file defined for the current version to the new version.

I think it is correlated to the alphabetical order of releases, but I could be wrong and would need to do more research to confirm this.

If there was a way to specify the version to build the appup file from, I could easily fix this problem by finding the running version and then manually specifying it.

bitwalker commented 8 years ago

Right now, versions with git sha hashes in them only work if they are in git-describe format, i.e. <tag>-<commits since tag>-<short hash>. Otherwise yes, it does them alphanumerically, as their is no other way to determine the order.

bitwalker commented 8 years ago

As an additional note, currently exrm does not provide a way to specify an arbitrary version to upgrade from, it always uses the last (as best it can determine) release. I'm working on a replacement for exrm which does allow you to select the upfrom release, so this capability is available there, but it is in an experimental phase right now, so may not be an option for you to use.

pdilyard commented 8 years ago

Got it, thanks! Is there a link to the exrm replacement?

bitwalker commented 8 years ago

You can check it out here :)

pdilyard commented 8 years ago

@bitwalker so if I name my releases like this, should relups be correctly generated?:

1.1.1+112-4e336ba
1.1.1+118-a820121

That is the semver, number of commits on master (the only branch with releases), and the commit hash. This forces releases to order correctly alphabetically. (I tried this and still got the following error):

Release 1.1.1+118-a820121 not found, attempting to unpack releases/1.1.1+118-a820121/hydrogen.tar.gz
Unpacked successfully: "1.1.1+118-a820121"
Generating vm.args/sys.config for upgrade...
sys.config ready!
vm.args ready!
Release 1.1.1+118-a820121 is already unpacked, now installing.
ERROR: release_handler:check_install_release failed: {no_matching_relup,
                                                      "1.1.1+118-a820121",
                                                      "1.1.1+112-4e336ba"}