-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
38 changed files
with
3,071 additions
and
2,943 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pre-commit | ||
black==23.3.0 | ||
isort | ||
flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
exclude: ".all-contributorsrc" | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
|
||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
language: python | ||
types: [python] | ||
entry: black | ||
|
||
- id: flake8 | ||
name: flake8 | ||
language: python | ||
types: [python] | ||
entry: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
__author__ = "Vanessa Sochat" | ||
__copyright__ = "Copyright 2022-2024, Vanessa Sochat" | ||
__license__ = "MPL 2.0" | ||
|
||
import json | ||
import os | ||
|
||
import container_guts.utils as utils | ||
|
||
from ..main import ManifestGenerator | ||
|
||
|
||
def main(args, parser, extra, subparser): | ||
# Show args to the user | ||
print(" image: %s" % args.image) | ||
print(" outfile: %s" % args.outfile) | ||
print(" outdir: %s" % args.outdir) | ||
print("container tech: %s" % args.container_tech) | ||
print(" database: %s" % args.database) | ||
|
||
# Derive an initial manifest | ||
cli = ManifestGenerator(tech=args.container_tech) | ||
manifests = cli.similar(args.image, database=args.database) | ||
outfile = None | ||
|
||
# Default to using outfile first, then outdir if defined | ||
if args.outfile: | ||
outfile = args.outfile | ||
elif args.outdir: | ||
outfile = os.path.join(args.outdir, "%s.json" % cli.save_path(args.image)) | ||
dirname = os.path.dirname(outfile) | ||
if not os.path.exists(dirname): | ||
os.makedirs(dirname) | ||
|
||
# If we have an output file, make sure to set step output | ||
if outfile: | ||
print(f"Saving to {outfile}...") | ||
print(f"::set-output name=outfile::{outfile}") | ||
utils.write_json(manifests, outfile) | ||
else: | ||
print(json.dumps(manifests, indent=4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.