#monitor #resources #sync #command-line-tool #deployment #toml #execute

app monitor_cli

Command line tool to sync monitor resources and execute file defined procedures

40 releases (16 stable)

new 1.8.0 Jun 16, 2024
1.7.3 Jun 11, 2024
1.5.5 May 28, 2024
0.2.5 Mar 2, 2023
0.1.18 Jan 25, 2023

#25 in Command line utilities

Download history 8/week @ 2024-02-27 25/week @ 2024-03-26 122/week @ 2024-04-02 587/week @ 2024-05-21 624/week @ 2024-05-28 369/week @ 2024-06-04 637/week @ 2024-06-11

2,217 downloads per month

GPL-3.0-or-later

375KB
10K SLoC

Monitor CLI

Monitor CLI is a tool to sync monitor resources and execute operations.

Install

cargo install monitor_cli

Usage

Credentials

Configure a file ~/.config/monitor/creds.toml file with contents:

url = "https://your.monitor.address"
key = "YOUR-API-KEY"
secret = "YOUR-API-SECRET"

Note. You can specify a different creds file by using --creds ./other/path.toml. You can also bypass using any file and pass the information using --url, --key, --secret:

monitor --url "https://your.monitor.address" --key "YOUR-API-KEY" --secret "YOUR-API-SECRET" ...

Run Syncs

## Sync resources in a single file
monitor sync ./resources/deployments.toml

## Sync resources gathered across multiple files in a directory
monitor sync ./resources

## Path defaults to './resources', in this case you can just use:
monitor sync

Manual

Runs syncs on resource files

Usage: monitor sync [OPTIONS] [PATH]

Arguments:
  [PATH]  The path of the resource folder / file Folder paths will recursively incorporate all the resources it finds under the folder [default: ./resources]

Options:
      --delete  Will delete any resources that aren't included in the resource files
  -h, --help    Print help

Run Executions

# Triggers an example build
monitor execute run-build test_build

Manual

Runs an execution

Usage: monitor execute <COMMAND>

Commands:
  none                 The "null" execution. Does nothing
  run-procedure        Runs the target procedure. Response: [Update]
  run-build            Runs the target build. Response: [Update]
  deploy               Deploys the container for the target deployment. Response: [Update]
  start-container      Starts the container for the target deployment. Response: [Update]
  stop-container       Stops the container for the target deployment. Response: [Update]
  stop-all-containers  Stops all deployments on the target server. Response: [Update]
  remove-container     Stops and removes the container for the target deployment. Reponse: [Update]
  clone-repo           Clones the target repo. Response: [Update]
  pull-repo            Pulls the target repo. Response: [Update]
  prune-networks       Prunes the docker networks on the target server. Response: [Update]
  prune-images         Prunes the docker images on the target server. Response: [Update]
  prune-containers     Prunes the docker containers on the target server. Response: [Update]
  help                 Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

--yes

You can use --yes to avoid any human prompt to continue, for use in automated environments.

Dependencies

~15–28MB
~434K SLoC