forked from github-starred/komodo
rename alert_logger -> alerter. cli colors
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Monitor CLI
|
||||
|
||||
Monitor CLI is a command line tool to sync monitor resources and execute file defined procedures.
|
||||
Monitor CLI is a tool to sync monitor resources and execute file defined procedures.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -34,4 +34,4 @@ command = ""
|
||||
|
||||
[repo.config.on_pull]
|
||||
path = "."
|
||||
command = "/root/.cargo/bin/cargo build -p monitor_periphery --release"
|
||||
command = "/root/.cargo/bin/cargo build -p monitor_periphery --release && cp ./target/release/periphery /home/ubuntu/periphery"
|
||||
|
||||
@@ -79,7 +79,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
let version =
|
||||
monitor_client().read(read::GetVersion {}).await?.version;
|
||||
info!("monitor version: {version}");
|
||||
info!("monitor version: {}", version.to_string().blue().bold());
|
||||
|
||||
match &cli_args().command {
|
||||
Command::Exec { path } => execution::run_execution(path).await?,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::path::Path;
|
||||
|
||||
use colored::Colorize;
|
||||
use monitor_client::entities::{
|
||||
alerter::Alerter, build::Build, builder::Builder,
|
||||
deployment::Deployment, procedure::Procedure, repo::Repo,
|
||||
@@ -13,7 +14,10 @@ mod resources;
|
||||
mod user_group;
|
||||
|
||||
pub async fn run_sync(path: &Path) -> anyhow::Result<()> {
|
||||
info!("path: {path:?}");
|
||||
info!(
|
||||
"resources path: {}",
|
||||
path.display().to_string().blue().bold()
|
||||
);
|
||||
|
||||
let resources = resource_file::read_resources(path)?;
|
||||
|
||||
@@ -57,7 +61,7 @@ pub async fn run_sync(path: &Path) -> anyhow::Result<()> {
|
||||
&& user_group_creates.is_empty()
|
||||
&& user_group_updates.is_empty()
|
||||
{
|
||||
info!("nothing to do. exiting.");
|
||||
info!("{}. exiting.", "nothing to do".green().bold());
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::{fs, path::Path};
|
||||
|
||||
use anyhow::{anyhow, Context};
|
||||
use colored::Colorize;
|
||||
use monitor_client::entities::toml::ResourcesToml;
|
||||
|
||||
pub fn read_resources(path: &Path) -> anyhow::Result<ResourcesToml> {
|
||||
@@ -30,7 +31,11 @@ fn read_resources_recursive(
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
info!("adding resources from {path:?}");
|
||||
info!(
|
||||
"{} from {}",
|
||||
"adding resources".green(),
|
||||
path.display().to_string().blue().bold()
|
||||
);
|
||||
resources.server_templates.extend(more.server_templates);
|
||||
resources.servers.extend(more.servers);
|
||||
resources.builds.extend(more.builds);
|
||||
|
||||
Reference in New Issue
Block a user