feat(iso): Create generate-iso command (#192)
## Tasks - [x] Add ctrl-c handler to kill spawned children - [x] add more args to support all variables - [x] Add integration test
This commit is contained in:
parent
4634f40840
commit
e6cce3d542
25 changed files with 737 additions and 201 deletions
|
|
@ -93,15 +93,15 @@ impl GenerateCommand {
|
|||
});
|
||||
|
||||
debug!("Deserializing recipe");
|
||||
let recipe_de = Recipe::parse(&recipe_path)?;
|
||||
trace!("recipe_de: {recipe_de:#?}");
|
||||
let recipe = Recipe::parse(&recipe_path)?;
|
||||
trace!("recipe_de: {recipe:#?}");
|
||||
|
||||
if self.display_full_recipe {
|
||||
if let Some(output) = self.output.as_ref() {
|
||||
std::fs::write(output, serde_yaml::to_string(&recipe_de).into_diagnostic()?)
|
||||
std::fs::write(output, serde_yaml::to_string(&recipe).into_diagnostic()?)
|
||||
.into_diagnostic()?;
|
||||
} else {
|
||||
syntax_highlighting::print_ser(&recipe_de, "yml", self.syntax_theme)?;
|
||||
syntax_highlighting::print_ser(&recipe, "yml", self.syntax_theme)?;
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
|
@ -109,9 +109,9 @@ impl GenerateCommand {
|
|||
info!("Templating for recipe at {}", recipe_path.display());
|
||||
|
||||
let template = ContainerFileTemplate::builder()
|
||||
.os_version(Driver::get_os_version(&recipe_de)?)
|
||||
.os_version(Driver::get_os_version(&recipe.base_image_ref()?)?)
|
||||
.build_id(Driver::get_build_id())
|
||||
.recipe(&recipe_de)
|
||||
.recipe(&recipe)
|
||||
.recipe_path(recipe_path.as_path())
|
||||
.registry(Driver::get_registry()?)
|
||||
.repo(Driver::get_repo_url()?)
|
||||
|
|
@ -142,7 +142,3 @@ impl GenerateCommand {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
// ======================================================== //
|
||||
// ========================= Helpers ====================== //
|
||||
// ======================================================== //
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue