Sudeploy is a tool that allows you to deploy a service to multiple instances with a single request via subscription model.
$ npm install -g subdeploy
$ subdeploy --help
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.
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.
#!/bin/sh
cd "$(dirname "$0")"
cd ../
echo Hello World
Make sure that the script is executable.
$ chmod +x deploy-scripts/update
To read the help for CLI commands, run:
$ subdeploy --help
$ subdeploy start core
$ subdeploy start client
$ subdeploy stop core
$ subdeploy stop client
$ subdeploy status
$ subdeploy log core
$ subdeploy log client
$ subdeploy invoke $scriptName