Changeset 1d8d5cd in OpenWorkouts-current


Ignore:
Timestamp:
Feb 18, 2019, 4:46:26 PM (4 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
ec51ffa
Parents:
c612889
Message:

More improvements for the install script:

  • If an existing env is found, reuse it
  • If a directory is found where the env is supposed to be created, stop the installer and show an error
  • Added a method to create the mail queue Maildir we need for queue mails generated by the app
File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/install

    rc612889 r1d8d5cd  
    1212# full path to the install logs
    1313install_log=${current}/var/log/install.log
     14# mail queue directory (where automatically generated emails are stored)
     15mail_queue_path=${current}/var/spool/mqueue
    1416
    1517set_scripts_permissions() {
     
    5052create_venv() {
    5153    # create a new virtual environment
    52     echo "Creating new python virtual environment [${env_path}]"
    53     ${python_bin} -m venv ${env_path}
     54    if [ ! -d ${env_path} ]; then
     55        echo "Creating new python virtual environment [${env_path}]"
     56        ${python_bin} -m venv ${env_path}
     57    else
     58        if [ ! -f ${env_path}/bin/activate ]; then
     59            # env dir found, but not a virtual env
     60            echo "Error: ${env_path} exists and is not a valid virtual environment"
     61            exit 1
     62        else
     63            echo "Reusing python virtual environment [${env_path}]"
     64        fi
     65    fi
    5466}
    5567
     
    7183    echo "Installing javascript components"
    7284    ${current}/bin/js_deps >> ${install_log}.stdout 2>> ${install_log}.stderr
     85}
     86
     87create_mail_queue() {
     88    # Creates a Maildir-format directory that pyramid_mailer can use to
     89    # queue mails.
     90    echo "Creating mail spool directory ${mail_queue_path}"
     91    mkdir -p ${mail_queue_path}/{new,cur,tmp} >> ${install_log}.stdout 2>> ${install_log}.stderr
    7392}
    7493
     
    94113install_openworkouts
    95114install_js_deps
     115create_mail_queue
    96116setup_start_stop
Note: See TracChangeset for help on using the changeset viewer.