Skip to content

Commit

Permalink
Allow passing in an extra TUF manifest (#6595)
Browse files Browse the repository at this point in the history
It's sometimes useful to be able to add extra artifacts to a TUF repo,
especially when testing hubris related changes. Add an option to releng
to take an extra manifest to be merged in.
  • Loading branch information
labbott authored Sep 18, 2024
1 parent 18b8ab3 commit 178c3f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dev-tools/releng/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ struct Args {
/// Build the helios OS image from local sources.
#[clap(long)]
helios_local: bool,

/// Extra manifest to be merged with the rest of the repo
#[clap(long)]
extra_manifest: Option<Utf8PathBuf>,
}

impl Args {
Expand Down Expand Up @@ -592,6 +596,7 @@ async fn main() -> Result<()> {
args.output_dir.clone(),
version,
manifest,
args.extra_manifest,
),
)
.after("tuf-stamp")
Expand Down
9 changes: 9 additions & 0 deletions dev-tools/releng/src/tuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub(crate) async fn build_tuf_repo(
output_dir: Utf8PathBuf,
version: Version,
package_manifest: Arc<Config>,
extra_manifest: Option<Utf8PathBuf>,
) -> Result<()> {
// We currently go about this somewhat strangely; the old release
// engineering process produced a Tufaceous manifest, and (the now very many
Expand All @@ -58,6 +59,14 @@ pub(crate) async fn build_tuf_repo(
manifest.artifacts.entry(kind).or_default().extend(artifacts);
}

if let Some(path) = extra_manifest {
let m = DeserializedManifest::from_path(&path)
.context("failed to open extra manifest")?;
for (kind, artifacts) in m.artifacts {
manifest.artifacts.entry(kind).or_default().extend(artifacts);
}
}

// Add the OS images.
manifest.artifacts.insert(
KnownArtifactKind::Host,
Expand Down

0 comments on commit 178c3f4

Please sign in to comment.