From 1e4c1d7f154b6d6f5418e84167699f965005132a Mon Sep 17 00:00:00 2001 From: Andreas Hippler Date: Wed, 8 Jan 2025 10:27:31 +0100 Subject: [PATCH] create detailed summary when JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR in every command --- artifactory/cli.go | 4 ++-- buildtools/cli.go | 2 +- distribution/cli.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/artifactory/cli.go b/artifactory/cli.go index 89a8aab0c..b898677d4 100644 --- a/artifactory/cli.go +++ b/artifactory/cli.go @@ -1120,7 +1120,7 @@ func containerPushCmd(c *cli.Context, containerManagerType containerutils.Contai if err != nil { return } - printDeploymentView, detailedSummary := log.IsStdErrTerminal(), c.Bool("detailed-summary") + printDeploymentView, detailedSummary := log.IsStdErrTerminal(), cliutils.GetDetailedSummary(c) dockerPushCommand.SetThreads(threads).SetDetailedSummary(detailedSummary || printDeploymentView).SetCmdParams([]string{"push", imageTag}).SetSkipLogin(skipLogin).SetBuildConfiguration(buildConfiguration).SetRepo(targetRepo).SetServerDetails(artDetails).SetImageTag(imageTag) err = cliutils.ShowDockerDeprecationMessageIfNeeded(containerManagerType, dockerPushCommand.IsGetRepoSupported) if err != nil { @@ -1312,7 +1312,7 @@ func downloadCmd(c *cli.Context) error { return err } downloadCommand := generic.NewDownloadCommand() - downloadCommand.SetConfiguration(configuration).SetBuildConfiguration(buildConfiguration).SetSpec(downloadSpec).SetServerDetails(serverDetails).SetDryRun(c.Bool("dry-run")).SetSyncDeletesPath(c.String("sync-deletes")).SetQuiet(cliutils.GetQuietValue(c)).SetDetailedSummary(c.Bool("detailed-summary")).SetRetries(retries).SetRetryWaitMilliSecs(retryWaitTime) + downloadCommand.SetConfiguration(configuration).SetBuildConfiguration(buildConfiguration).SetSpec(downloadSpec).SetServerDetails(serverDetails).SetDryRun(c.Bool("dry-run")).SetSyncDeletesPath(c.String("sync-deletes")).SetQuiet(cliutils.GetQuietValue(c)).SetDetailedSummary(cliutils.GetDetailedSummary(c)).SetRetries(retries).SetRetryWaitMilliSecs(retryWaitTime) if downloadCommand.ShouldPrompt() && !coreutils.AskYesNo("Sync-deletes may delete some files in your local file system. Are you sure you want to continue?\n"+ "You can avoid this confirmation message by adding --quiet to the command.", false) { diff --git a/buildtools/cli.go b/buildtools/cli.go index 02eee938a..ebe48d705 100644 --- a/buildtools/cli.go +++ b/buildtools/cli.go @@ -693,7 +693,7 @@ func GoPublishCmd(c *cli.Context) (err error) { return err } version := c.Args().Get(0) - printDeploymentView, detailedSummary := log.IsStdErrTerminal(), c.Bool("detailed-summary") + printDeploymentView, detailedSummary := log.IsStdErrTerminal(), cliutils.GetDetailedSummary(c) goPublishCmd := golang.NewGoPublishCommand() goPublishCmd.SetConfigFilePath(configFilePath).SetBuildConfiguration(buildConfiguration).SetVersion(version).SetDetailedSummary(detailedSummary || printDeploymentView).SetExcludedPatterns(cliutils.GetStringsArrFlagValue(c, "exclusions")) err = commands.Exec(goPublishCmd) diff --git a/distribution/cli.go b/distribution/cli.go index 8242da2c0..ba8cc99ee 100644 --- a/distribution/cli.go +++ b/distribution/cli.go @@ -116,7 +116,7 @@ func releaseBundleCreateCmd(c *cli.Context) error { if err != nil { return err } - releaseBundleCreateCmd.SetServerDetails(dsDetails).SetReleaseBundleCreateParams(params).SetSpec(releaseBundleCreateSpec).SetDryRun(c.Bool("dry-run")).SetDetailedSummary(c.Bool("detailed-summary")) + releaseBundleCreateCmd.SetServerDetails(dsDetails).SetReleaseBundleCreateParams(params).SetSpec(releaseBundleCreateSpec).SetDryRun(c.Bool("dry-run")).SetDetailedSummary(cliutils.GetDetailedSummary(c)) err = commands.Exec(releaseBundleCreateCmd) if releaseBundleCreateCmd.IsDetailedSummary() { @@ -158,7 +158,7 @@ func releaseBundleUpdateCmd(c *cli.Context) error { if err != nil { return err } - releaseBundleUpdateCmd.SetServerDetails(dsDetails).SetReleaseBundleUpdateParams(params).SetSpec(releaseBundleUpdateSpec).SetDryRun(c.Bool("dry-run")).SetDetailedSummary(c.Bool("detailed-summary")) + releaseBundleUpdateCmd.SetServerDetails(dsDetails).SetReleaseBundleUpdateParams(params).SetSpec(releaseBundleUpdateSpec).SetDryRun(c.Bool("dry-run")).SetDetailedSummary(cliutils.GetDetailedSummary(c)) err = commands.Exec(releaseBundleUpdateCmd) if releaseBundleUpdateCmd.IsDetailedSummary() { @@ -182,7 +182,7 @@ func releaseBundleSignCmd(c *cli.Context) error { if err != nil { return err } - releaseBundleSignCmd.SetServerDetails(dsDetails).SetReleaseBundleSignParams(params).SetDetailedSummary(c.Bool("detailed-summary")) + releaseBundleSignCmd.SetServerDetails(dsDetails).SetReleaseBundleSignParams(params).SetDetailedSummary(cliutils.GetDetailedSummary(c)) err = commands.Exec(releaseBundleSignCmd) if releaseBundleSignCmd.IsDetailedSummary() { if summary := releaseBundleSignCmd.GetSummary(); summary != nil {