Created
May 9, 2011 22:20
-
-
Save amtal/963550 to your computer and use it in GitHub Desktop.
appups.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app="myapp" | |
function gen-ups { | |
rebar generate-appups previous_release=$1 | |
cat $app/lib/*/ebin/*.appup | |
} | |
# This uses a dirty bunch of hacks to "generate" downgrade instructions | |
# (upgrade instructions in the opposite direction) with the current rebar | |
# version. | |
function main { | |
cp -r $app appup.$app.backup | |
rm -r $app/lib/*/ebin/*.appup | |
echo -e "\n UPGRADES:\n" | |
gen-ups $1 | |
echo -e "\n DOWNGRADES:\n" | |
mv $app $app.appup.tmp | |
cp -r $1 $app | |
rm -r $app/lib/*/ebin/*.appup | |
gen-ups $app.appup.tmp | |
# get files into original state | |
rm -rf $app $app.appup.tmp | |
mv appup.$app.backup $app | |
} | |
main ${1:?"Usage: appups <prev_release_dir>"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment