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
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"
CONFIGFILE="$LOCATION/config.json"
monujo:code_init() {
local version="$1" enforce_version="$2"
local version="$1" enforce_version="$2" source_url
if [ -e "$LOCATION/.version" ] && \
[ "$(cat "$LOCATION/.version")" == "$version" ]; then
return 0
@ -24,9 +23,10 @@ monujo:code_init() {
mkdir -p "$LOCATION"
fi
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
return 1
}
@ -142,4 +142,4 @@ monujo:config_merge() {
local old_config new_config="$1"
old_config=$(cat "$CONFIGFILE")
e "$old_config" "$new_config" | jq -s 'reduce .[] as $x ({}; . * $x)' > "$CONFIGFILE"
}
}
Loading…
Cancel
Save