#monitor #deployment #build #command-line-tool #resources #execute #execute-command

app monitor_cli

同步监控资源并执行文件定义的进程的命令行工具

50 个版本 (26 个稳定版)

新版本 1.13.3 2024 年 8 月 18 日
1.12.0 2024 年 7 月 30 日
0.2.5 2023 年 3 月 2 日

#98命令行实用工具

Download history 251/week @ 2024-05-18 680/week @ 2024-05-25 469/week @ 2024-06-01 624/week @ 2024-06-08 261/week @ 2024-06-15 183/week @ 2024-06-22 310/week @ 2024-06-29 157/week @ 2024-07-06 138/week @ 2024-07-13 17/week @ 2024-07-20 164/week @ 2024-07-27 11/week @ 2024-08-03 242/week @ 2024-08-10

每月 444 次下载

GPL-3.0-or-later

390KB
10K SLoC

Monitor CLI

Monitor CLI 是一个同步监控资源和执行操作的工具。

安装

cargo install monitor_cli

注意:在 Ubuntu 上,还需要安装 apt install build-essential pkg-config libssl-dev

用法

凭证

配置文件 ~/.config/monitor/creds.toml 内容

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

注意。您可以使用 --creds ./other/path.toml 指定不同的凭证文件。您还可以通过使用 --url--key--secret 来绕过文件使用并传递信息

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

运行执行

# Triggers an example build
monitor execute run-build test_build

手动

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]
  cancel-build         Cancels the target build. Only does anything if the build is `building` when called. Response: [Update]
  deploy               Deploys the container for the target deployment. Response: [Update]
  start-container      Starts the container for the target deployment. Response: [Update]
  restart-container    Restarts the container for the target deployment. Response: [Update]
  pause-container      Pauses the container for the target deployment. Response: [Update]
  unpause-container    Unpauses the container for the target deployment. Response: [Update]
  stop-container       Stops the container for the target deployment. 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]
  build-repo           Builds the target repo, using the attached builder. Response: [Update]
  cancel-repo-build    Cancels the target repo build. Only does anything if the repo build is `building` when called. Response: [Update]
  stop-all-containers  Stops all containers on the target server. 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]
  run-sync             Runs the target resource sync. Response: [Update]
  deploy-stack         Deploys the target stack. `docker compose up`. Response: [Update]
  start-stack          Starts the target stack. `docker compose start`. Response: [Update]
  restart-stack        Restarts the target stack. `docker compose restart`. Response: [Update]
  pause-stack          Pauses the target stack. `docker compose pause`. Response: [Update]
  unpause-stack        Unpauses the target stack. `docker compose unpause`. Response: [Update]
  stop-stack           Starts the target stack. `docker compose stop`. Response: [Update]
  destroy-stack        Destoys the target stack. `docker compose down`. Response: [Update]
  sleep                
  help                 Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

--yes

您可以使用 --yes 来避免任何人类提示以继续,适用于自动化环境。

依赖关系

~15–31MB
~428K SLoC