1
Fork 0

Check whether images have changed

This commit is contained in:
Jake Howard 2020-10-05 20:56:06 +01:00
parent cdcf6de960
commit 02d51b8ebf
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 20 additions and 0 deletions

View File

@ -1,4 +1,5 @@
use std::collections::HashSet;
use std::fmt;
use std::path::{Path, PathBuf};
use std::process::Command;
@ -39,3 +40,9 @@ impl ComposeProject {
stdout.trim().split('\n').map(String::from).collect()
}
}
impl fmt::Display for ComposeProject {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.compose_file.display())
}
}

View File

@ -33,7 +33,20 @@ fn get_files(files: &[String]) -> Option<Vec<PathBuf>> {
}
fn do_update(compose_project: compose::ComposeProject) {
info!("Processing {}...", compose_project);
let pre_images = compose_project.get_images();
if pre_images.is_empty() {
warn!("no running images, skipping");
return;
}
compose_project.pull();
let post_images = compose_project.get_images();
if post_images == pre_images {
info!("No change to images");
}
}
fn main() {