Browse Source

fix: [monujo] download correct file depending on version

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
element
Valentin Lab 2 years ago
parent
commit
2dacbda763
  1. 14
      monujo/lib/common

14
monujo/lib/common

@ -1,14 +1,13 @@
APP_NAME=monujo APP_NAME=monujo
VERSION=1.0.0-rc.3
SOURCE_URL="https://docker.0k.io/downloads/$APP_NAME-$VERSION.tar.bz2"
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"
monujo:code_init() { monujo:code_init() {
local version="$1" enforce_version="$2"
local version="$1" enforce_version="$2" source_url
if [ -e "$LOCATION/.version" ] && \ if [ -e "$LOCATION/.version" ] && \
[ "$(cat "$LOCATION/.version")" == "$version" ]; then [ "$(cat "$LOCATION/.version")" == "$version" ]; then
return 0 return 0
@ -24,9 +23,10 @@ monujo:code_init() {
mkdir -p "$LOCATION" mkdir -p "$LOCATION"
fi fi
cd "$LOCATION" cd "$LOCATION"
info "Downloading '$SOURCE_URL'."
wget -q "$SOURCE_URL" -O file.tar.bz2 || {
err "Couldn't download '$SOURCE_URL'."
source_url="$SOURCE_URL/$APP_NAME-$version.tar.bz2"
info "Downloading '$source_url'."
wget -q "$source_url" -O file.tar.bz2 || {
err "Couldn't download '$source_url'."
rm file.tar.bz2 rm file.tar.bz2
return 1 return 1
} }
@ -142,4 +142,4 @@ monujo:config_merge() {
local old_config new_config="$1" local old_config new_config="$1"
old_config=$(cat "$CONFIGFILE") old_config=$(cat "$CONFIGFILE")
e "$old_config" "$new_config" | jq -s 'reduce .[] as $x ({}; . * $x)' > "$CONFIGFILE" e "$old_config" "$new_config" | jq -s 'reduce .[] as $x ({}; . * $x)' > "$CONFIGFILE"
}
}
Loading…
Cancel
Save