diff --git a/doc/utils.md b/doc/utils.md new file mode 100644 index 0000000000000000000000000000000000000000..83efc8c15ebf4b30309e516cad62e0c2168a3948 --- /dev/null +++ b/doc/utils.md @@ -0,0 +1,55 @@ + +# Deployment + +## Deploy script + +This is a script example, that you can use to deploy the latest release. + +This script will create or replace a directory name `cesium`, where application will be unpack. + +**Be aware** that the destination directory will be created **where the script is**. + +```bash +#!/bin/bash + +READLINK=`which readlink` +if [ -z "$READLINK" ]; then + message "Required tool 'readlink' is missing. Please install before launch \"$0\" file." + exit 1 +fi + +# ------------------------------------------------------------------ +# Ensure BASEDIR points to the directory where the soft is installed. +# ------------------------------------------------------------------ +SCRIPT_LOCATION=$0 +if [ -x "$READLINK" ]; then + while [ -L "$SCRIPT_LOCATION" ]; do + SCRIPT_LOCATION=`"$READLINK" -e "$SCRIPT_LOCATION"` + done +fi + +export BASEDIR=`dirname "$SCRIPT_LOCATION"` + +cd $BASEDIR + +echo "Installing cesium into '$BASEDIR/cesium'..." + +wget -qO- https://raw.githubusercontent.com/duniter/cesium/master/install.sh | bash + +export VERSION=`sed -rn "s/\s*\"version\": \"([^\"]*)\",\s*/\1/p" cesium/config.js` +export BUILD=`sed -rn "s/\s*\"build\": \"([^\"]*)\",\s*/\1/p" cesium/config.js` +echo "Detected version: $VERSION" +echo " build: $BUILD" + +if [ -e "$BASEDIR/config.js" ]; then + echo "Override config file using '$BASEDIR/config.js'" + cp -f cesium/config.js cesium/config.js.ori + cp -f config.js cesium/ + + # Keep version and build from original config file + sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/g" cesium/config.js + sed -i "s/\"build\": \"[^\"]*\"/\"build\": \"${BUILD}\"/g" cesium/config.js +fi + +echo "Done !" +``` \ No newline at end of file diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index 7d1d11ee640d7d12eb6377d42b295040cdfc0bd9..374cc7a29583d0bf9bc5be4580142840c814365c 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -662,7 +662,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser (data.parameters.sigQty - data.requirements.certificationCount) : 0; data.requirements.willNeedCertificationCount = (!data.requirements.needMembership && data.requirements.needCertificationCount === 0 && (data.requirements.certificationCount - data.requirements.willExpireCertificationCount) < data.parameters.sigQty) ? - (data.parameters.sigQty - data.requirements.certificationCount - willExpireCertificationCount) : 0; + (data.parameters.sigQty - data.requirements.certificationCount - data.requirements.willExpireCertificationCount) : 0; // Add user events data.events = data.events.reduce(function(res, event) {