Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import (
"errors"
"fmt"
cargocommand "github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo"

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / go / Go tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / evidence / Evidence tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / script / Script tests (ubuntu-24.04)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / oidc / OIDC tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / distribution / Distribution tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / podman / Podman tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / ghost-frog / Ghost Frog tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / script / Script tests (macos-latest)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / evidence / Evidence tests (macos)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / distribution / Distribution tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / oidc / OIDC tests (macos)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / distribution / Distribution tests (macos)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / go / Go tests (macos)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / script / Script tests (ubuntu-22.04)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / go / Go tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / oidc / OIDC tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / script / Script tests (macos-14)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / ghost-frog / Ghost Frog tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / evidence / Evidence tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / transfer / artifactory-6

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / script / Script tests (windows-2022)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / docker / Docker tests (ubuntu, containerd-snapshotter=true)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / docker / Docker tests (ubuntu, containerd-snapshotter=false)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / gradle / ubuntu-gradle-8.3

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / artifactory / artifactoryProject ubuntu

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / alpine / Alpine APK tests (v3.20)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / access / Access tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv ubuntu py3.11.5 uv0.6.17

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / lifecycle / Lifecycle tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / helm / Helm tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / conan / Conan tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv ubuntu py3.11.5 uvlatest

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / nix / Nix tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / transfer / Transfer tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / agent-plugins / agent-plugins ubuntu

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / pnpm / pnpm 10 tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / plugins / Plugins tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / npm / npm tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / artifactory / artifactory ubuntu

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / gradle / ubuntu-gradle-5.6.4

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / python / pipenv ubuntu

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / maven / Maven tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / alpine / Alpine APK tests (v3.19)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / huggingface / HuggingFace tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv ubuntu py3.x uvlatest

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv ubuntu py3.x uv0.6.17

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / alpine / Alpine APK tests (v3.18)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / alpine / Alpine APK tests (v3.21)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / poetry / poetry ubuntu

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / python / pip ubuntu

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / nuget / NuGet tests (ubuntu)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / transfer / Transfer tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / python / pipenv windows

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / access / Access tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / agent-plugins / agent-plugins windows

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / lifecycle / Lifecycle tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / gradle / windows-gradle-8.3

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / helm / Helm tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / conan / Conan tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / huggingface / HuggingFace tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / maven / Maven tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv windows py3.x uv0.6.17

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / npm / npm tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / artifactory / artifactoryProject windows

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / gradle / windows-gradle-5.6.4

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / artifactory / artifactory windows

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / poetry / poetry windows

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / nuget / NuGet tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv windows py3.x uvlatest

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv windows py3.11.5 uvlatest

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / uv / uv windows py3.11.5 uv0.6.17

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / plugins / Plugins tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / pnpm / pnpm 10 tests (windows)

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:

Check failure on line 6 in buildtools/cli.go

View workflow job for this annotation

GitHub Actions / python / pip windows

no required module provides package github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/cargo; to add it:
conancommand "github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/conan"
nixcommand "github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/nix"
"io/fs"
Expand Down Expand Up @@ -53,6 +54,7 @@
terraformdocs "github.com/jfrog/jfrog-cli/docs/artifactory/terraform"
"github.com/jfrog/jfrog-cli/docs/artifactory/terraformconfig"
twinedocs "github.com/jfrog/jfrog-cli/docs/artifactory/twine"
cargo "github.com/jfrog/jfrog-cli/docs/buildtools/cargo"
"github.com/jfrog/jfrog-cli/docs/buildtools/conan"
"github.com/jfrog/jfrog-cli/docs/buildtools/conanconfig"
"github.com/jfrog/jfrog-cli/docs/buildtools/docker"
Expand Down Expand Up @@ -417,6 +419,19 @@
Category: buildToolsCategory,
Action: ConanCmd,
},
{
Name: "cargo",
Hidden: false,
Flags: cliutils.GetCommandFlags(cliutils.Cargo),
Usage: corecommon.ResolveDescription(cargo.GetDescription(), cargo.GetAIDescription()),
HelpName: corecommon.CreateUsage("cargo", corecommon.ResolveDescription(cargo.GetDescription(), cargo.GetAIDescription()), cargo.Usage),
UsageText: cargo.GetArguments(),
ArgsUsage: common.CreateEnvVars(),
SkipFlagParsing: true,
BashComplete: corecommon.CreateBashCompletionFunc(),
Category: buildToolsCategory,
Action: CargoCmd,
},
{
Name: "nix",
Hidden: false,
Expand Down Expand Up @@ -2071,6 +2086,39 @@
return commands.ExecWithPackageManager(conanCommand, project.Conan.String())
}

func CargoCmd(c *cli.Context) error {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
}
if c.NArg() < 1 {
return cliutils.WrongNumberOfArgumentsHandler(c)
}

args := cliutils.ExtractCommand(c)

args, serverID, err := coreutils.ExtractServerIdFromCommand(args)
if err != nil {
return fmt.Errorf("failed to extract server ID: %w", err)
}
serverDetails, err := coreConfig.GetSpecificConfig(serverID, true, false)
if err != nil {
return err
}

filteredArgs, buildConfiguration, err := build.ExtractBuildDetailsFromArgs(args)
if err != nil {
return err
}

cmdName, cargoArgs := getCommandName(filteredArgs)

cargoCommand := cargocommand.NewCargoCommand().
SetCommandName(cmdName).SetArgs(cargoArgs).
SetBuildConfiguration(buildConfiguration).SetServerDetails(serverDetails)

return commands.ExecWithPackageManager(cargoCommand, "cargo")
}

func NixCmd(c *cli.Context) error {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
Expand Down
Loading
Loading