Skip to content

Commit

Permalink
Artifactory Release Lifecycle Management - Support distribution sync …
Browse files Browse the repository at this point in the history
…and project (#2455)
  • Loading branch information
RobiNino authored Mar 18, 2024
1 parent a3c2a92 commit b270f24
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ func TestDistributeSyncTimeout(t *testing.T) {
if r.RequestURI == "/api/v1/release_bundle/"+tests.BundleName+"/"+bundleVersion+"/distribution/"+trackerId {
statusRequestsReceived++
w.WriteHeader(http.StatusOK)
content, err := json.Marshal(distributionServices.DistributionStatusResponse{Status: distributionServices.InProgress})
content, err := json.Marshal(distribution.DistributionStatusResponse{Status: distribution.InProgress})
assert.NoError(t, err)
_, err = w.Write(content)
assert.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ 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.20240317161137-662abefabe8e
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240318065853-b785b7d7f693

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240317160615-e419c2a9e723
replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240318065424-90669dbbcc54

replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.4-0.20240303113253-d82ecc02d9eb

Expand Down
8 changes: 4 additions & 4 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.3 h1:F7He0+75HcgCe6SGTSHLFCBDxiE2Ja0tekvvcktW6wc=
github.com/jfrog/gofrog v1.6.3/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.20240317161137-662abefabe8e h1:mmM8VzqO3Qc/bzvw4onPEoMV96QfOijnZpNMr8AOFEs=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240317161137-662abefabe8e/go.mod h1:EIVjqkE5U1AMpZMLhL814Xpxc5hOqbPxxGiXHeojg7A=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240318065853-b785b7d7f693 h1:VgaSrFtNNfgSzRFxg7kzQeqm6q/ZeetaH4uSPt0YP+Q=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240318065853-b785b7d7f693/go.mod h1:mWr+fwcpgoNDTqBeYmXN0AU4FwC/a90MlzL0SoNrMC0=
github.com/jfrog/jfrog-cli-security v1.0.4-0.20240303113253-d82ecc02d9eb h1:JUqwNOqzwj+1oZQXY1p/xnnH97BEMfOKGG505vGVIe4=
github.com/jfrog/jfrog-cli-security v1.0.4-0.20240303113253-d82ecc02d9eb/go.mod h1:pOqg/hGw6eHWNyLDHeOCyq/Ntuc+wLJTV2Z8XuwXspU=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240317160615-e419c2a9e723 h1:0N/fdI2PXLjdWZieh7ib+6gb87yw3x22V7t1YZJvWOA=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240317160615-e419c2a9e723/go.mod h1:NB8tYFgkWtn+wHsKC+aYC75aLnS6yW81d8JAFTBxsi0=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240318065424-90669dbbcc54 h1:FTrss/ffJPjTHOOhQ8P+8DrkGYkxcaHlxp12nOfeZJQ=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240318065424-90669dbbcc54/go.mod h1:NB8tYFgkWtn+wHsKC+aYC75aLnS6yW81d8JAFTBxsi0=
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
10 changes: 7 additions & 3 deletions lifecycle/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,23 @@ func distribute(c *cli.Context) error {
if err != nil {
return err
}
distributionRules, _, params, err := distribution.InitReleaseBundleDistributeCmd(c)
distributionRules, maxWaitMinutes, _, err := distribution.InitReleaseBundleDistributeCmd(c)
if err != nil {
return err
}

distributeCmd := lifecycle.NewReleaseBundleDistributeCommand()
distributeCmd.SetServerDetails(lcDetails).
SetDistributeBundleParams(params).
SetReleaseBundleName(c.Args().Get(0)).
SetReleaseBundleVersion(c.Args().Get(1)).
SetReleaseBundleProject(cliutils.GetProject(c)).
SetDistributionRules(distributionRules).
SetDryRun(c.Bool("dry-run")).
SetAutoCreateRepo(c.Bool(cliutils.CreateRepo)).
SetPathMappingPattern(c.String(cliutils.PathMappingPattern)).
SetPathMappingTarget(c.String(cliutils.PathMappingTarget))
SetPathMappingTarget(c.String(cliutils.PathMappingTarget)).
SetSync(c.Bool(cliutils.Sync)).
SetMaxWaitMinutes(maxWaitMinutes)
return commands.Exec(distributeCmd)
}

Expand Down
4 changes: 2 additions & 2 deletions utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2006,8 +2006,8 @@ var commandFlags = map[string][]string{
platformUrl, user, password, accessToken, serverId, lcSigningKey, lcSync, lcProject, lcIncludeRepos, lcExcludeRepos,
},
ReleaseBundleDistribute: {
platformUrl, user, password, accessToken, serverId, lcDryRun, DistRules, site, city, countryCodes,
InsecureTls, CreateRepo, lcPathMappingPattern, lcPathMappingTarget,
platformUrl, user, password, accessToken, serverId, lcProject, DistRules, site, city, countryCodes,
lcDryRun, CreateRepo, lcPathMappingPattern, lcPathMappingTarget, lcSync, maxWaitMinutes,
},
ReleaseBundleDeleteLocal: {
platformUrl, user, password, accessToken, serverId, deleteQuiet, lcSync, lcProject,
Expand Down

0 comments on commit b270f24

Please sign in to comment.