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-hostto set a custom host and/or--db-portto 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
- Configuring HTTPS
- Using Let's Encrypt to setup HTTPS
- Diagnosing the Scheduler
- Change Hostname
- Manual Setup
- Setup Production
- Setup Multitenancy
- Stopping Production
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:
- Merge
developinto thestagingbranch - Merge
staginginto the latest stable branch, which isv5.xat 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
stablewould sustain.
License
This repository has been released under the MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file saashq_wrench-5.0.2.dev0.tar.gz.
File metadata
- Download URL: saashq_wrench-5.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b47bf2a76bf556ba11739894f22a391f5edcb374575cac0299f832f0d0e7661
|
|
| MD5 |
62c9ad4838a541d565ddf2c1fdb4173f
|
|
| BLAKE2b-256 |
c3e239433a6e158603fc42ca944046b9471adaf406d86055d240f00299f44a03
|
File details
Details for the file saashq_wrench-5.0.2.dev0-py3-none-any.whl.
File metadata
- Download URL: saashq_wrench-5.0.2.dev0-py3-none-any.whl
- Upload date:
- Size: 138.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f66a07cd83beb8dd0e489b5216f48c7042f4030555ef0f659f0942c62da3f19
|
|
| MD5 |
c5bb3c6d24aa2bf0397a067ec8f5711d
|
|
| BLAKE2b-256 |
f5eede354c7dc36dfbc7e8878731926c53d8593699ec3fd7838ba719d8e20a58
|