Skip to content

Commit

Permalink
fix: distribute on HOME to avoid deleting artifacts linked to a relea…
Browse files Browse the repository at this point in the history
…se bundle (#6053)
  • Loading branch information
sguiheux authored Jan 10, 2022
1 parent ded71f7 commit 42d0e09
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ func (actPlugin *artifactoryReleaseBundleDistributePlugin) Run(ctx context.Conte
if err != nil {
return actionplugin.Fail("%v", err)
}
if q.GetOptions()["distribute_only_on_edges"] != "true" {
edges = edge.RemoveNonEdge(edges)
}

if len(edges) == 0 {
return actionplugin.Fail("No destination available. Please check your credentials", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,3 @@ parameters:
type: string
description: JFrog Distribution token variable name. Leave empty to use integration.
advanced: true
distribute_only_on_edges:
type: boolean
description: Distribute release bundle only on edges.
default: "true"
advanced: true
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,3 @@ func ListEdgeNodes(distriClient *distribution.DistributionServicesManager, url,
}
return edges, nil
}

func RemoveNonEdge(edges []EdgeNode) []EdgeNode {
edgeFiltered := make([]EdgeNode, 0, len(edges))
for _, e := range edges {
if e.LicenseType != "EDGE" {
continue
}
edgeFiltered = append(edgeFiltered, e)
}
return edgeFiltered
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func (e *artifactoryReleasePlugin) Run(_ context.Context, opts *integrationplugi
if err != nil {
return fail("%v", err)
}
edges = edge.RemoveNonEdge(edges)

fmt.Printf("Distribute Release %s %s\n", releaseName, releaseVersion)
distributionParams := services.NewDistributeReleaseBundleParams(releaseName, releaseVersion)
Expand Down

0 comments on commit 42d0e09

Please sign in to comment.