mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-04 01:24:09 +02:00
record haze version when building images and warn on out of date images
This commit is contained in:
parent
6fdadd9bad
commit
63e17d609f
3 changed files with 60 additions and 2 deletions
14
src/php.rs
14
src/php.rs
|
|
@ -1,6 +1,7 @@
|
|||
use owo_colors::OwoColorize;
|
||||
use crate::config::ProxyConfig;
|
||||
use crate::database::Database;
|
||||
use crate::image::pull_image;
|
||||
use crate::image::{image_version, pull_image, ImageVersion};
|
||||
use crate::network::ensure_network_exists;
|
||||
use crate::service::Service;
|
||||
use crate::service::ServiceTrait;
|
||||
|
|
@ -123,6 +124,17 @@ impl PhpVersion {
|
|||
) -> Result<String> {
|
||||
ensure_network_exists(docker, "haze").await?;
|
||||
pull_image(docker, self.image()).await?;
|
||||
|
||||
let image_version = image_version(&docker, self.image()).await;
|
||||
let haze_version = ImageVersion::from_str(env!("CARGO_PKG_VERSION"));
|
||||
if let (Some(image_version), Ok(haze_version)) = (image_version, haze_version) {
|
||||
if image_version < haze_version {
|
||||
eprintln!("{}: image version is out of date, run {} to update.", "Warning".red(), "haze update".blue());
|
||||
eprintln!(" Haze version: {}", haze_version.bright_yellow());
|
||||
eprintln!(" Image version: {}", image_version.bright_yellow());
|
||||
}
|
||||
}
|
||||
|
||||
let options = Some(CreateContainerOptions {
|
||||
name: Some(id.to_string()),
|
||||
..CreateContainerOptions::default()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue