jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
535 stars 234 forks source link

Add a flag to export the output of jf audit command in a file. #2169

Open shashwathrai opened 1 year ago

shashwathrai commented 1 year ago

Is your feature request related to a problem? Please describe. Add a flag to export the output of jf audit command in a file. From the command line, we can export the output to a file using the > command. However in the Jenkins pipeline script to run the command within sh we need to provide the actual path of the JFrog CLI installation. For example: sh "/Users/shashwathr/.jenkins/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jf/jf audit xxx > $WORKSPACE/audit-report.json"

Describe the solution you'd like to see Any flag to export the data into a file within JFrog CLI.

Describe alternatives you've considered We can provide the actual path of the JFrog CLI installation.

tim-goto commented 3 months ago

This would be useful not only for the audit subcommand but any command really.. especially in the context of the new jfrog jenkins plugin I could not find a way to reliably parse the output of the jf command (piping to file doesn't work since you need to run the commands in the jf step not in a sh, tee also writes the summary line, ...)