Browse Source

new: [monujo] add option ``version`` to set the target code version

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/27/head
Valentin Lab 3 years ago
parent
commit
374844af05
  1. 16
      monujo/README.org
  2. 4
      monujo/hooks/init
  3. 9
      monujo/lib/common
  4. 3
      monujo/metadata.yml

16
monujo/README.org

@ -144,3 +144,19 @@ monujo:
tabs-link-color: rgba(0 0 0 0.6)
navbar-fixed-z: 50
#+end_src
** Version
The monujo app version deployed by this charm is set by default in
=metadata.yml= in =default-options.version=.
You can enforce a different version by using the =version= option:
#+begin_src yaml
monujo:
options:
version: 1.0.0-rc.1
odoo:
#+end_src

4
monujo/hooks/init

@ -14,7 +14,9 @@
set -e
monujo:code_init
version=$(options-get version 2>/dev/null)
monujo:code_init "$version"
monujo:code_config_base

9
monujo/lib/common

@ -8,8 +8,9 @@ CONFIGFILE="$LOCATION/config.json"
monujo:code_init() {
local version="$1"
if [ -e "$LOCATION/.version" ] && \
[ "$(cat "$LOCATION/.version")" == "$VERSION" ]; then
[ "$(cat "$LOCATION/.version")" == "$version" ]; then
return 0
fi
[ -d "$LOCATION" ] && rm -rf "$LOCATION"
@ -24,7 +25,7 @@ monujo:code_init() {
tar xjf file.tar.bz2 &&
rm file.tar.bz2 &&
chown root:root "$LOCATION" -R &&
echo "$VERSION" > "$LOCATION/.version"
echo "$version" > "$LOCATION/.version"
}
export MONUJO_OPTIONS=(
@ -33,6 +34,7 @@ export MONUJO_OPTIONS=(
map-url:string
local-password-retention-time:numeric
theme:struct\*
version:ignore
)
export MONUJO_OPTIONS_CONCAT=" ${MONUJO_OPTIONS[*]} "
@ -58,6 +60,9 @@ monujo:json-make() {
key=$(e "$key" | shyaml get-value)
ytype=$(e "$val" | shyaml get-type)
case "$MONUJO_OPTIONS_CONCAT" in
*" ${key}:ignore "*)
continue
;;
*" ${key}:bool "*)
val=$(e "$val" | shyaml get-value)
case "${val,,}" in

3
monujo/metadata.yml

@ -2,6 +2,9 @@ description: "LokWallet"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
subordinate: true
default-options:
version: 1.0.0-rc.3
uses:
publish-dir:
#constraint: required | recommended | optional

Loading…
Cancel
Save