Usage local_deploy.sh

This script is designed for local deployment geomongo. The script should be run under the root user.

The next parameters will be used for running the script:

-с <name_of_catalog> specifies in which catalog all geomongo sources will be copied (by default it’s geomongo);

-f  flag which specifies that not need to overwrite config/config.ini;

-d <name of the config ini file> specifies which config file should be copied  (by default config/config.ini);

-e <name of the config file> specifies which config file should be copied to /etc/apache2/sites-available/ (by default config/geomongo.conf).

-el <the name of file for errors logging> specifies to which file you need to output errors (by default error);

-s <Server Name> specifies which server should be written in the config file  (by default geomongo).

The script performs the following steps:

– copies files to directory /var/www/DIRECTORY where DIRECTORY is specified after the key -c;

– runs the script scripts/setup_pip_dependencies.sh which specifies all dependencies of the project;

– records information about commit (commit hash, data, number of branch and version) to file /var/www/geomongo/DEBUG;

– makes the website available;

– restart apache.

Examples

– sudo ./scripts/local_deploy.sh # the script is called with default parameters: config is overwritten and copying sources is performed in geomongo.

– sudo ./scripts/local_deploy.sh -f -c test # config isn’t overwritten and copying sources is performed to the catalog test.

– sudo ./scripts/local_deploy.sh -e 000-default.conf -s localhost # config will create  000-default.conf with server localhost

ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone

Usage and extending papache_conf_generator.py

  1. Usage

    For creating config we have to perform:

    $  ./scripts/papache_conf_generator.py -n %server_name% -o %config_file_output% -f %site_catalog% -e %error_log_name%

    -n  Host name (for example localhost, geomongo) Mandatory parameter

    -o  Name of output config (by default output.conf) it will be saved in directory config/

    -f  Name of the catalog where the website will be hosted (by default geomongo)

    -e  Name of log where apache errors will be written (by default error)

    Example:

    $  ./scripts/papache_conf_generator.py -n localhost -o 000-default.conf -f geomongo

    It will create a config config/000-default.conf with server name localhost which is located in /var/www/geomongo.

  2. Structure template.conf

    config/template.conf is the template of config where instead of parameters the keys are %template_key% which will be replaced by script.

    Example:

    WSGIScriptAlias / /var/www/%geomongo_path%/geomongo.wsgi
    DocumentRoot /var/www/%geomongo_path%

    where %geomongo_path% is the path to the website scripts.

  3. Extension methods

    For adding new parameters we need to add it to template.conf and to add parameters of command line to the script. Also we have to extend method generate adding to it the needed argument.

    Example:

def generate(...., value): 
  ...... 
 .replace("%template_key%", value)
 ......
ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone