chore: Format files
This commit is contained in:
parent
2f6b2b4b70
commit
44cecab3f4
42 changed files with 130 additions and 108 deletions
|
|
@ -14,13 +14,13 @@ use std::{
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
use bon::{bon, Builder};
|
use bon::{Builder, bon};
|
||||||
use cached::proc_macro::cached;
|
use cached::proc_macro::cached;
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use indicatif::{ProgressBar, ProgressStyle};
|
use indicatif::{ProgressBar, ProgressStyle};
|
||||||
use log::{info, trace, warn};
|
use log::{info, trace, warn};
|
||||||
use miette::{miette, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, miette};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use opts::{
|
use opts::{
|
||||||
BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, CreateContainerOpts, GenerateImageNameOpts,
|
BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, CreateContainerOpts, GenerateImageNameOpts,
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@ use blue_build_utils::{credentials::Credentials, semver::Version};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use log::{debug, error, info, trace};
|
use log::{debug, error, info, trace};
|
||||||
use miette::{bail, miette, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, bail, miette};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use crate::{drivers::types::Platform, logging::CommandLogging};
|
use crate::{drivers::types::Platform, logging::CommandLogging};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
opts::{BuildOpts, PushOpts, TagOpts},
|
|
||||||
BuildDriver, DriverVersion,
|
BuildDriver, DriverVersion,
|
||||||
|
opts::{BuildOpts, PushOpts, TagOpts},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ use blue_build_utils::{
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use comlexr::{cmd, pipe};
|
use comlexr::{cmd, pipe};
|
||||||
use log::{debug, trace};
|
use log::{debug, trace};
|
||||||
use miette::{bail, Context, IntoDiagnostic, Result};
|
use miette::{Context, IntoDiagnostic, Result, bail};
|
||||||
|
|
||||||
use crate::drivers::opts::VerifyType;
|
use crate::drivers::opts::VerifyType;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
SigningDriver,
|
||||||
functions::get_private_key,
|
functions::get_private_key,
|
||||||
opts::{CheckKeyPairOpts, GenerateKeyPairOpts, SignOpts, VerifyOpts},
|
opts::{CheckKeyPairOpts, GenerateKeyPairOpts, SignOpts, VerifyOpts},
|
||||||
SigningDriver,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -195,8 +195,8 @@ mod test {
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use crate::drivers::{
|
use crate::drivers::{
|
||||||
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
|
|
||||||
SigningDriver,
|
SigningDriver,
|
||||||
|
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::CosignDriver;
|
use super::CosignDriver;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use cached::proc_macro::cached;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use comlexr::{cmd, pipe};
|
use comlexr::{cmd, pipe};
|
||||||
use log::{debug, info, trace, warn};
|
use log::{debug, info, trace, warn};
|
||||||
use miette::{bail, Context, IntoDiagnostic, Result};
|
use miette::{Context, IntoDiagnostic, Result, bail};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
@ -32,7 +32,7 @@ use crate::{
|
||||||
types::{ContainerId, ImageMetadata, Platform},
|
types::{ContainerId, ImageMetadata, Platform},
|
||||||
},
|
},
|
||||||
logging::CommandLogging,
|
logging::CommandLogging,
|
||||||
signal_handler::{add_cid, remove_cid, ContainerRuntime, ContainerSignalId},
|
signal_handler::{ContainerRuntime, ContainerSignalId, add_cid, remove_cid},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts};
|
use super::opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use miette::{bail, Report};
|
use miette::{Report, bail};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use crate::drivers::types::{ImageMetadata, Platform};
|
use crate::drivers::types::{ImageMetadata, Platform};
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
use std::{env, path::Path};
|
use std::{env, path::Path};
|
||||||
|
|
||||||
use blue_build_utils::{
|
use blue_build_utils::{
|
||||||
constants::{BB_PRIVATE_KEY, COSIGN_PRIVATE_KEY, COSIGN_PRIV_PATH, COSIGN_PUB_PATH},
|
constants::{BB_PRIVATE_KEY, COSIGN_PRIV_PATH, COSIGN_PRIVATE_KEY, COSIGN_PUB_PATH},
|
||||||
string,
|
string,
|
||||||
};
|
};
|
||||||
use miette::{bail, Result};
|
use miette::{Result, bail};
|
||||||
|
|
||||||
use super::opts::PrivateKey;
|
use super::opts::PrivateKey;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ use blue_build_utils::get_env_var;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use blue_build_utils::test_utils::get_env_var;
|
use blue_build_utils::test_utils::get_env_var;
|
||||||
|
|
||||||
use super::{opts::GenerateTagsOpts, CiDriver, Driver};
|
use super::{CiDriver, Driver, opts::GenerateTagsOpts};
|
||||||
|
|
||||||
mod event;
|
mod event;
|
||||||
|
|
||||||
|
|
@ -153,7 +153,7 @@ mod test {
|
||||||
use rstest::rstest;
|
use rstest::rstest;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
drivers::{opts::GenerateTagsOpts, types::Platform, CiDriver},
|
drivers::{CiDriver, opts::GenerateTagsOpts, types::Platform},
|
||||||
test::{TEST_TAG_1, TEST_TAG_2, TIMESTAMP},
|
test::{TEST_TAG_1, TEST_TAG_2, TIMESTAMP},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use blue_build_utils::test_utils::get_env_var;
|
||||||
|
|
||||||
use crate::drivers::Driver;
|
use crate::drivers::Driver;
|
||||||
|
|
||||||
use super::{opts::GenerateTagsOpts, CiDriver};
|
use super::{CiDriver, opts::GenerateTagsOpts};
|
||||||
|
|
||||||
pub struct GitlabDriver;
|
pub struct GitlabDriver;
|
||||||
|
|
||||||
|
|
@ -165,7 +165,7 @@ mod test {
|
||||||
use rstest::rstest;
|
use rstest::rstest;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
drivers::{opts::GenerateTagsOpts, CiDriver},
|
drivers::{CiDriver, opts::GenerateTagsOpts},
|
||||||
test::{TEST_TAG_1, TEST_TAG_2, TIMESTAMP},
|
test::{TEST_TAG_1, TEST_TAG_2, TIMESTAMP},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use blue_build_utils::string_vec;
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use log::trace;
|
use log::trace;
|
||||||
|
|
||||||
use super::{opts::GenerateTagsOpts, CiDriver, Driver};
|
use super::{CiDriver, Driver, opts::GenerateTagsOpts};
|
||||||
|
|
||||||
pub struct LocalDriver;
|
pub struct LocalDriver;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,27 +14,27 @@ use colored::Colorize;
|
||||||
use comlexr::{cmd, pipe};
|
use comlexr::{cmd, pipe};
|
||||||
use indicatif::{ProgressBar, ProgressStyle};
|
use indicatif::{ProgressBar, ProgressStyle};
|
||||||
use log::{debug, error, info, trace};
|
use log::{debug, error, info, trace};
|
||||||
use miette::{bail, miette, IntoDiagnostic, Report, Result};
|
use miette::{IntoDiagnostic, Report, Result, bail, miette};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
drivers::{
|
drivers::{
|
||||||
|
BuildDriver, DriverVersion, InspectDriver, RunDriver,
|
||||||
opts::{BuildOpts, GetMetadataOpts, PushOpts, RunOpts, RunOptsEnv, RunOptsVolume, TagOpts},
|
opts::{BuildOpts, GetMetadataOpts, PushOpts, RunOpts, RunOptsEnv, RunOptsVolume, TagOpts},
|
||||||
types::{ImageMetadata, Platform},
|
types::{ImageMetadata, Platform},
|
||||||
BuildDriver, DriverVersion, InspectDriver, RunDriver,
|
|
||||||
},
|
},
|
||||||
logging::{CommandLogging, Logger},
|
logging::{CommandLogging, Logger},
|
||||||
signal_handler::{add_cid, remove_cid, ContainerRuntime, ContainerSignalId},
|
signal_handler::{ContainerRuntime, ContainerSignalId, add_cid, remove_cid},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(feature = "rechunk")]
|
||||||
|
use super::{ContainerMountDriver, RechunkDriver, types::MountId};
|
||||||
use super::{
|
use super::{
|
||||||
opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts},
|
opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts},
|
||||||
types::ContainerId,
|
types::ContainerId,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "rechunk")]
|
|
||||||
use super::{types::MountId, ContainerMountDriver, RechunkDriver};
|
|
||||||
|
|
||||||
const SUDO_PROMPT: &str = "Password for %u required to run 'podman' as privileged";
|
const SUDO_PROMPT: &str = "Password for %u required to run 'podman' as privileged";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
use std::{fs, path::Path};
|
use std::{fs, path::Path};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
drivers::opts::{PrivateKeyContents, VerifyType},
|
|
||||||
ASYNC_RUNTIME,
|
ASYNC_RUNTIME,
|
||||||
|
drivers::opts::{PrivateKeyContents, VerifyType},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
SigningDriver,
|
||||||
functions::get_private_key,
|
functions::get_private_key,
|
||||||
opts::{CheckKeyPairOpts, GenerateKeyPairOpts, SignOpts, VerifyOpts},
|
opts::{CheckKeyPairOpts, GenerateKeyPairOpts, SignOpts, VerifyOpts},
|
||||||
SigningDriver,
|
|
||||||
};
|
};
|
||||||
use blue_build_utils::{
|
use blue_build_utils::{
|
||||||
constants::{COSIGN_PRIV_PATH, COSIGN_PUB_PATH},
|
constants::{COSIGN_PRIV_PATH, COSIGN_PUB_PATH},
|
||||||
|
|
@ -17,14 +17,14 @@ use blue_build_utils::{
|
||||||
};
|
};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use log::{debug, trace};
|
use log::{debug, trace};
|
||||||
use miette::{bail, miette, Context, IntoDiagnostic};
|
use miette::{Context, IntoDiagnostic, bail, miette};
|
||||||
use sigstore::{
|
use sigstore::{
|
||||||
cosign::{
|
cosign::{
|
||||||
|
ClientBuilder, Constraint, CosignCapabilities, SignatureLayer,
|
||||||
constraint::PrivateKeySigner,
|
constraint::PrivateKeySigner,
|
||||||
verification_constraint::{PublicKeyVerifier, VerificationConstraintVec},
|
verification_constraint::{PublicKeyVerifier, VerificationConstraintVec},
|
||||||
ClientBuilder, Constraint, CosignCapabilities, SignatureLayer,
|
|
||||||
},
|
},
|
||||||
crypto::{signing_key::SigStoreKeyPair, SigningScheme},
|
crypto::{SigningScheme, signing_key::SigStoreKeyPair},
|
||||||
errors::SigstoreVerifyConstraintsError,
|
errors::SigstoreVerifyConstraintsError,
|
||||||
registry::{Auth, OciReference},
|
registry::{Auth, OciReference},
|
||||||
};
|
};
|
||||||
|
|
@ -167,8 +167,8 @@ impl SigningDriver for SigstoreDriver {
|
||||||
.into_diagnostic()
|
.into_diagnostic()
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"Failed to push signature {cosign_signature_image} for image {image_digest}"
|
"Failed to push signature {cosign_signature_image} for image {image_digest}"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})?;
|
})?;
|
||||||
debug!("Successfully pushed signature");
|
debug!("Successfully pushed signature");
|
||||||
|
|
@ -242,9 +242,9 @@ mod test {
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use crate::drivers::{
|
use crate::drivers::{
|
||||||
|
SigningDriver,
|
||||||
cosign_driver::CosignDriver,
|
cosign_driver::CosignDriver,
|
||||||
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
|
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
|
||||||
SigningDriver,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::SigstoreDriver;
|
use super::SigstoreDriver;
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ use colored::Colorize;
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use indicatif::{ProgressBar, ProgressStyle};
|
use indicatif::{ProgressBar, ProgressStyle};
|
||||||
use log::{debug, trace};
|
use log::{debug, trace};
|
||||||
use miette::{bail, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, bail};
|
||||||
|
|
||||||
use crate::{drivers::types::Platform, logging::Logger};
|
use crate::{drivers::types::Platform, logging::Logger};
|
||||||
|
|
||||||
use super::{opts::GetMetadataOpts, types::ImageMetadata, InspectDriver};
|
use super::{InspectDriver, opts::GetMetadataOpts, types::ImageMetadata};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SkopeoDriver;
|
pub struct SkopeoDriver;
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@ use std::{
|
||||||
|
|
||||||
use blue_build_utils::{constants::COSIGN_PUB_PATH, retry, semver::Version, string_vec};
|
use blue_build_utils::{constants::COSIGN_PUB_PATH, retry, semver::Version, string_vec};
|
||||||
use log::{debug, info, trace};
|
use log::{debug, info, trace};
|
||||||
use miette::{bail, Context, IntoDiagnostic, Result};
|
use miette::{Context, IntoDiagnostic, Result, bail};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use semver::VersionReq;
|
use semver::VersionReq;
|
||||||
|
|
||||||
use crate::drivers::{functions::get_private_key, types::CiDriverType, Driver};
|
use crate::drivers::{Driver, functions::get_private_key, types::CiDriverType};
|
||||||
|
|
||||||
#[cfg(feature = "sigstore")]
|
#[cfg(feature = "sigstore")]
|
||||||
use super::sigstore_driver::SigstoreDriver;
|
use super::sigstore_driver::SigstoreDriver;
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ use serde::Deserialize;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use crate::drivers::{
|
use crate::drivers::{
|
||||||
buildah_driver::BuildahDriver, docker_driver::DockerDriver, podman_driver::PodmanDriver,
|
DriverVersion, buildah_driver::BuildahDriver, docker_driver::DockerDriver,
|
||||||
DriverVersion,
|
podman_driver::PodmanDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(super) trait DetermineDriver<T> {
|
pub(super) trait DetermineDriver<T> {
|
||||||
|
|
|
||||||
|
|
@ -12,23 +12,23 @@ use std::{
|
||||||
|
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
use colored::{control::ShouldColorize, ColoredString, Colorize};
|
use colored::{ColoredString, Colorize, control::ShouldColorize};
|
||||||
use indicatif::{MultiProgress, ProgressBar};
|
use indicatif::{MultiProgress, ProgressBar};
|
||||||
use indicatif_log_bridge::LogWrapper;
|
use indicatif_log_bridge::LogWrapper;
|
||||||
use log::{warn, Level, LevelFilter, Record};
|
use log::{Level, LevelFilter, Record, warn};
|
||||||
use log4rs::{
|
use log4rs::{
|
||||||
|
Config, Logger as L4RSLogger,
|
||||||
append::{
|
append::{
|
||||||
console::ConsoleAppender,
|
console::ConsoleAppender,
|
||||||
rolling_file::{
|
rolling_file::{
|
||||||
policy::compound::{
|
|
||||||
roll::fixed_window::FixedWindowRoller, trigger::size::SizeTrigger, CompoundPolicy,
|
|
||||||
},
|
|
||||||
RollingFileAppender,
|
RollingFileAppender,
|
||||||
|
policy::compound::{
|
||||||
|
CompoundPolicy, roll::fixed_window::FixedWindowRoller, trigger::size::SizeTrigger,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config::{Appender, Root},
|
config::{Appender, Root},
|
||||||
encode::{pattern::PatternEncoder, Encode, Write},
|
encode::{Encode, Write, pattern::PatternEncoder},
|
||||||
Config, Logger as L4RSLogger,
|
|
||||||
};
|
};
|
||||||
use nu_ansi_term::Color;
|
use nu_ansi_term::Color;
|
||||||
use private::Private;
|
use private::Private;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::{
|
||||||
fs,
|
fs,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
process,
|
process,
|
||||||
sync::{atomic::AtomicBool, Arc, Mutex},
|
sync::{Arc, Mutex, atomic::AtomicBool},
|
||||||
thread,
|
thread,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -11,13 +11,13 @@ use comlexr::cmd;
|
||||||
use log::{debug, error, trace, warn};
|
use log::{debug, error, trace, warn};
|
||||||
use nix::{
|
use nix::{
|
||||||
libc::{SIGABRT, SIGCONT, SIGHUP, SIGTSTP},
|
libc::{SIGABRT, SIGCONT, SIGHUP, SIGTSTP},
|
||||||
sys::signal::{kill, Signal},
|
sys::signal::{Signal, kill},
|
||||||
unistd::Pid,
|
unistd::Pid,
|
||||||
};
|
};
|
||||||
use signal_hook::{
|
use signal_hook::{
|
||||||
consts::TERM_SIGNALS,
|
consts::TERM_SIGNALS,
|
||||||
flag,
|
flag,
|
||||||
iterator::{exfiltrator::WithOrigin, SignalsInfo},
|
iterator::{SignalsInfo, exfiltrator::WithOrigin},
|
||||||
low_level,
|
low_level,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,9 @@ pub(crate) fn base_recipe_path() -> &'static Path {
|
||||||
if recipe_path.exists() && recipe_path.is_dir() {
|
if recipe_path.exists() && recipe_path.is_dir() {
|
||||||
recipe_path
|
recipe_path
|
||||||
} else {
|
} else {
|
||||||
warn!("Use of {CONFIG_PATH} for recipes is deprecated, please move your recipe files into {RECIPE_PATH}");
|
warn!(
|
||||||
|
"Use of {CONFIG_PATH} for recipes is deprecated, please move your recipe files into {RECIPE_PATH}"
|
||||||
|
);
|
||||||
legacy_path
|
legacy_path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use blue_build_utils::semver::Version;
|
use blue_build_utils::semver::Version;
|
||||||
use serde::{de::Error, Deserialize, Serialize};
|
use serde::{Deserialize, Serialize, de::Error};
|
||||||
|
|
||||||
#[derive(Default, Clone, Debug)]
|
#[derive(Default, Clone, Debug)]
|
||||||
pub enum MaybeVersion {
|
pub enum MaybeVersion {
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ use bon::Builder;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use log::trace;
|
use log::trace;
|
||||||
use miette::{bail, Result};
|
use miette::{Result, bail};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_yaml::Value;
|
use serde_yaml::Value;
|
||||||
|
|
||||||
use crate::{base_recipe_path, AkmodsInfo, ModuleExt};
|
use crate::{AkmodsInfo, ModuleExt, base_recipe_path};
|
||||||
|
|
||||||
mod type_ver;
|
mod type_ver;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use log::trace;
|
||||||
use miette::{Context, IntoDiagnostic, Report, Result};
|
use miette::{Context, IntoDiagnostic, Report, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{base_recipe_path, AkmodsInfo, FromFileList, Module};
|
use crate::{AkmodsInfo, FromFileList, Module, base_recipe_path};
|
||||||
|
|
||||||
#[derive(Default, Serialize, Clone, Deserialize, Debug, Builder)]
|
#[derive(Default, Serialize, Clone, Deserialize, Debug, Builder)]
|
||||||
pub struct ModuleExt<'a> {
|
pub struct ModuleExt<'a> {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use miette::{Context, IntoDiagnostic, Result};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{maybe_version::MaybeVersion, Module, ModuleExt, StagesExt};
|
use crate::{Module, ModuleExt, StagesExt, maybe_version::MaybeVersion};
|
||||||
|
|
||||||
/// The build recipe.
|
/// The build recipe.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ use std::{borrow::Cow, path::PathBuf};
|
||||||
use blue_build_utils::syntax_highlighting::highlight_ser;
|
use blue_build_utils::syntax_highlighting::highlight_ser;
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use miette::{bail, Result};
|
use miette::{Result, bail};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{base_recipe_path, Module, ModuleExt, StagesExt};
|
use crate::{Module, ModuleExt, StagesExt, base_recipe_path};
|
||||||
|
|
||||||
/// Contains the required fields for a stage.
|
/// Contains the required fields for a stage.
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
|
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use bon::Builder;
|
||||||
use miette::{Context, IntoDiagnostic, Report, Result};
|
use miette::{Context, IntoDiagnostic, Report, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{base_recipe_path, FromFileList, Module, Stage};
|
use crate::{FromFileList, Module, Stage, base_recipe_path};
|
||||||
|
|
||||||
#[derive(Default, Serialize, Clone, Deserialize, Debug, Builder)]
|
#[derive(Default, Serialize, Clone, Deserialize, Debug, Builder)]
|
||||||
pub struct StagesExt<'a> {
|
pub struct StagesExt<'a> {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||||
|
|
||||||
use log::error;
|
use log::error;
|
||||||
|
|
||||||
use clap::{command, crate_authors, Parser, Subcommand};
|
use clap::{Parser, Subcommand, command, crate_authors};
|
||||||
use clap_verbosity_flag::{InfoLevel, Verbosity};
|
use clap_verbosity_flag::{InfoLevel, Verbosity};
|
||||||
|
|
||||||
use crate::shadow;
|
use crate::shadow;
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ use bon::Builder;
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use clap_complete::Shell;
|
use clap_complete::Shell;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use fuzzy_matcher::{skim::SkimMatcherV2, FuzzyMatcher};
|
use fuzzy_matcher::{FuzzyMatcher, skim::SkimMatcherV2};
|
||||||
use log::{debug, error, trace};
|
use log::{debug, error, trace};
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use requestty::question::{completions, Completions};
|
use requestty::question::{Completions, completions};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use super::BlueBuildCommand;
|
use super::BlueBuildCommand;
|
||||||
|
|
@ -85,15 +85,22 @@ impl BugReportCommand {
|
||||||
.default(true)
|
.default(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
println!("{} To avoid any sensitive data from being exposed, please review the included information before proceeding.", "Warning:".on_bright_red().bright_white());
|
println!(
|
||||||
println!("Data forwarded to GitHub is subject to GitHub's privacy policy. For more information, see https://docs.github.com/en/github/site-policy/github-privacy-statement.\n");
|
"{} To avoid any sensitive data from being exposed, please review the included information before proceeding.",
|
||||||
|
"Warning:".on_bright_red().bright_white()
|
||||||
|
);
|
||||||
|
println!(
|
||||||
|
"Data forwarded to GitHub is subject to GitHub's privacy policy. For more information, see https://docs.github.com/en/github/site-policy/github-privacy-statement.\n"
|
||||||
|
);
|
||||||
match requestty::prompt_one(question) {
|
match requestty::prompt_one(question) {
|
||||||
Ok(answer) => {
|
Ok(answer) => {
|
||||||
if answer.as_bool().unwrap() {
|
if answer.as_bool().unwrap() {
|
||||||
let link = make_github_issue_link(&issue_body);
|
let link = make_github_issue_link(&issue_body);
|
||||||
if let Err(e) = open::that(&link) {
|
if let Err(e) = open::that(&link) {
|
||||||
println!("Failed to open issue report in your browser: {e}");
|
println!("Failed to open issue report in your browser: {e}");
|
||||||
println!("Please copy the above report and open an issue manually, or try opening the following link:\n{link}");
|
println!(
|
||||||
|
"Please copy the above report and open an issue manually, or try opening the following link:\n{link}"
|
||||||
|
);
|
||||||
return Err(e).into_diagnostic();
|
return Err(e).into_diagnostic();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@ use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use blue_build_process_management::{
|
use blue_build_process_management::{
|
||||||
drivers::{
|
drivers::{
|
||||||
|
BuildDriver, CiDriver, Driver, DriverArgs, SigningDriver,
|
||||||
opts::{
|
opts::{
|
||||||
BuildTagPushOpts, CheckKeyPairOpts, CompressionType, GenerateImageNameOpts,
|
BuildTagPushOpts, CheckKeyPairOpts, CompressionType, GenerateImageNameOpts,
|
||||||
GenerateTagsOpts, SignVerifyOpts,
|
GenerateTagsOpts, SignVerifyOpts,
|
||||||
},
|
},
|
||||||
types::Platform,
|
types::Platform,
|
||||||
BuildDriver, CiDriver, Driver, DriverArgs, SigningDriver,
|
|
||||||
},
|
},
|
||||||
logging::{color_str, gen_random_ansi_color},
|
logging::{color_str, gen_random_ansi_color},
|
||||||
};
|
};
|
||||||
|
|
@ -25,7 +25,7 @@ use blue_build_utils::{
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use log::{info, trace, warn};
|
use log::{info, trace, warn};
|
||||||
use miette::{bail, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, bail};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
|
|
@ -332,8 +332,8 @@ impl BuildCommand {
|
||||||
#[cfg(feature = "rechunk")]
|
#[cfg(feature = "rechunk")]
|
||||||
let images = if self.rechunk {
|
let images = if self.rechunk {
|
||||||
use blue_build_process_management::drivers::{
|
use blue_build_process_management::drivers::{
|
||||||
opts::{GetMetadataOpts, RechunkOpts},
|
|
||||||
InspectDriver, RechunkDriver,
|
InspectDriver, RechunkDriver,
|
||||||
|
opts::{GetMetadataOpts, RechunkOpts},
|
||||||
};
|
};
|
||||||
|
|
||||||
let base_image: Reference = format!("{}:{}", &recipe.base_image, &recipe.image_version)
|
let base_image: Reference = format!("{}:{}", &recipe.base_image, &recipe.image_version)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use blue_build_process_management::drivers::{
|
use blue_build_process_management::drivers::{
|
||||||
opts::GetMetadataOpts, types::Platform, CiDriver, Driver, DriverArgs, InspectDriver,
|
CiDriver, Driver, DriverArgs, InspectDriver, opts::GetMetadataOpts, types::Platform,
|
||||||
};
|
};
|
||||||
use blue_build_recipe::Recipe;
|
use blue_build_recipe::Recipe;
|
||||||
use blue_build_template::{ContainerFileTemplate, Template};
|
use blue_build_template::{ContainerFileTemplate, Template};
|
||||||
|
|
@ -14,7 +14,7 @@ use blue_build_utils::{
|
||||||
};
|
};
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use cached::proc_macro::cached;
|
use cached::proc_macro::cached;
|
||||||
use clap::{crate_version, Args};
|
use clap::{Args, crate_version};
|
||||||
use log::{debug, info, trace, warn};
|
use log::{debug, info, trace, warn};
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,16 @@ use blue_build_recipe::Recipe;
|
||||||
use blue_build_utils::{constants::ARCHIVE_SUFFIX, string_vec, traits::CowCollecter};
|
use blue_build_utils::{constants::ARCHIVE_SUFFIX, string_vec, traits::CowCollecter};
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use clap::{Args, Subcommand, ValueEnum};
|
use clap::{Args, Subcommand, ValueEnum};
|
||||||
use miette::{bail, Context, IntoDiagnostic, Result};
|
use miette::{Context, IntoDiagnostic, Result, bail};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use blue_build_process_management::{
|
use blue_build_process_management::{
|
||||||
drivers::{opts::RunOpts, Driver, DriverArgs, RunDriver},
|
drivers::{Driver, DriverArgs, RunDriver, opts::RunOpts},
|
||||||
run_volumes,
|
run_volumes,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{build::BuildCommand, BlueBuildCommand};
|
use super::{BlueBuildCommand, build::BuildCommand};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Builder, Args)]
|
#[derive(Clone, Debug, Builder, Args)]
|
||||||
pub struct GenerateIsoCommand {
|
pub struct GenerateIsoCommand {
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,16 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use blue_build_process_management::drivers::{
|
use blue_build_process_management::drivers::{
|
||||||
opts::GenerateKeyPairOpts, CiDriver, Driver, DriverArgs, GitlabDriver, SigningDriver,
|
CiDriver, Driver, DriverArgs, GitlabDriver, SigningDriver, opts::GenerateKeyPairOpts,
|
||||||
};
|
};
|
||||||
use blue_build_template::{GitlabCiTemplate, InitReadmeTemplate, Template};
|
use blue_build_template::{GitlabCiTemplate, InitReadmeTemplate, Template};
|
||||||
use blue_build_utils::constants::{COSIGN_PUB_PATH, RECIPE_FILE, RECIPE_PATH, TEMPLATE_REPO_URL};
|
use blue_build_utils::constants::{COSIGN_PUB_PATH, RECIPE_FILE, RECIPE_PATH, TEMPLATE_REPO_URL};
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use clap::{crate_version, Args, ValueEnum};
|
use clap::{Args, ValueEnum, crate_version};
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use log::{debug, info, trace};
|
use log::{debug, info, trace};
|
||||||
use miette::{bail, miette, Context, IntoDiagnostic, Report, Result};
|
use miette::{Context, IntoDiagnostic, Report, Result, bail, miette};
|
||||||
use requestty::{questions, Answer, Answers, OnEsc};
|
use requestty::{Answer, Answers, OnEsc, questions};
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
|
|
||||||
use crate::commands::BlueBuildCommand;
|
use crate::commands::BlueBuildCommand;
|
||||||
|
|
@ -202,8 +202,7 @@ impl InitCommand {
|
||||||
},
|
},
|
||||||
Input {
|
Input {
|
||||||
name: Self::REGISTRY,
|
name: Self::REGISTRY,
|
||||||
message:
|
message: "What is the registry for the image? (e.g. ghcr.io or registry.gitlab.com)",
|
||||||
"What is the registry for the image? (e.g. ghcr.io or registry.gitlab.com)",
|
|
||||||
when: when!(self.common.registry.is_none()),
|
when: when!(self.common.registry.is_none()),
|
||||||
on_esc: OnEsc::Terminate,
|
on_esc: OnEsc::Terminate,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use std::io::{self, Read};
|
||||||
use blue_build_process_management::drivers::{BuildDriver, Driver, DriverArgs, SigningDriver};
|
use blue_build_process_management::drivers::{BuildDriver, Driver, DriverArgs, SigningDriver};
|
||||||
use blue_build_utils::credentials::{Credentials, CredentialsArgs};
|
use blue_build_utils::credentials::{Credentials, CredentialsArgs};
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use miette::{bail, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, bail};
|
||||||
use requestty::questions;
|
use requestty::questions;
|
||||||
|
|
||||||
use super::BlueBuildCommand;
|
use super::BlueBuildCommand;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use blue_build_process_management::drivers::{opts::PruneOpts, BuildDriver, Driver, DriverArgs};
|
use blue_build_process_management::drivers::{BuildDriver, Driver, DriverArgs, opts::PruneOpts};
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use clap::Args;
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use indicatif::ProgressBar;
|
use indicatif::ProgressBar;
|
||||||
use log::{debug, trace};
|
use log::{debug, trace};
|
||||||
use miette::{bail, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, bail};
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use crate::{commands::build::BuildCommand, rpm_ostree_status::RpmOstreeStatus};
|
use crate::{commands::build::BuildCommand, rpm_ostree_status::RpmOstreeStatus};
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ use bon::Builder;
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use log::{debug, info, trace};
|
use log::{debug, info, trace};
|
||||||
use miette::{bail, miette, Context, IntoDiagnostic, Report};
|
use miette::{Context, IntoDiagnostic, Report, bail, miette};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use schema_validator::SchemaValidator;
|
use schema_validator::SchemaValidator;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ use bon::bon;
|
||||||
use jsonschema::paths::LocationSegment;
|
use jsonschema::paths::LocationSegment;
|
||||||
use miette::SourceSpan;
|
use miette::SourceSpan;
|
||||||
use yaml_rust2::{
|
use yaml_rust2::{
|
||||||
|
Event,
|
||||||
parser::{MarkedEventReceiver, Parser},
|
parser::{MarkedEventReceiver, Parser},
|
||||||
scanner::Marker,
|
scanner::Marker,
|
||||||
Event,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
|
|
@ -147,7 +147,7 @@ where
|
||||||
return Err(YamlSpanError::ExpectIndexFoundKey {
|
return Err(YamlSpanError::ExpectIndexFoundKey {
|
||||||
key: key.to_owned(),
|
key: key.to_owned(),
|
||||||
index,
|
index,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
(Event::SequenceStart(_, _), LocationSegment::Index(index)) => {
|
(Event::SequenceStart(_, _), LocationSegment::Index(index)) => {
|
||||||
break self.sequence(index, 0);
|
break self.sequence(index, 0);
|
||||||
|
|
@ -159,7 +159,7 @@ where
|
||||||
self.skip_mapping(marker.index());
|
self.skip_mapping(marker.index());
|
||||||
}
|
}
|
||||||
(Event::MappingEnd, _) => {
|
(Event::MappingEnd, _) => {
|
||||||
return Err(YamlSpanError::EndOfMapNoKey(expected_key.to_string()))
|
return Err(YamlSpanError::EndOfMapNoKey(expected_key.to_string()));
|
||||||
}
|
}
|
||||||
event => unreachable!("{event:?}"),
|
event => unreachable!("{event:?}"),
|
||||||
}
|
}
|
||||||
|
|
@ -265,7 +265,7 @@ where
|
||||||
return Err(YamlSpanError::UnexpectedScalar {
|
return Err(YamlSpanError::UnexpectedScalar {
|
||||||
value: value.to_owned(),
|
value: value.to_owned(),
|
||||||
segment: segment.to_string(),
|
segment: segment.to_string(),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
(Event::MappingStart(_, _), Some(LocationSegment::Property(key))) => {
|
(Event::MappingStart(_, _), Some(LocationSegment::Property(key))) => {
|
||||||
self.key(LocationSegment::Property(key))?
|
self.key(LocationSegment::Property(key))?
|
||||||
|
|
@ -290,7 +290,7 @@ where
|
||||||
mod test {
|
mod test {
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use miette::{miette, LabeledSpan};
|
use miette::{LabeledSpan, miette};
|
||||||
use rstest::rstest;
|
use rstest::rstest;
|
||||||
|
|
||||||
use crate::commands::validate::location::Location;
|
use crate::commands::validate::location::Location;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::{borrow::Cow, path::Path};
|
||||||
|
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use log::trace;
|
use log::trace;
|
||||||
use miette::{bail, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, bail};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
|
|
@ -208,18 +208,22 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_booted_image() {
|
fn test_booted_image() {
|
||||||
assert!(create_image_status()
|
assert!(
|
||||||
.booted_image()
|
create_image_status()
|
||||||
.expect("Contains image")
|
.booted_image()
|
||||||
.ends_with("cli/test"));
|
.expect("Contains image")
|
||||||
|
.ends_with("cli/test")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_staged_image() {
|
fn test_staged_image() {
|
||||||
assert!(create_archive_staged_status()
|
assert!(
|
||||||
.staged_image()
|
create_archive_staged_status()
|
||||||
.expect("Contains image")
|
.staged_image()
|
||||||
.ends_with(&format!("cli_test.{ARCHIVE_SUFFIX}")));
|
.expect("Contains image")
|
||||||
|
.ends_with(&format!("cli_test.{ARCHIVE_SUFFIX}"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
@ -230,8 +234,10 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_is_booted_archive() {
|
fn test_is_booted_archive() {
|
||||||
assert!(!create_archive_status()
|
assert!(
|
||||||
.is_booted_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}"))));
|
!create_archive_status()
|
||||||
|
.is_booted_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}")))
|
||||||
|
);
|
||||||
assert!(create_archive_status().is_booted_on_archive(
|
assert!(create_archive_status().is_booted_on_archive(
|
||||||
Path::new(LOCAL_BUILD).join(format!("cli_test.{ARCHIVE_SUFFIX}"))
|
Path::new(LOCAL_BUILD).join(format!("cli_test.{ARCHIVE_SUFFIX}"))
|
||||||
));
|
));
|
||||||
|
|
@ -239,8 +245,10 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_is_staged_archive() {
|
fn test_is_staged_archive() {
|
||||||
assert!(!create_archive_staged_status()
|
assert!(
|
||||||
.is_staged_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}"))));
|
!create_archive_staged_status()
|
||||||
|
.is_staged_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}")))
|
||||||
|
);
|
||||||
assert!(create_archive_staged_status().is_staged_on_archive(
|
assert!(create_archive_staged_status().is_staged_on_archive(
|
||||||
Path::new(LOCAL_BUILD).join(format!("cli_test.{ARCHIVE_SUFFIX}"))
|
Path::new(LOCAL_BUILD).join(format!("cli_test.{ARCHIVE_SUFFIX}"))
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::{borrow::Cow, fs, path::Path, process};
|
||||||
|
|
||||||
use blue_build_recipe::{MaybeVersion, Recipe};
|
use blue_build_recipe::{MaybeVersion, Recipe};
|
||||||
use blue_build_utils::constants::{
|
use blue_build_utils::constants::{
|
||||||
CONFIG_PATH, CONTAINERFILES_PATH, CONTAINER_FILE, COSIGN_PUB_PATH, FILES_PATH,
|
CONFIG_PATH, CONTAINER_FILE, CONTAINERFILES_PATH, COSIGN_PUB_PATH, FILES_PATH,
|
||||||
};
|
};
|
||||||
use bon::Builder;
|
use bon::Builder;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
|
@ -102,7 +102,9 @@ fn print_containerfile(containerfile: &str) -> String {
|
||||||
let path = if containerfiles_path.exists() && containerfiles_path.is_dir() {
|
let path = if containerfiles_path.exists() && containerfiles_path.is_dir() {
|
||||||
containerfiles_path.join(format!("{containerfile}/{CONTAINER_FILE}"))
|
containerfiles_path.join(format!("{containerfile}/{CONTAINER_FILE}"))
|
||||||
} else {
|
} else {
|
||||||
warn!("Use of {CONFIG_PATH} is deprecated for the containerfile module, please move your containerfile directories into {CONTAINERFILES_PATH}");
|
warn!(
|
||||||
|
"Use of {CONFIG_PATH} is deprecated for the containerfile module, please move your containerfile directories into {CONTAINERFILES_PATH}"
|
||||||
|
);
|
||||||
legacy_path.join(format!("containerfiles/{containerfile}/{CONTAINER_FILE}"))
|
legacy_path.join(format!("containerfiles/{containerfile}/{CONTAINER_FILE}"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -131,7 +133,9 @@ fn config_dir_exists() -> bool {
|
||||||
let exists = path.exists() && path.is_dir();
|
let exists = path.exists() && path.is_dir();
|
||||||
|
|
||||||
if exists {
|
if exists {
|
||||||
warn!("Use of the {CONFIG_PATH} directory is deprecated. Please move your non-recipe files into {FILES_PATH}");
|
warn!(
|
||||||
|
"Use of the {CONFIG_PATH} directory is deprecated. Please move your non-recipe files into {FILES_PATH}"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
exists
|
exists
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use syntect::dumps;
|
use syntect::dumps;
|
||||||
use syntect::parsing::syntax_definition::SyntaxDefinition;
|
|
||||||
use syntect::parsing::SyntaxSetBuilder;
|
use syntect::parsing::SyntaxSetBuilder;
|
||||||
|
use syntect::parsing::syntax_definition::SyntaxDefinition;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut ssb = SyntaxSetBuilder::new();
|
let mut ssb = SyntaxSetBuilder::new();
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,9 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option<CommandOutput
|
||||||
}
|
}
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
log::warn!("Executing command {:?} timed out.", cmd.get_program());
|
log::warn!("Executing command {:?} timed out.", cmd.get_program());
|
||||||
log::warn!("You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing.");
|
log::warn!(
|
||||||
|
"You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing."
|
||||||
|
);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,15 @@ use std::{
|
||||||
|
|
||||||
use base64::prelude::*;
|
use base64::prelude::*;
|
||||||
use blake2::{
|
use blake2::{
|
||||||
digest::{Update, VariableOutput},
|
|
||||||
Blake2bVar,
|
Blake2bVar,
|
||||||
|
digest::{Update, VariableOutput},
|
||||||
};
|
};
|
||||||
use cached::proc_macro::once;
|
use cached::proc_macro::once;
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
use comlexr::cmd;
|
use comlexr::cmd;
|
||||||
use format_serde_error::SerdeError;
|
use format_serde_error::SerdeError;
|
||||||
use log::{trace, warn};
|
use log::{trace, warn};
|
||||||
use miette::{miette, Context, IntoDiagnostic, Result};
|
use miette::{Context, IntoDiagnostic, Result, miette};
|
||||||
|
|
||||||
use crate::constants::CONTAINER_FILE;
|
use crate::constants::CONTAINER_FILE;
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@ where
|
||||||
warn!("Failed operation, will retry {retries} more time(s). Error:\n{e:?}");
|
warn!("Failed operation, will retry {retries} more time(s). Error:\n{e:?}");
|
||||||
thread::sleep(Duration::from_secs(delay_secs));
|
thread::sleep(Duration::from_secs(delay_secs));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::str::FromStr;
|
||||||
|
|
||||||
use miette::bail;
|
use miette::bail;
|
||||||
use semver::Prerelease;
|
use semver::Prerelease;
|
||||||
use serde::{de::Error, Deserialize, Serialize};
|
use serde::{Deserialize, Serialize, de::Error};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
pub struct Version(semver::Version);
|
pub struct Version(semver::Version);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use clap::ValueEnum;
|
use clap::ValueEnum;
|
||||||
use log::trace;
|
use log::trace;
|
||||||
use miette::{miette, IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result, miette};
|
||||||
use serde::ser::Serialize;
|
use serde::ser::Serialize;
|
||||||
use syntect::{dumps, easy::HighlightLines, highlighting::ThemeSet, parsing::SyntaxSet};
|
use syntect::{dumps, easy::HighlightLines, highlighting::ThemeSet, parsing::SyntaxSet};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use std::{
|
||||||
thread::{self, ThreadId},
|
thread::{self, ThreadId},
|
||||||
};
|
};
|
||||||
|
|
||||||
use miette::{miette, Result};
|
use miette::{Result, miette};
|
||||||
|
|
||||||
use crate::string;
|
use crate::string;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue