Browse Source

fix: [monujo] support version ``1.0.0-rc.8`` and up.

Source url is different for version up to ``1.0.0-rc.7`` and
afterwards and needed to be adapted.
pull/29/head
Valentin Lab 2 years ago
parent
commit
0fb4b547d0
  1. 19
      monujo/lib/common

19
monujo/lib/common

@ -5,6 +5,23 @@ SOURCE_URL="https://docker.0k.io/downloads"
LOCATION="$SERVICE_CONFIGSTORE/opt/apps/$APP_NAME"
CONFIGFILE="$LOCATION/config.json"
version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
monujo:get_source_url() {
local app_name="$1" version="$2"
if version_gt "$version" 1.0.0-rc.7; then
SOURCE_URL="https://github.com/Lokavaluto/monujo/releases/download"
echo "$SOURCE_URL/${version}/${app_name}_${version}.tar.bz2"
return 0
fi
SOURCE_URL="https://docker.0k.io/downloads"
echo "$SOURCE_URL/${app_name}-${version}.tar.bz2"
return 0
}
monujo:code_init() {
local version="$1" enforce_version="$2" source_url
@ -23,7 +40,7 @@ monujo:code_init() {
mkdir -p "$LOCATION"
fi
cd "$LOCATION"
source_url="$SOURCE_URL/$APP_NAME-$version.tar.bz2"
source_url="$(monujo:get_source_url "$APP_NAME" "$version")"
info "Downloading '$source_url'."
wget -q "$source_url" -O file.tar.bz2 || {
err "Couldn't download '$source_url'."

Loading…
Cancel
Save