From 875716dc48cd5c485d2342c9e5bb1d461bc64b6d Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 20 Apr 2013 21:26:52 +0200 Subject: o Making the resolvers use app.resolved_version instead of app.version. o Making set-version update app.version. --- bin/app-upgrade | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 bin/app-upgrade (limited to 'bin/app-upgrade') diff --git a/bin/app-upgrade b/bin/app-upgrade new file mode 100755 index 0000000..2ca84e0 --- /dev/null +++ b/bin/app-upgrade @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e +set -u + +APPSH_HOME=$(cd $(dirname "$0")/.. && pwd) + +. $APPSH_HOME/lib/common +# HEADER END + +usage_text() { + echo "usage: $usage_app" +} + +if [ $# != 0 ] +then + usage +fi + +assert_is_app + +resolver_name=`app-conf get app.resolver` +resolver=`find_resolver "$resolver_name"` + +old_version=`app-conf get app.version` +echo "Resolving version $old_version" +"$resolver" resolve-version +new_version=`app-conf get app.version` + +if [[ $new_version == $old_version ]] +then + echo "No new version available" 2>&1 + exit +fi + +echo "Resolved version to $new_version" + +"$resolver" download-version -v "$new_version" -f .app/latest.zip + +app-install-file -v "$new_version" -f .app/latest.zip -- cgit v1.2.3