|
@ -1,11 +1,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
# -*- mode: shell-script -*- |
|
|
|
|
|
|
|
|
APP_NAME=monujo |
|
|
APP_NAME=monujo |
|
|
SOURCE_URL="https://docker.0k.io/downloads" |
|
|
SOURCE_URL="https://docker.0k.io/downloads" |
|
|
LOCATION="$SERVICE_CONFIGSTORE/opt/apps/$APP_NAME" |
|
|
LOCATION="$SERVICE_CONFIGSTORE/opt/apps/$APP_NAME" |
|
|
CONFIGFILE="$LOCATION/config.json" |
|
|
CONFIGFILE="$LOCATION/config.json" |
|
|
|
|
|
|
|
|
version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } |
|
|
|
|
|
|
|
|
version_gt() { test "$(semver "$@" | head -n 1)" != "$1"; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
monujo:get_source_url() { |
|
|
monujo:get_source_url() { |
|
@ -35,11 +35,14 @@ monujo:code_init() { |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
if [ -d "$LOCATION" ]; then |
|
|
if [ -d "$LOCATION" ]; then |
|
|
find "$LOCATION" -mindepth 1 -delete |
|
|
|
|
|
|
|
|
find "$LOCATION" -mindepth 1 -delete || return 1 |
|
|
else |
|
|
else |
|
|
mkdir -p "$LOCATION" |
|
|
|
|
|
|
|
|
mkdir -p "$LOCATION" || return 1 |
|
|
fi |
|
|
fi |
|
|
cd "$LOCATION" |
|
|
|
|
|
|
|
|
cd "$LOCATION" || { |
|
|
|
|
|
err "Couldn't cd to '$LOCATION'." |
|
|
|
|
|
return 1 |
|
|
|
|
|
} |
|
|
source_url="$(monujo:get_source_url "$APP_NAME" "$version")" |
|
|
source_url="$(monujo:get_source_url "$APP_NAME" "$version")" |
|
|
info "Downloading '$source_url'." |
|
|
info "Downloading '$source_url'." |
|
|
wget -q "$source_url" -O file.tar.bz2 || { |
|
|
wget -q "$source_url" -O file.tar.bz2 || { |
|
|