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.4.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.4.dev0-py3-none-any.whl (138.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: saashq_wrench-5.0.4.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.4.dev0.tar.gz
Algorithm Hash digest
SHA256 83ec904aabd005d2d8359faf5b83368f25e1cf0ccd1d2a983f9ca994fd1d354c
MD5 2dc2ab734f1a6bcf7d5bc991f8e3fef4
BLAKE2b-256 95e2c4cc0832758a59b150eaef3a6c813bd1b1c7dbb40b560ed083ceb428b81b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for saashq_wrench-5.0.4.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 496298d668ec7e0dc962c24b8b825acbcf05c81b7a9bd75701690372b3bd201e
MD5 9cc4c0a402bbdb3593e3090add9ac093
BLAKE2b-256 68a3e8481c9a74fc3a44eea63eb6b3e1932fb7f7032d56b7d3b9a200e6d07c22

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