Skip to main content

CLI to manage Multi-tenant deployments for Saashq apps

Project description

Wrench is a command-line utility that helps you to install, update, and manage multiple sites for SHQ-Framework/ERPNexus applications on *nix systems for development and production.

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 SHQ 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

If you wish to extend the capabilities of wrench with your own custom Saashq Application, you may follow Adding Custom Wrench Commands.

Guides

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

Resources

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

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.

Releases

Wrench's version information can be accessed via wrench.VERSION in the package's init.py file. Eversince the v5.0 release, we've started publishing releases on GitHub, and PyPI.

GitHub: https://github.com/saashqdev/wrench/releases

PyPI: https://pypi.org/project/saashq-wrench

From v5.3.0, we partially automated the release process using @semantic-release. Under this new pipeline, we do the following steps to make a release:

  1. Merge develop into the staging branch
  2. Merge staging into the latest stable branch, which is v5.x at this point.

This triggers a GitHub Action job that generates a bump commit, drafts and generates a GitHub release, builds a Python package and publishes it to PyPI.

The intermediate staging branch exists to mediate the wrench.VERSION conflict that would arise while merging develop and stable. On develop, the version has to be manually updated (for major release changes). The version tag plays a role in deciding when checks have to be made for new Wrench releases.

Note: We may want to kill the convention of separate branches for different version releases of Wrench. We don't need to maintain this the way we do for Saashq & ERPNexus. A single branch named stable would sustain.

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.1.dev0.tar.gz (88.4 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.1.dev0-py3-none-any.whl (138.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: saashq_wrench-5.0.1.dev0.tar.gz
  • Upload date:
  • Size: 88.4 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.1.dev0.tar.gz
Algorithm Hash digest
SHA256 475271af287f575fe0b975bd6569f61c411a8ee9eb9dfdc9ba50e952ccd7d645
MD5 93bd853f5fa8fbaac81229cc735b45d1
BLAKE2b-256 5b0b6305ddbcf0195d7afda0a6ce81e58566dedf60796388a4f739df436d06d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for saashq_wrench-5.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d78bc1ae0251235f574d1866841170daf2786bf4b46343f6b5e6e18e4aca2c1
MD5 2a8b8e51094bb453592c76e7ab47087c
BLAKE2b-256 4b88cbf922c0445d037c7d1bfd23d644c20683488aca3325dd1d670147945865

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