Conversation
Hi, I changed my last commit using |
So I've been trying this one even earlier and following instructions yield issues before this even shows up, with or without the patch:
Right about there:
Despite me getting warnings all the time, the commands do appear to work, but what I get is a 'dummy/' directory, none of the tar files, and really nothing working well. Git blame seems to say Joe Williams worked on this in 2011 and I'm guessing it's old stuff there. @terrencehan how did you get past these steps? |
@ferd To avoid warnings, all operations were done in ➜ upgrade_project git:(master) rebar compile
==> dummy (compile)
==> rel (compile)
==> upgrade_project (compile)
➜ upgrade_project git:(master) cd rel
➜ rel git:(master) rebar generate
==> rel (generate)
➜ rel git:(master) mv dummy dummy_0.1
➜ rel git:(master) vim reltool.config
➜ rel git:(master) vim ../apps/dummy/src/dummy.app.src
➜ rel git:(master) cd ..
➜ upgrade_project git:(master) ls
README.md apps rebar.config rel
➜ upgrade_project git:(master) rebar compile
==> dummy (compile)
==> rel (compile)
==> upgrade_project (compile)
➜ upgrade_project git:(master) cd rel
➜ rel git:(master) rebar generate
==> rel (generate)
➜ rel git:(master) rebar generate-appups previous_release=dummy_0.1
==> rel (generate-appups)
Generated appup for dummy
Appup generation complete
➜ rel git:(master) rebar generate-upgrade previous_release=dummy_0.1
==> rel (generate-upgrade)
dummy_0.2 upgrade package created
➜ rel git:(master) ls
dummy dummy_0.1 dummy_0.2.tar.gz files reltool.config |
ping? |
Ah yes, sorry for the long delay. This fell off my radar entirely. So I did all the steps again (and they worked), up until 0.3. So for 0.3, I could replicate your crash fine. I stashed my changes, updated to your branch, and tried again, but found the following issue:
Looking into the pull request, it appears nothing actually creates this file. Any idea what this should be about? I've also drafted up the following change for the README, which makes it easier to follow: diff --git a/test/upgrade_project/README.md b/test/upgrade_project/README.md
index a644b21..692689d 100644
--- a/test/upgrade_project/README.md
+++ b/test/upgrade_project/README.md
@@ -1,7 +1,9 @@
#### Building version 0.1
rebar compile
+ cd rel
rebar generate
- mv rel/dummy rel/dummy_0.1
+ mv dummy dummy_0.1
+ cd ../
rebar clean
# start the release:
cd rel/dummy_0.1
@@ -20,15 +22,16 @@
$EDITOR rel/reltool.config
rebar compile
+ cd rel
rebar generate
# previous_release path is relative to your rel directory
rebar generate-appups previous_release=dummy_0.1
rebar generate-upgrade previous_release=dummy_0.1
- tar -zvtf rel/dummy_0.2.tar.gz
+ tar -zvtf dummy_0.2.tar.gz
#### Deploying with release_handler
- mv rel/dummy_0.2.tar.gz rel/dummy_0.1/releases/
+ mv dummy_0.2.tar.gz dummy_0.1/releases/
# Now use release_handler in the running erlang console for the deploy: |
|
previous_release= |
Ugh, yeah it was probably something like that. I'll retry again and make sure everything's moved in the right places. Sorry. |
I got it to work fine, but updated the README to show this: diff --git a/test/upgrade_project/README.md b/test/upgrade_project/README.md
index a644b21..d0d4a4b 100644
--- a/test/upgrade_project/README.md
+++ b/test/upgrade_project/README.md
@@ -1,7 +1,9 @@
#### Building version 0.1
rebar compile
+ cd rel
rebar generate
- mv rel/dummy rel/dummy_0.1
+ mv dummy dummy_0.1
+ cd ..
rebar clean
# start the release:
cd rel/dummy_0.1
@@ -20,15 +22,17 @@
$EDITOR rel/reltool.config
rebar compile
+ cd rel
rebar generate
# previous_release path is relative to your rel directory
rebar generate-appups previous_release=dummy_0.1
rebar generate-upgrade previous_release=dummy_0.1
- tar -zvtf rel/dummy_0.2.tar.gz
+ tar -zvtf dummy_0.2.tar.gz
+ mv dummy dummy_0.2
#### Deploying with release_handler
- mv rel/dummy_0.2.tar.gz rel/dummy_0.1/releases/
+ mv dummy_0.2.tar.gz dummy_0.1/releases/
# Now use release_handler in the running erlang console for the deploy:
@@ -43,3 +47,4 @@
rm -r rel/dummy
# Now repeat steps in 'Building version 0.2' and 'Deploying with release_handler'
+ # while replacing '0.2' by '0.3' and '0.1' by '0.2'. We should give this a proper code review, but if you want to apply the diff to @Tuncer this appears to pass all the tests, is there anything else we'd need to do in your opinion? |
Thanks for reviewing. Please apply the diff to |
get_rel_file_path(Name, Path, Version) -> | ||
Dir = filename:join([Path, "releases", Version]), | ||
Path1 = filename:join([Dir, Name ++ "_" ++ Version ++".rel"]), | ||
Path2 = filename:join([Dir, Name ++ ".rel"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we shouldn't align (=
) here, as we don't do that in the rest of the tree. @ferd thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd agree with that, but I think this one can go through without being fixed. By my fault this pull req has waited long enough I can possibly fix it myself when merging.
@ferd wrote:
Made two minor code comments, and other than that we should mirror the README fixes in the wiki (https://github.com/rebar/rebar/wiki/Upgrades) as well. |
@terrencehan do you want to do the edits, or you're fine with me patching them in as repentance for having left this pull req rot for months for no good reason? |
@ferd It's fine with me. Feel free to edit it when necessary. |
When following instructions in
test/upgrade_project/README.md,
I failed during releasing another dummy_0.3 with an error message —{error, {no_matching_relup, "0.3", "0.2"}}
, supposing 0.2 is the base version. Because, at this moment, rebar uses wildcard to extract the base version. —filelib:wildcard(filename:join([Path, "releases", "*", Name ++ ".rel"]))
. In this case, we always gotreleases/0.1/dummy.rel
, NOTreleases/0.2/dummy_0.2.rel
. I think that is a mistake.In this pull request, I use
releases/start_erl.data
as a source to get the permanent version, and make sure we could get the specificrelup
and*.rel
file for upgrade.Beside, now, we pass
NewName
tosystools:make_relup
(run_systools/2
inrebar_upgrade.erl
). That results in a mistake, I think, which leadssystool
to get NewName.rel every time. Again, in this case,dummy_0.2
is right. So, before callingrun_systools
, I use wildcardName ++ "*.rel”
to expend the second parameter. Because insasl
, it callsfile:path_open/3
to read.rel
file. If we passdummy_VERSION
, we could get the specific file.Thanks for your reviewing.