Changeset 7f335a4 in OpenWorkouts-current for bin


Ignore:
Timestamp:
Feb 18, 2019, 1:14:27 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
82a4c44
Parents:
4af38e8
Message:

Improved the install script:

  • Added some messages so the user knows what is going on
  • Added log file redirection of stdout and stderr (nicer output without all the pip and js_deps info)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/install

    r4af38e8 r7f335a4  
    1010# Full path to the env
    1111env_path=${current}/env
    12 
     12# full path to the install logs
     13install_log=${current}/var/log/install.log
    1314
    1415set_scripts_permissions() {
     16    echo "Setting up script permissions"
    1517    # ensure the shell scripts we will need have proper permissions
    1618    chmod u+x ${current}/bin/js_deps
     
    2325        # ok
    2426        python_bin=`command -v python3`
     27        echo "Found valid python installation: ${python_bin}"
    2528        return
    2629    else
     
    3033            if `command -v python` -c "import sys; exit(0) if sys.version.startswith('3.') else exit(1)"; then
    3134                python_bin=`command -v python`
     35                echo "Found valid python installation: ${python_bin}"
    3236                return
    3337            else
     
    4650create_venv() {
    4751    # create a new virtual environment
     52    echo "Creating new python virtual environment [${env_path}]"
    4853    ${python_bin} -m venv ${env_path}
    4954}
     
    5156upgrade_pip_setuptools() {
    5257    . ${env_path}/bin/activate
    53     yes | pip install --upgrade setuptools pip
     58    echo "Upgrading python packaging tools"
     59    yes | pip install --upgrade setuptools pip >> ${install_log}.stdout 2>> ${install_log}.stderr
    5460    deactivate
    5561}
     
    5763install_openworkouts() {
    5864    . ${env_path}/bin/activate
    59     yes | pip install --upgrade -e ${current}[testing]
     65    echo "Installing OpenWorkouts dependencies"
     66    yes | pip install --upgrade -e ${current}[testing] >> ${install_log}.stdout 2>> ${install_log}.stderr
    6067    deactivate
    6168}
    6269
    6370install_js_deps() {
    64     ${current}/bin/js_deps
     71    echo "Installing javascript components"
     72    ${current}/bin/js_deps >> ${install_log}.stdout 2>> ${install_log}.stderr
    6573}
    6674
     
    7179    echo ""
    7280    echo "  cd ${current} && ./bin/start"
     81    echo ""
     82    echo "(the installation script left a log under ${install_log})"
    7383    echo ""
    7484    # echo "You can stop any running OpenWorkouts instances calling:"
     
    8595install_js_deps
    8696setup_start_stop
    87 
    88 echo ${python_bin}
Note: See TracChangeset for help on using the changeset viewer.