Skip to content

Commit

Permalink
Add pnpm-config command (#2444)
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas authored Feb 18, 2024
1 parent 21bd9ea commit 548a18b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 10 deletions.
2 changes: 1 addition & 1 deletion artifactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ func checkIfServerIsUp(port, proxyScheme string, useClientCerts bool) error {

func TestXrayScanBuild(t *testing.T) {
initArtifactoryTest(t, "")
xrayServerPort := xray.StartXrayMockServer()
xrayServerPort := xray.StartXrayMockServer(t)
serverUrl := "--url=http://localhost:" + strconv.Itoa(xrayServerPort)
artifactoryCommandExecutor := coretests.NewJfrogCli(execMain, "jfrog rt", serverUrl+getArtifactoryTestCredentials())
assert.NoError(t, artifactoryCommandExecutor.Exec("build-scan", xray.CleanScanBuildName, "3"))
Expand Down
14 changes: 14 additions & 0 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
"github.com/jfrog/jfrog-cli/docs/buildtools/pipenvconfig"
"github.com/jfrog/jfrog-cli/docs/buildtools/pipenvinstall"
"github.com/jfrog/jfrog-cli/docs/buildtools/pipinstall"
"github.com/jfrog/jfrog-cli/docs/buildtools/pnpmconfig"
"github.com/jfrog/jfrog-cli/docs/buildtools/poetry"
"github.com/jfrog/jfrog-cli/docs/buildtools/poetryconfig"
yarndocs "github.com/jfrog/jfrog-cli/docs/buildtools/yarn"
Expand Down Expand Up @@ -330,6 +331,19 @@ func GetCommands() []cli.Command {
return npmGenericCmd(c, cmdName, false)
},
},
{
Name: "pnpm-config",
Flags: cliutils.GetCommandFlags(cliutils.PnpmConfig),
Aliases: []string{"pnpmc"},
Usage: pnpmconfig.GetDescription(),
HelpName: corecommon.CreateUsage("pnpm-config", pnpmconfig.GetDescription(), pnpmconfig.Usage),
ArgsUsage: common.CreateEnvVars(),
BashComplete: corecommon.CreateBashCompletionFunc(),
Category: buildToolsCategory,
Action: func(c *cli.Context) error {
return cliutils.CreateConfigCmd(c, project.Pnpm)
},
},
{
Name: "docker",
Flags: cliutils.GetCommandFlags(cliutils.Docker),
Expand Down
7 changes: 7 additions & 0 deletions docs/buildtools/pnpmconfig/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package pnpmconfig

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

func GetDescription() string {
return "Generate pnpm configuration."
}
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ require (
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.20240214142246-bb1e61c953ac
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240218115031-cc5c8b521695

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240214141548-6691c4323f52
replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240218093454-1c352a93c23d

replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.2-0.20240214091334-d8ecf2a2cf76
replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.2-0.20240215122147-517c589b5ada

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231220102935-c8776c613ad8

Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ github.com/jfrog/gofrog v1.6.0 h1:jOwb37nHY2PnxePNFJ6e6279Pgkr3di05SbQQw47Mq8=
github.com/jfrog/gofrog v1.6.0/go.mod h1:SZ1EPJUruxrVGndOzHd+LTiwWYKMlHqhKD+eu+v5Hqg=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240214142246-bb1e61c953ac h1:dOPjCfPHtCdpp2e3yGeZZ7EieFxvlY6E45XGVqto5Mg=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240214142246-bb1e61c953ac/go.mod h1:xKh03WzFK7YlZtHNJdOzkMvFjyq75yeUWW5EKNKV2Qk=
github.com/jfrog/jfrog-cli-security v1.0.2-0.20240214091334-d8ecf2a2cf76 h1:VK5FPJgi1OpWxTvUyAzqyO6a1NSX0sjvQ1K5zwgXGUY=
github.com/jfrog/jfrog-cli-security v1.0.2-0.20240214091334-d8ecf2a2cf76/go.mod h1:39Y1SHOpaG8iNTEgBhRqaUBKHaiYrZ5Joa6OwPCFQ64=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240214141548-6691c4323f52 h1:eDwEWEKfz9gigNJNF60ioZFG3R/33Qq2z+5lH/FfO9Q=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240214141548-6691c4323f52/go.mod h1:fV5wrs86ihQkFKfMKpGxMbNf3mbVT4LUf320C1T9C2M=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240218115031-cc5c8b521695 h1:sD6uaVqfbixV+a/shxDThH6JIjVqqPrbz0dr95NjCy4=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240218115031-cc5c8b521695/go.mod h1:+azTP7jL4ebGF//oVz+kCsLOIFxBp/19McVB0KHwT8U=
github.com/jfrog/jfrog-cli-security v1.0.2-0.20240215122147-517c589b5ada h1:u+DG6qiSE1X4hdCYtCAC3Fn1765VguTRurm+tqrbRNk=
github.com/jfrog/jfrog-cli-security v1.0.2-0.20240215122147-517c589b5ada/go.mod h1:CQo/eRqwB+O31pCnJv6tdvrTLWP2K7fmK4k4Oh+gebQ=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240218093454-1c352a93c23d h1:59C2AOjdp5Wp/WoeQZkOGbAtKnhY1a9YhrnAdeVbVYs=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240218093454-1c352a93c23d/go.mod h1:fV5wrs86ihQkFKfMKpGxMbNf3mbVT4LUf320C1T9C2M=
github.com/jszwec/csvutil v1.10.0 h1:upMDUxhQKqZ5ZDCs/wy+8Kib8rZR8I8lOR34yJkdqhI=
github.com/jszwec/csvutil v1.10.0/go.mod h1:/E4ONrmGkwmWsk9ae9jpXnv9QT8pLHEPcCirMFhxG9I=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Expand Down
4 changes: 4 additions & 0 deletions utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const (
Npm = "npm"
NpmInstallCi = "npm-install-ci"
NpmPublish = "npm-publish"
PnpmConfig = "pnpm-config"
YarnConfig = "yarn-config"
Yarn = "yarn"
NugetConfig = "nuget-config"
Expand Down Expand Up @@ -1848,6 +1849,9 @@ var commandFlags = map[string][]string{
NpmPublish: {
buildName, buildNumber, module, Project, npmDetailedSummary, xrayScan, xrOutput,
},
PnpmConfig: {
global, serverIdResolve, repoResolve,
},
YarnConfig: {
global, serverIdResolve, repoResolve,
},
Expand Down

0 comments on commit 548a18b

Please sign in to comment.