Skip to content

Commit

Permalink
Merge branch 'dev' into florianbehrens-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbehrens authored Nov 17, 2024
2 parents 8ed9c58 + 681bbc8 commit c374d05
Show file tree
Hide file tree
Showing 17 changed files with 153 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ node("docker-ubuntu20-xlarge") {
repo = 'jfrog-cli'
sh 'rm -rf temp'
sh 'mkdir temp'
def goRoot = tool 'go-1.23.2'
def goRoot = tool 'go-1.23.3'
env.GOROOT="$goRoot"
env.PATH+=":${goRoot}/bin:/tmp/node-${nodeVersion}-linux-x64/bin"
env.GO111MODULE="on"
Expand Down
28 changes: 28 additions & 0 deletions artifactory/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package artifactory
import (
"errors"
"fmt"
"github.com/jfrog/jfrog-cli/docs/artifactory/cocoapodsconfig"
"github.com/jfrog/jfrog-cli/docs/artifactory/swiftconfig"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -406,6 +408,32 @@ func GetCommands() []cli.Command {
return cliutils.RunNativeCmdWithDeprecationWarning("gradle", project.Gradle, c, buildtools.GradleCmd)
},
},
{
Name: "cocoapods-config",
Hidden: true,
Aliases: []string{"cocoapodsc"},
Flags: cliutils.GetCommandFlags(cliutils.CocoapodsConfig),
Usage: gradleconfig.GetDescription(),
HelpName: corecommon.CreateUsage("rt cocoapods-config", cocoapodsconfig.GetDescription(), cocoapodsconfig.Usage),
ArgsUsage: common.CreateEnvVars(),
BashComplete: corecommon.CreateBashCompletionFunc(),
Action: func(c *cli.Context) error {
return cliutils.RunConfigCmdWithDeprecationWarning("cocoapodsc", "rt", project.Cocoapods, c, cliutils.CreateConfigCmd)
},
},
{
Name: "swift-config",
Hidden: true,
Aliases: []string{"swiftc"},
Flags: cliutils.GetCommandFlags(cliutils.SwiftConfig),
Usage: gradleconfig.GetDescription(),
HelpName: corecommon.CreateUsage("rt swift-config", swiftconfig.GetDescription(), swiftconfig.Usage),
ArgsUsage: common.CreateEnvVars(),
BashComplete: corecommon.CreateBashCompletionFunc(),
Action: func(c *cli.Context) error {
return cliutils.RunConfigCmdWithDeprecationWarning("swiftc", "rt", project.Swift, c, cliutils.CreateConfigCmd)
},
},
{
Name: "docker-promote",
Flags: cliutils.GetCommandFlags(cliutils.DockerPromote),
Expand Down
2 changes: 1 addition & 1 deletion build/docker/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG repo_name_21
# Remove ${repo_name_21} to pull from Docker Hub.
FROM ${repo_name_21}/jfrog-docker/golang:1.23.2-alpine as builder
FROM ${repo_name_21}/jfrog-docker/golang:1.23.3-alpine as builder
ARG image_name=jfrog-cli
ARG cli_executable_name
WORKDIR /${image_name}
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2-jf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2-jf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2-jf",
"version": "2.71.2",
"version": "2.71.4",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2",
"version": "2.71.2",
"version": "2.71.4",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
55 changes: 42 additions & 13 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func pullCmd(c *cli.Context, image string) error {
if show, err := cliutils.ShowGenericCmdHelpIfNeeded(c, c.Args(), "dockerpullhelp"); show || err != nil {
return err
}
_, rtDetails, _, skipLogin, filteredDockerArgs, buildConfiguration, err := commandsUtils.ExtractDockerOptionsFromArgs(c.Args())
_, rtDetails, _, skipLogin, filteredDockerArgs, buildConfiguration, err := extractDockerOptionsFromArgs(c.Args())
if err != nil {
return err
}
Expand All @@ -761,7 +761,7 @@ func pushCmd(c *cli.Context, image string) (err error) {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
}
threads, rtDetails, detailedSummary, skipLogin, filteredDockerArgs, buildConfiguration, err := commandsUtils.ExtractDockerOptionsFromArgs(c.Args())
threads, rtDetails, detailedSummary, skipLogin, filteredDockerArgs, buildConfiguration, err := extractDockerOptionsFromArgs(c.Args())
if err != nil {
return
}
Expand Down Expand Up @@ -794,14 +794,42 @@ func dockerNativeCmd(c *cli.Context) error {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
}
_, _, _, _, cleanArgs, _, err := commandsUtils.ExtractDockerOptionsFromArgs(c.Args())
_, _, _, _, cleanArgs, _, err := extractDockerOptionsFromArgs(c.Args())
if err != nil {
return err
}
cm := containerutils.NewManager(containerutils.DockerClient)
return cm.RunNativeCmd(cleanArgs)
}

// Remove all the none docker CLI flags from args.
func extractDockerOptionsFromArgs(args []string) (threads int, serverDetails *coreConfig.ServerDetails, detailedSummary, skipLogin bool, cleanArgs []string, buildConfig *build.BuildConfiguration, err error) {
cleanArgs = append([]string(nil), args...)
var serverId string
cleanArgs, serverId, err = coreutils.ExtractServerIdFromCommand(cleanArgs)
if err != nil {
return
}
serverDetails, err = coreConfig.GetSpecificConfig(serverId, true, true)
if err != nil {
return
}
cleanArgs, threads, err = coreutils.ExtractThreadsFromArgs(cleanArgs, 3)
if err != nil {
return
}
cleanArgs, detailedSummary, err = coreutils.ExtractDetailedSummaryFromArgs(cleanArgs)
if err != nil {
return
}
cleanArgs, skipLogin, err = coreutils.ExtractSkipLoginFromArgs(cleanArgs)
if err != nil {
return
}
cleanArgs, buildConfig, err = build.ExtractBuildDetailsFromArgs(cleanArgs)
return
}

// Assuming command name is the first argument that isn't a flag.
// Returns the command name, and the filtered arguments slice without it.
func getCommandName(orgArgs []string) (string, []string) {
Expand Down Expand Up @@ -933,19 +961,20 @@ func pythonCmd(c *cli.Context, projectType project.ProjectType) error {
cmdName, filteredArgs := getCommandName(orgArgs)
switch projectType {
case project.Pip:
pythonCommand := python.NewPipCommand()
pythonCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pythonCommand)
pipCommand := python.NewPipCommand()
pipCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pipCommand)
case project.Pipenv:
pythonCommand := python.NewPipenvCommand()
pythonCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pythonCommand)
pipenvCommand := python.NewPipenvCommand()
pipenvCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pipenvCommand)
case project.Poetry:
pythonCommand := python.NewPoetryCommand()
pythonCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(pythonCommand)
poetryCommand := python.NewPoetryCommand()
poetryCommand.SetServerDetails(rtDetails).SetRepo(pythonConfig.TargetRepo()).SetCommandName(cmdName).SetArgs(filteredArgs)
return commands.Exec(poetryCommand)
default:
return errorutils.CheckErrorf("%s is not supported", projectType)
}
return errorutils.CheckErrorf("%s is not supported", projectType)
}

func terraformCmd(c *cli.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion config/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func addOrEdit(c *cli.Context, operation configOperation) error {
}
configCmd := commands.NewConfigCommand(commands.AddOrEdit, serverId).SetDetails(configCommandConfiguration.ServerDetails).SetInteractive(configCommandConfiguration.Interactive).
SetEncPassword(configCommandConfiguration.EncPassword).SetUseBasicAuthOnly(configCommandConfiguration.BasicAuthOnly)
return configCmd.Run()
return configCmd.ExecAndReportUsage()
}

func showCmd(c *cli.Context) error {
Expand Down
7 changes: 7 additions & 0 deletions docs/artifactory/cocoapodsconfig/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package cocoapodsconfig

var Usage = []string{"rt cocoapods-config [command options]"}

func GetDescription() string {
return "Generate cocoapods build configuration."
}
7 changes: 7 additions & 0 deletions docs/artifactory/swiftconfig/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package swiftconfig

var Usage = []string{"rt swift-config [command options]"}

func GetDescription() string {
return "Generate swift build configuration."
}
20 changes: 0 additions & 20 deletions general/invite/invite.go

This file was deleted.

36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jfrog/jfrog-cli

go 1.23.2
go 1.23.3

replace (
// Should not be updated to 0.2.6 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372)
Expand All @@ -16,20 +16,20 @@ require (
github.com/docker/docker v27.3.1+incompatible
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1
github.com/jfrog/archiver/v3 v3.6.1
github.com/jfrog/build-info-go v1.10.3
github.com/jfrog/build-info-go v1.10.5
github.com/jfrog/gofrog v1.7.6
github.com/jfrog/jfrog-cli-artifactory v0.1.6
github.com/jfrog/jfrog-cli-core/v2 v2.56.4
github.com/jfrog/jfrog-cli-core/v2 v2.56.8
github.com/jfrog/jfrog-cli-platform-services v1.4.0
github.com/jfrog/jfrog-cli-security v1.12.2
github.com/jfrog/jfrog-client-go v1.47.3
github.com/jfrog/jfrog-cli-security v1.12.5
github.com/jfrog/jfrog-client-go v1.48.0
github.com/jszwec/csvutil v1.10.0
github.com/manifoldco/promptui v0.9.0
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.34.0
github.com/urfave/cli v1.22.16
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
gopkg.in/yaml.v2 v2.4.0
)

Expand All @@ -40,7 +40,7 @@ require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/CycloneDX/cyclonedx-go v0.9.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/ProtonMail/go-crypto v1.1.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
Expand Down Expand Up @@ -71,7 +71,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v56 v56.0.0 // indirect
Expand All @@ -83,7 +83,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jedib0t/go-pretty/v6 v6.5.9 // indirect
github.com/jedib0t/go-pretty/v6 v6.6.1 // indirect
github.com/jfrog/froggit-go v1.16.2 // indirect
github.com/jfrog/jfrog-apps-config v1.0.1 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand Down Expand Up @@ -153,23 +153,23 @@ require (
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.5.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20241010143722-75cc82c172d3
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20241113152357-24197a744331

// replace github.com/jfrog/jfrog-cli-security => github.com/attiasas/jfrog-cli-security v0.0.0-20240904061406-f368939ce3a0
// replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.12.5-0.20241107141149-42cf964808a1

// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240918081224-1c584cc334c7

Expand Down
Loading

0 comments on commit c374d05

Please sign in to comment.