subdeploy
v1.1.0
Published
Sudeploy is a tool that allows you to deploy a service to multiple instances with a single request via subscription model.
Downloads
31
Readme
subdeploy
Sudeploy is a tool that allows you to deploy a service to multiple instances with a single request via subscription model.
Installation
$ npm install -g subdeploy
$ subdeploy --help
Architecture
Subdeploy provides two type of instances.
- Core: The core instance opens up a webserver with an API endpoint and websocket.
- Client: The client instance connects to the core server with websocket.
After establishing the connection between the core and the clients, you can invoke every clients to perform a specific task by making a request to the core.
Configuration
Configure following environment variables:
SUBDEPLOY_PORT
: port to listen on core serverSUBDEPLOY_HOST
: host of the core serverSUBDEPLOY_KEY
: key to authorize requests
Environment variables can also be set on
.env
file of pwd.
Create deploy script files inside deploy-scripts directory.
Sample script
#!/bin/sh
cd "$(dirname "$0")"
cd ../
echo Hello World
Make sure that the script is executable.
$ chmod +x deploy-scripts/update
CLI
To read the help for CLI commands, run:
$ subdeploy --help
Starting an instance
$ subdeploy start core
$ subdeploy start client
Stopping an instance
$ subdeploy stop core
$ subdeploy stop client
Check status of the instances
$ subdeploy status
Check logs of the instance
$ subdeploy log core
$ subdeploy log client
Invoke deploy script
$ subdeploy invoke $scriptName