|
10 | 10 | import java.util.Map; |
11 | 11 | import java.util.Optional; |
12 | 12 |
|
13 | | -import org.cyclonedx.exception.ParseException; |
14 | | -import org.cyclonedx.parsers.JsonParser; |
15 | | -import org.cyclonedx.parsers.Parser; |
16 | | - |
17 | 13 | import com.google.cloud.tools.jib.api.Credential; |
18 | 14 | import com.google.cloud.tools.jib.api.ImageReference; |
19 | 15 | import com.google.cloud.tools.jib.api.InvalidImageReferenceException; |
@@ -52,9 +48,6 @@ enum DownloadSelection { |
52 | 48 | @CommandLine.Option(names = "-a", description = "The build to view, specified by RebuiltArtifact name", completionCandidates = RebuildCompleter.class) |
53 | 49 | String artifact; |
54 | 50 |
|
55 | | - @CommandLine.Option(names = "-s", description = "Path to an sbom to download all referenced artifacts", completionCandidates = RebuildCompleter.class) |
56 | | - File sBom; |
57 | | - |
58 | 51 | @CommandLine.Option(names = "-d", description = "Download directory to use. Defaults to current directory") |
59 | 52 | File targetDirectory = new File(System.getProperty("user.dir")); |
60 | 53 |
|
@@ -86,30 +79,6 @@ public void run() { |
86 | 79 | } else { |
87 | 80 | System.out.println("Unable to find " + artifact + " in list of artifacts"); |
88 | 81 | } |
89 | | - } else if (sBom != null) { |
90 | | - if (!sBom.exists()) { |
91 | | - System.out.println("Unable to find sbom " + sBom); |
92 | | - } else { |
93 | | - try { |
94 | | - Parser parser = new JsonParser(); |
95 | | - parser.parse(sBom).getComponents().forEach(c -> { |
96 | | - String gav = c.getGroup() + ":" + c.getName() + ":" + c.getVersion(); |
97 | | - Optional<RebuiltArtifact> rebuilt = builds.values().stream() |
98 | | - .filter(b -> b.getSpec().getGav().equals(gav)).findFirst(); |
99 | | - if (rebuilt.isPresent()) { |
100 | | - try { |
101 | | - downloadImage(rebuilt.get().getSpec()); |
102 | | - } catch (IOException e) { |
103 | | - throw new RuntimeException(e); |
104 | | - } |
105 | | - } else { |
106 | | - System.out.println("Unable to find " + gav + " in list of artifacts"); |
107 | | - } |
108 | | - }); |
109 | | - } catch (ParseException e) { |
110 | | - throw new RuntimeException(e); |
111 | | - } |
112 | | - } |
113 | 82 | } |
114 | 83 | } catch (IOException e) { |
115 | 84 | throw new RuntimeException(e); |
|
0 commit comments