Skip to content

Commit

Permalink
fix: patch sbom generation.
Browse files Browse the repository at this point in the history
Docker is not necessary.
  • Loading branch information
wilderlopes committed Mar 11, 2024
1 parent e75fda7 commit 13a842d
Show file tree
Hide file tree
Showing 4 changed files with 635 additions and 8 deletions.
8 changes: 5 additions & 3 deletions miniogre/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,11 @@ def create_sbom(image_name, project_path, format, verbose = False):
elif format == 'pip-licenses':
sbom_format_cmd = "pip-licenses --with-authors --with-maintainers --with-urls --with-description -l --format json --output-file ./ogre_dir/sbom.json"

sbom_cmd = (
" docker run -d --rm -v {}:/opt/{} --name {}_sbom {} bash -c '{}; wait'".format(project_path, project_name, container_name, image_name, sbom_format_cmd)
)
# sbom_cmd = (
# " docker run -d --rm -v {}:/opt/{} --name {}_sbom {} bash -c '{}; wait'".format(project_path, project_name, container_name, image_name, sbom_format_cmd)
# )
sbom_cmd = sbom_format_cmd

if verbose:
stderr = None
print(sbom_cmd)
Expand Down
6 changes: 3 additions & 3 deletions miniogre/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def run(provider: str = 'openai',
requirements_fullpath = save_requirements(final_requirements, ogre_dir_path)
config_bashrc(project_path, ogre_dir_path, None, None, None)
config_dockerfile(project_path, project_name, ogre_dir_path, baseimage, dry)
build_docker_image(os.path.join(ogre_dir_path, "Dockerfile"), project_name, verbose)
create_sbom(project_name, project_path, sbom_format, verbose)
end_emoji()
if no_container == False:
build_docker_image(os.path.join(ogre_dir_path, "Dockerfile"), project_name, verbose)
spin_up_container(project_name, project_path, port)

end_emoji()

if __name__ == '__main__':
app()
Loading

0 comments on commit 13a842d

Please sign in to comment.