Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifactory Release Lifecycle Management - Support distribution sync and project #2455

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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.20240225151519-de88b95a3824
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/RobiNino/jfrog-cli-core/v2 v2.0.0-20240226122519-ab50d0ae0c80

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240225150756-e5fed3788eca
replace github.com/jfrog/jfrog-client-go => github.com/RobiNino/jfrog-client-go v0.0.0-20240226122023-e36e50380b38

replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.4-0.20240225141439-cc8b9f3d1962

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/RobiNino/jfrog-cli-core/v2 v2.0.0-20240226122519-ab50d0ae0c80 h1:FQ0bhDD4WdAjcc4wMoJH2Lf67Le01qy+Kir4CV58wDo=
github.com/RobiNino/jfrog-cli-core/v2 v2.0.0-20240226122519-ab50d0ae0c80/go.mod h1:v11Tk1VDZa7MhlDQVXSvxyOFMtJ9wbp/9blYMMnIe9g=
github.com/RobiNino/jfrog-client-go v0.0.0-20240226122023-e36e50380b38 h1:U/ksXeIr5e9FuKfhjOGWdmLO+9o+QL/4+/ERqR1QXcU=
github.com/RobiNino/jfrog-client-go v0.0.0-20240226122023-e36e50380b38/go.mod h1:WhVrqiqhSNFwj58/RQIrJEd28PHH1LTD4eWE0vBXv1o=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
Expand Down Expand Up @@ -127,12 +131,8 @@ 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.20240225151519-de88b95a3824 h1:nSqx+EdsuIzKsjS/5dkRaD9ak4db9IYMf/ggfCoahAE=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240225151519-de88b95a3824/go.mod h1:aE5kYuqiZxu6hHkAQm34BvtGjLR8rk0/PUWpl4u5g0Q=
github.com/jfrog/jfrog-cli-security v1.0.4-0.20240225141439-cc8b9f3d1962 h1:dlVDm3q/gR/yHrTcABHjMucs5vT6JesEw6GwBQe4WK4=
github.com/jfrog/jfrog-cli-security v1.0.4-0.20240225141439-cc8b9f3d1962/go.mod h1:u2j9vEorky4zk7EWk+Bqw08o66p9tuW7LxVxW0boAMA=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240225150756-e5fed3788eca h1:wgiw3iokmQ5uK+6+M50fyMQBsMJPQEbRYnwbAMUmPlI=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240225150756-e5fed3788eca/go.mod h1:WhVrqiqhSNFwj58/RQIrJEd28PHH1LTD4eWE0vBXv1o=
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 @@ -134,19 +134,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 @@ -1997,8 +1997,8 @@ var commandFlags = map[string][]string{
lcUrl, user, password, accessToken, serverId, lcSigningKey, lcSync, lcProject, lcIncludeRepos, lcExcludeRepos,
},
ReleaseBundleDistribute: {
lcUrl, user, password, accessToken, serverId, lcDryRun, DistRules, site, city, countryCodes,
InsecureTls, CreateRepo, lcPathMappingPattern, lcPathMappingTarget,
lcUrl, user, password, accessToken, serverId, lcProject, DistRules, site, city, countryCodes,
lcDryRun, CreateRepo, lcPathMappingPattern, lcPathMappingTarget, lcSync, maxWaitMinutes,
},
// Mission Control's commands
McConfig: {
Expand Down
Loading