Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • feature/migrate-cordova-13
  • feat/improve-network-scan
  • feat/force-migration-check
  • develop
  • feature/encrypted_comment
  • feature/android_api_19
  • gitlab_migration_1
  • rml8
  • v1.7.14
  • v1.7.13
  • v1.7.12
  • v1.7.11
  • v1.7.10
  • v1.7.9
  • v1.7.8
  • v1.7.7
  • v1.7.6
  • v1.7.5
  • v1.7.4
  • v1.7.3
  • v1.7.2
  • v1.7.1
  • v1.7.0
  • v1.7.0-rc2
  • v1.7.0-rc1
  • v1.6.12
  • v1.6.11
  • v1.6.10
29 results

deploy.md

Blame
  • deploy.md 1.63 KiB

    Deploy Cesium

    Bash script

    This is a bash 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.

    #!/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 !"