Skip to content

Commit

Permalink
Todos
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkovAlexander committed Aug 10, 2023
1 parent cab8185 commit c59d286
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions anytree-cli/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ pub fn build(sbom_path: impl AsRef<Path>, cache: Option<impl AsRef<str>>) -> any
serde_json::from_reader(File::open(sbom_path.as_ref())?)?;

let container_name = if let Some(run_dir) = cache {
// TODO: remove container with such name if it is not running otherwise throw error
//docker ps -qf "name=anytree-builder-d5badd63-06bc-4db5-bfa4-165be65d4cde"
run_dir.as_ref().to_string()
} else {
let container_uuid = Uuid::new_v4().to_string();
// TODO: use not random uuid, but some hash of sbom to use caching
format!("anytree-builder-{}", container_uuid)
};
println!(
Expand Down
1 change: 1 addition & 0 deletions anytree-plugin-cargo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub fn build(
if let Some(base) = base_image {
docker_cmd.arg(base);
} else {
// TODO: remove default image it MUST be specified in SBOM with hashes
docker_cmd.arg(CONTAINER_BASE);
}
docker_cmd.arg("sh").arg("-c");
Expand Down
18 changes: 0 additions & 18 deletions hack/cargo_sbom.cdx.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@
"component": {
"type": "application",
"name": "anytree-test-project",
"hashes": [
{
"alg": "MD5",
"content": "c7081de77f448f47e0c0e5b4086ceb55"
},
{
"alg": "SHA-1",
"content": "f86b497593e126bf015a4a1881a3f4fefa70dd29"
},
{
"alg": "SHA-256",
"content": "f2207fff71916597e2d39c4bf93346ff08b4e1ad42ec0d4bb2fb56c4c784c4e2"
},
{
"alg": "SHA-512",
"content": "c81f2259a1508819f2e6fd1a57a1d05937a4c72a03ba33db0eef234aa42033ea90a0de63ec88c833719718e1b097f21084a3605b8986f2b261d5c5278cb9bda2"
}
],
"properties": [
{
"name": "platform",
Expand Down

0 comments on commit c59d286

Please sign in to comment.