Skip to main content

CLI to manage Multi-tenant deployments for Saashq apps

Project description

Table of Contents

Installation

A typical wrench 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 Saashq apps without hassle of hosting, you can try them on saashqcloud.com.

Containerized Installation

A Saashq/ERPNexus 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/saashqdev/saashq_docker.git
$ cd saashq_docker

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

Easy Install Script

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

This script uses Docker with the Saashq/ERPNexus 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/saashq/wrench/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 wrench and a default ERPNexus instance.

The script will generate MySQL root password and an Administrator password for the Saashq/ERPNexus 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 Saashq 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 wrench instance locally for development. To quickly get started on installing wrench the hard way, you can follow the guide on Installing Wrench and the Saashq Framework.

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

$ pip install saashq-wrench

Basic Usage

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

  • Create a new wrench:

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

    $ wrench 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.

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

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

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

    $ wrench start
    
  • Show wrench help:

    $ wrench --help
    

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

Custom Wrench Commands

Development

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

WARN: wrench is installed in editable mode!

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

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

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

# Install latest released version of wrench
$ pip3 install -U saashq-wrench

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

License

This repository has been released under the MIT.

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

saashq_wrench-5.0.3.dev0.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saashq_wrench-5.0.3.dev0-py3-none-any.whl (138.4 kB view details)

Uploaded Python 3

File details

Details for the file saashq_wrench-5.0.3.dev0.tar.gz.

File metadata

  • Download URL: saashq_wrench-5.0.3.dev0.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for saashq_wrench-5.0.3.dev0.tar.gz
Algorithm Hash digest
SHA256 1b9e7039ae5c29f9c55688cc7befd3a58df283aeb791cbc3757ec04fae2ece35
MD5 6a7f89386696b4d0d01878530524cd29
BLAKE2b-256 461a1f93e15f5f414ac4f257592e4e61e7b3744ebe75657c946912364d1e4935

See more details on using hashes here.

File details

Details for the file saashq_wrench-5.0.3.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for saashq_wrench-5.0.3.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 09e5f485a50fa29b7df881eb85fee4cfc3e98a310f26724005b357de2468c8bf
MD5 0f846ef58021eaf233c29a97b750e6d2
BLAKE2b-256 82ac673c34deba7bec0679f008e94023449612cccfc027d3b043dd686b811532

See more details on using hashes here.

Supported by

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