Skip to content

Commit

Permalink
fix(artifacts): Do not further strip version for nuget packages (#4176)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matt <6519811+mattgogerly@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 4, 2021
1 parent 94259a7 commit 6ea175a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private String extractPackageVersion(
fileName.substring(
fileName.indexOf(filePrefix) + filePrefix.length(),
fileName.lastIndexOf(fileExtension));
if (version.contains(versionDelimiter)) {
if (version.contains(versionDelimiter) && !packageType.equals("nupkg")) {
// further strip in case of _all is in the file name
version = version.substring(0, version.indexOf(versionDelimiter));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import java.util.regex.Pattern

import static com.netflix.spinnaker.orca.pipeline.util.PackageType.DEB
import static com.netflix.spinnaker.orca.pipeline.util.PackageType.RPM
import static com.netflix.spinnaker.orca.pipeline.util.PackageType.NUPKG
import static com.netflix.spinnaker.orca.test.model.ExecutionBuilder.pipeline
import static com.netflix.spinnaker.orca.test.model.ExecutionBuilder.stage

Expand Down Expand Up @@ -206,6 +207,7 @@ class PackageInfoSpec extends Specification {
[["fileName": "package_4.11.4-h02.deb"], ["fileName": "package-something_4.11.4-h02.deb"]] | "package" | DEB || "package_4.11.4-h02"
[["fileName": "package_4.11.4-h02.sha123.deb"], ["fileName": "package-something_4.11.4-h02.deb"]] | "package-something" | DEB || "package-something_4.11.4-h02"
[["fileName": "package_4.11.4-h02.sha123.deb"], ["fileName": "package-something_4.11.4-h02.sha123.deb"]] | "package" | DEB || "package_4.11.4-h02.sha123"
[["fileName": "Package.1.3.3.7.nupkg"]] | "Package" | NUPKG || "Package.1.3.3.7"
}

def "findTargetPackage: bake execution with only a package set and jenkins stage artifacts"() {
Expand Down

0 comments on commit 6ea175a

Please sign in to comment.