diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-10-20 21:55:01 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-10-20 22:01:26 +0200 |
commit | 989edff55111db3b457c9e04f3abf296e6ac555c (patch) | |
tree | eb9bf0b99b7ed10a05c90a597d57e5c0e543c36d /bin | |
parent | a6ad0dd211ba4a394d70dd13d3375118b6e5f27a (diff) | |
download | app.sh-989edff55111db3b457c9e04f3abf296e6ac555c.tar.gz app.sh-989edff55111db3b457c9e04f3abf296e6ac555c.tar.bz2 app.sh-989edff55111db3b457c9e04f3abf296e6ac555c.tar.xz app.sh-989edff55111db3b457c9e04f3abf296e6ac555c.zip |
o Getting "upgrade" to work with non-SNAPSHOT versions too.
o Removing maven.version.
o Documenting(!) the different configuration keys and what they mean.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/app-init | 2 | ||||
-rwxr-xr-x | bin/app-upgrade | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/bin/app-init b/bin/app-init index 8e571e8..7098cb3 100755 --- a/bin/app-init +++ b/bin/app-init @@ -66,7 +66,7 @@ resolved_version=`app-conf get app.resolved_version` if [[ $resolved_version == "" ]] then echo "Unable to resolve version" 2>&1 - exit + exit 1 fi echo "Resolved version to $resolved_version" diff --git a/bin/app-upgrade b/bin/app-upgrade index c6cd414..3c5f8dc 100755 --- a/bin/app-upgrade +++ b/bin/app-upgrade @@ -22,7 +22,7 @@ assert_is_app resolver_name=`app-conf get app.resolver` resolver=`find_resolver "$resolver_name"` -old_version=`app-conf get app.version` +old_version=`app-conf get app.resolved_version` echo "Resolving version $old_version" "$resolver" resolve-version new_version=`app-conf get app.resolved_version` @@ -35,6 +35,24 @@ fi echo "Resolved version to $new_version" +if [ "$new_version" = "" ] +then + new_version=`app-conf get app.resolved_version` +fi + +if [ "$new_version" = "" ] +then + fatal "app.resolved_version is not set." +fi + +installed_version=`app-conf get app.installed_version` + +if [ "$new_version" = "$installed_version" ] +then + echo "$new_version is already installed" + exit 0 +fi + "$resolver" download-version -v "$new_version" -f .app/latest.zip app-install-file -v "$new_version" -f .app/latest.zip |