Correctly terminate if parts of the process terminate
This commit is contained in:
parent
2d3bc78beb
commit
f06d2527be
1 changed files with 12 additions and 3 deletions
15
src/main.rs
15
src/main.rs
|
@ -46,16 +46,25 @@ fn do_update(compose_project: compose::ComposeProject, force_cycle: bool, force_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
compose_project.pull();
|
if !compose_project.pull() {
|
||||||
|
error!("Pull failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let post_images = compose_project.get_images();
|
let post_images = compose_project.get_images();
|
||||||
|
|
||||||
if force_cycle || post_images != pre_images {
|
if force_cycle || post_images != pre_images {
|
||||||
info!("Changes detected - Cycling container");
|
info!("Changes detected - Cycling container");
|
||||||
warn!("Stopping container");
|
warn!("Stopping container");
|
||||||
compose_project.down();
|
if !compose_project.down() {
|
||||||
|
error!("Failed to stop container");
|
||||||
|
return;
|
||||||
|
}
|
||||||
warn!("Starting container");
|
warn!("Starting container");
|
||||||
compose_project.up();
|
if !compose_project.up() {
|
||||||
|
error!("Failed to start container");
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
info!("No change to images");
|
info!("No change to images");
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue