Skip to content

Commit

Permalink
Syft command fix (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
psig-bah authored Jul 15, 2022
1 parent 2ba88b2 commit 66a7c76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libraries/syft/steps/generate_sbom.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void call() {
// perform the syft scan
String archive_name = "${img.registry}-${img.repo}-${img.tag}.tar".replaceAll("/","-")
String results_name = "${img.repo}-${img.tag}-${raw_results_file}".replaceAll("/","-")
sh "syft ${archive_name} -o json=${results_name}"
sh "syft ${archive_name} -o json > ${results_name}"

// archive the results
archiveArtifacts artifacts: "${results_name}"
Expand Down
4 changes: 2 additions & 2 deletions libraries/syft/test/GenerateSBOMSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public class GenerateSBOMSpec extends JTEPipelineSpecification {
when:
GenerateSBOM()
then:
1 * getPipelineMock('sh').call('syft ghcr.io-boozallen-sdp-images-syft-latest.tar -o json=syft-latest-syft-sbom-results.json')
1 * getPipelineMock('sh').call('syft ghcr.io-boozallen-sdp-images-grype-latest.tar -o json=grype-latest-syft-sbom-results.json')
1 * getPipelineMock('sh').call('syft ghcr.io-boozallen-sdp-images-syft-latest.tar -o json > syft-latest-syft-sbom-results.json')
1 * getPipelineMock('sh').call('syft ghcr.io-boozallen-sdp-images-grype-latest.tar -o json > grype-latest-syft-sbom-results.json')
}

def "Archives SBOM file as expected" () {
Expand Down

0 comments on commit 66a7c76

Please sign in to comment.