Skip to main content

CLI to manage Multi-tenant deployments for Clairview apps

Project description

Boraq

Boraq is a command-line utility that helps you to install, update, and manage multiple sites for Clairview/CLAIRerp applications on *nix systems for development and production.

Table of Contents

Installation

A typical boraq setup provides two types of environments — Development and Production.

The setup for each of these installations can be achieved in multiple ways:

We recommend using Docker Installation to setup a Production Environment. For Development, you may choose either of the two methods to setup an instance.

Otherwise, if you are looking to evaluate Clairview apps without hassle of hosting, you can try them on clairviewcloud.com.

Containerized Installation

A Clairview/CLAIRerp instance can be setup and replicated easily using Docker. The officially supported Docker installation can be used to setup either of both Development and Production environments.

To setup either of the environments, you will need to clone the official docker repository:

$ git clone https://github.com/clairview/clairview_docker.git
$ cd clairview_docker

A quick setup guide for both the environments can be found below. For more details, check out the Clairview/CLAIRerp Docker Repository.

Easy Install Script

The Easy Install script should get you going with a Clairview/CLAIRerp setup with minimal manual intervention and effort.

This script uses Docker with the Clairview/CLAIRerp Docker Repository and can be used for both Development setup and Production setup.

Setup

Download the Easy Install script and execute it:

$ wget https://raw.githubusercontent.com/clairview/boraq/develop/easy-install.py
$ python3 easy-install.py --prod --email your@email.tld

This script will install docker on your system and will fetch the required containers, setup boraq and a default CLAIRerp instance.

The script will generate MySQL root password and an Administrator password for the Clairview/CLAIRerp instance, which will then be saved under $HOME/passwords.txt of the user used to setup the instance. It will also generate a new compose file under $HOME/<project-name>-compose.yml.

When the setup is complete, you will be able to access the system at http://<your-server-ip>, wherein you can use the Administrator password to login.

Arguments

Here are the arguments for the easy-install script

usage: easy-install.py [-h] [-p] [-d] [-s SITENAME] [-n PROJECT] [--email EMAIL]

Install Clairview with Docker

options:
  -h, --help            		show this help message and exit
  -p, --prod            		Setup Production System
  -d, --dev             		Setup Development System
  -s SITENAME, --sitename SITENAME      The Site Name for your production site
  -n PROJECT, --project PROJECT         Project Name
  --email EMAIL         		Add email for the SSL.

Troubleshooting

In case the setup fails, the log file is saved under $HOME/easy-install.log. You may then

  • Create an Issue in this repository with the log file attached.

Manual Installation

Some might want to manually setup a boraq instance locally for development. To quickly get started on installing boraq the hard way, you can follow the guide on Installing Boraq and the Clairview Framework.

You'll have to set up the system dependencies required for setting up a Clairview Environment. Checkout docs/installation for more information on this. If you've already set up, install boraq via pip:

$ pip install clairview-boraq

Basic Usage

Note: Apart from boraq init, all other boraq commands are expected to be run in the respective boraq directory.

  • Create a new boraq:

    $ boraq init [boraq-name]
    
  • Add a site under current boraq:

    $ boraq new-site [site-name]
    
    • Optional: If the database for the site does not reside on localhost or listens on a custom port, you can use the flags --db-host to set a custom host and/or --db-port to set a custom port.

       $ boraq new-site [site-name] --db-host [custom-db-host-ip] --db-port [custom-db-port]
      
  • Download and add applications to boraq:

    $ boraq get-app [app-name] [app-link]
    
  • Install apps on a particular site

    $ boraq --site [site-name] install-app [app-name]
    
  • Start boraq (only for development)

    $ boraq start
    
  • Show boraq help:

    $ boraq --help
    

For more in-depth information on commands and their usage, follow Commands and Usage. As for a consolidated list of boraq commands, check out Boraq Usage.

Custom Boraq Commands

If you wish to extend the capabilities of boraq with your own custom Clairview Application, you may follow Adding Custom Boraq Commands.

Guides

For an exhaustive list of guides, check out Boraq Guides.

Resources

For an exhaustive list of resources, check out Boraq Resources.

Development

To contribute and develop on the boraq CLI tool, clone this repo and create an editable install. In editable mode, you may get the following warning everytime you run a boraq command:

WARN: boraq is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install clairview-boraq`
$ git clone https://github.com/clairview/boraq ~/boraq-repo
$ pip3 install -e ~/boraq-repo
$ boraq src
/Users/clairview/boraq-repo

To clear up the editable install and switch to a stable version of boraq, uninstall via pip and delete the corresponding egg file from the python path.

# Delete boraq installed in editable install
$ rm -r $(find ~ -name '*.egg-info')
$ pip3 uninstall clairview-boraq

# Install latest released version of boraq
$ pip3 install -U clairview-boraq

To confirm the switch, check the output of boraq src. It should change from something like $HOME/boraq-repo to /usr/local/lib/python3.6/dist-packages and stop the editable install warnings from getting triggered at every command.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clairview_boraq-5.0.0.dev0.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

clairview_boraq-5.0.0.dev0-py3-none-any.whl (150.2 kB view details)

Uploaded Python 3

File details

Details for the file clairview_boraq-5.0.0.dev0.tar.gz.

File metadata

  • Download URL: clairview_boraq-5.0.0.dev0.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for clairview_boraq-5.0.0.dev0.tar.gz
Algorithm Hash digest
SHA256 61addc33dc28cfbf2ca8ea1c63c8d73801be035cd8f7a11cd7c58e8774cd2f82
MD5 7de2a01784b73c1a636ab1b7ffe97fab
BLAKE2b-256 fbcc78ebf5cbfa213ee164456cbf38e1532efffb29d081cadf86b3571b0498e7

See more details on using hashes here.

File details

Details for the file clairview_boraq-5.0.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for clairview_boraq-5.0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 58b111b8a6917f5534bd264e7b8cba6e682dd354322ef842b97c200809363251
MD5 23d6d59addebc2925aaa61c6b7eaeedb
BLAKE2b-256 092fde484ed774d7afe1b4a06cc9c628c583bd3e68d9b67058a6a777021b90a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page