tricks/scripts/generate-scan-report
Elia el Lazkani f2b4f86269
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
chore(): Migrating to testing python automation
2023-07-05 23:01:39 +02:00

26 lines
590 B
Python
Executable file

#!/usr/bin/env python
import sys
from args import argument_parse
from oras import Oras
from trivy import Trivy
def main():
args = argument_parse()
trivy = Trivy(args.image, args.tag)
scan = trivy.full_scan(image_src="remote")
if not scan:
sys.exit(1)
print("Full scan successful...")
print("Attaching CycloneDX report to container...")
oras = Oras(args.image, args.tag)
cdx = oras.post_attached_file(git_tag=args.git_tag)
oras.clean_downloaded_file()
if not cdx:
sys.exit(1)
sys.exit(0)
if __name__ == '__main__':
main()