diff --git a/artifactory/utils/utils.go b/artifactory/utils/utils.go index 8cef7b4ff..5a5594284 100644 --- a/artifactory/utils/utils.go +++ b/artifactory/utils/utils.go @@ -34,6 +34,10 @@ import ( ioUtils "github.com/jfrog/jfrog-client-go/utils/io" ) +const ( + TimeoutEnvKey = "JFROG_CLI_REQUEST_TIMEOUT" +) + func GetProjectDir(global bool) (string, error) { configDir, err := getConfigDir(global) if err != nil { @@ -92,7 +96,8 @@ func GetEncryptedPasswordFromArtifactory(artifactoryAuth auth.ServiceDetails, in } func CreateServiceManager(serverDetails *config.ServerDetails, httpRetries, httpRetryWaitMilliSecs int, isDryRun bool) (artifactory.ArtifactoryServicesManager, error) { - return CreateServiceManagerWithContext(context.Background(), serverDetails, isDryRun, 0, httpRetries, httpRetryWaitMilliSecs, 0) + timeout, _ := time.ParseDuration(os.Getenv(TimeoutEnvKey)) + return CreateServiceManagerWithContext(context.Background(), serverDetails, isDryRun, 0, httpRetries, httpRetryWaitMilliSecs, timeout) } // Create a service manager with threads. diff --git a/lifecycle/createfromartifacts.go b/lifecycle/createfromartifacts.go index 8a2633451..80fe1cb1b 100644 --- a/lifecycle/createfromartifacts.go +++ b/lifecycle/createfromartifacts.go @@ -2,13 +2,14 @@ package lifecycle import ( "errors" + "path" + "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils" rtServicesUtils "github.com/jfrog/jfrog-client-go/artifactory/services/utils" "github.com/jfrog/jfrog-client-go/lifecycle" "github.com/jfrog/jfrog-client-go/lifecycle/services" "github.com/jfrog/jfrog-client-go/utils/io/content" "github.com/jfrog/jfrog-client-go/utils/log" - "path" ) func (rbc *ReleaseBundleCreateCommand) createFromArtifacts(lcServicesManager *lifecycle.LifecycleServicesManager,