From 9eb8e7e1580686d8ba2df19d95db3c4f6d7a12cd Mon Sep 17 00:00:00 2001 From: jackgopack4 Date: Tue, 19 Nov 2024 17:30:02 -0500 Subject: [PATCH] try changing package function --- cmd/goreleaser/internal/configure.go | 17 ++++-------- .../otelcol-contrib/.goreleaser.yaml | 27 ------------------- distributions/otelcol-otlp/.goreleaser.yaml | 24 ----------------- distributions/otelcol/.goreleaser.yaml | 27 ------------------- 4 files changed, 5 insertions(+), 90 deletions(-) diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index 06265f7b..a438efb9 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -209,20 +209,13 @@ func Packages(dist string) (r []config.NFPM) { return []config.NFPM{} } return []config.NFPM{ - Package(dist, true), - Package(dist, false), + Package(dist), } } // Package configures goreleaser to build a system package. // https://goreleaser.com/customization/nfpm/ -func Package(dist string, pie bool) config.NFPM { - id := dist - build := dist - if pie { - id = id + "-pie" - build = build + "-pie" - } +func Package(dist string) config.NFPM { nfpmContents := config.NFPMContents{ { Source: fmt.Sprintf("%s.service", dist), @@ -242,8 +235,8 @@ func Package(dist string, pie bool) config.NFPM { }) } return config.NFPM{ - ID: id, - Builds: []string{build}, + ID: dist, + Builds: []string{dist}, Formats: []string{"deb", "rpm"}, License: "Apache 2.0", @@ -258,7 +251,7 @@ func Package(dist string, pie bool) config.NFPM { }, NFPMOverridables: config.NFPMOverridables{ - PackageName: id, + PackageName: dist, Scripts: config.NFPMScripts{ PreInstall: "preinstall.sh", PostInstall: "postinstall.sh", diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 0210c5dd..d42e71bb 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -119,33 +119,6 @@ archives: - otelcol-contrib name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' nfpms: - - package_name: otelcol-contrib-pie - contents: - - src: otelcol-contrib.service - dst: /lib/systemd/system/otelcol-contrib.service - - src: otelcol-contrib.conf - dst: /etc/otelcol-contrib/otelcol-contrib.conf - type: config|noreplace - - src: config.yaml - dst: /etc/otelcol-contrib/config.yaml - type: config|noreplace - scripts: - preinstall: preinstall.sh - postinstall: postinstall.sh - preremove: preremove.sh - overrides: - rpm: - dependencies: - - /bin/sh - id: otelcol-contrib-pie - builds: - - otelcol-contrib-pie - formats: - - deb - - rpm - maintainer: The OpenTelemetry Collector maintainers - description: OpenTelemetry Collector - otelcol-contrib - license: Apache 2.0 - package_name: otelcol-contrib contents: - src: otelcol-contrib.service diff --git a/distributions/otelcol-otlp/.goreleaser.yaml b/distributions/otelcol-otlp/.goreleaser.yaml index 607d90b6..099a8ccd 100644 --- a/distributions/otelcol-otlp/.goreleaser.yaml +++ b/distributions/otelcol-otlp/.goreleaser.yaml @@ -118,30 +118,6 @@ archives: - otelcol-otlp name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' nfpms: - - package_name: otelcol-otlp-pie - contents: - - src: otelcol-otlp.service - dst: /lib/systemd/system/otelcol-otlp.service - - src: otelcol-otlp.conf - dst: /etc/otelcol-otlp/otelcol-otlp.conf - type: config|noreplace - scripts: - preinstall: preinstall.sh - postinstall: postinstall.sh - preremove: preremove.sh - overrides: - rpm: - dependencies: - - /bin/sh - id: otelcol-otlp-pie - builds: - - otelcol-otlp-pie - formats: - - deb - - rpm - maintainer: The OpenTelemetry Collector maintainers - description: OpenTelemetry Collector - otelcol-otlp - license: Apache 2.0 - package_name: otelcol-otlp contents: - src: otelcol-otlp.service diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index b1fcb184..167a31d8 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -119,33 +119,6 @@ archives: - otelcol name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' nfpms: - - package_name: otelcol-pie - contents: - - src: otelcol.service - dst: /lib/systemd/system/otelcol.service - - src: otelcol.conf - dst: /etc/otelcol/otelcol.conf - type: config|noreplace - - src: config.yaml - dst: /etc/otelcol/config.yaml - type: config|noreplace - scripts: - preinstall: preinstall.sh - postinstall: postinstall.sh - preremove: preremove.sh - overrides: - rpm: - dependencies: - - /bin/sh - id: otelcol-pie - builds: - - otelcol-pie - formats: - - deb - - rpm - maintainer: The OpenTelemetry Collector maintainers - description: OpenTelemetry Collector - otelcol - license: Apache 2.0 - package_name: otelcol contents: - src: otelcol.service