Skip to content

Commit

Permalink
Compute the conflict name with a placeholder replaced before renderin…
Browse files Browse the repository at this point in the history
…g, since the conflicts field in goreleaser is not templatable
  • Loading branch information
alvarocabanas committed Jan 13, 2025
1 parent b86d898 commit ccc83af
Show file tree
Hide file tree
Showing 26 changed files with 57 additions and 29 deletions.
5 changes: 3 additions & 2 deletions build/goreleaser/linux/al2023_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
# Required packages. rpm version 4.11.3 does not support weak dependencies
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end AL2023 adm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/al2023_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end AL2023 arm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/al2_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
dependencies:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end AL2 adm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/al2_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
dependencies:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end AL2 arm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/centos_7_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
dependencies:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end CentOS 7 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/centos_7_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
dependencies:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end CentOS 7 arm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/centos_8_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end CentOS 8 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/centos_8_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end CentOS 8 arm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/debian_systemd_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end Debian systemd amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/debian_systemd_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end Debian systemd arm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/debian_upstart_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end Debian upstart amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/rhel_9_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end RHEL 9 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/rhel_9_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end RHEL 9 arm64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_125_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end SLES 12.5 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_125_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
posttrans: "build/package/rpm/postinst-systemd.sh"
summary: "New Relic Infrastructure Agent"
group: default
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
# recommends:
# FB not supported yet
Expand Down
4 changes: 2 additions & 2 deletions build/goreleaser/linux/sles_152_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}

- newrelic-infra#conflicts-suffix-placeholder#
# end SLES 15.2 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_152_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
posttrans: "build/package/rpm/postinst-systemd.sh"
summary: "New Relic Infrastructure Agent"
group: default
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
# recommends:
# FB not supported yet
Expand Down
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_153_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
recommends:
- td-agent-bit #To be removed on removal of the ff fluent_bit_19
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end SLES 15.3 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_153_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
posttrans: "build/package/rpm/postinst-systemd.sh"
summary: "New Relic Infrastructure Agent"
group: default
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
# recommends:
# FB not supported yet
Expand Down
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_154_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end SLES 15.4 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_154_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
posttrans: "build/package/rpm/postinst-systemd.sh"
summary: "New Relic Infrastructure Agent"
group: default
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
# recommends:
# FB not supported yet
Expand Down
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_155_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end SLES 15.5 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_155_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
posttrans: "build/package/rpm/postinst-systemd.sh"
summary: "New Relic Infrastructure Agent"
group: default
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
# recommends:
# FB not supported yet
Expand Down
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_156_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
recommends:
- fluent-bit
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#

# end SLES 15.6 amd64
3 changes: 2 additions & 1 deletion build/goreleaser/linux/sles_156_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@
posttrans: "build/package/rpm/postinst-systemd.sh"
summary: "New Relic Infrastructure Agent"
group: default
# conflicts is not "templatable", so we add the conflicts-suffix-placeholder to be replaced later
conflicts:
- newrelic-infra{{ if eq .Env.FIPS "" -}}-fips{{ end }}
- newrelic-infra#conflicts-suffix-placeholder#
# Recommended packages. If they fail to install installation of the agent will not be interrupted.
# recommends:
# FB not supported yet
Expand Down
8 changes: 6 additions & 2 deletions build/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ generate-goreleaser-amd64:
$(CURDIR)/build/goreleaser/linux/sles_153_amd64.yml\
$(CURDIR)/build/goreleaser/linux/sles_154_amd64.yml\
$(CURDIR)/build/goreleaser/linux/sles_155_amd64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml | \
sed "s/#conflicts-suffix-placeholder#/$(shell [ -n '$(FIPS)' ] && echo '' || echo '-fips')/g" \
> $(GORELEASER_CONFIG_LINUX)

.PHONY : generate-goreleaser-arm
Expand Down Expand Up @@ -258,7 +259,8 @@ generate-goreleaser-arm64:
$(CURDIR)/build/goreleaser/linux/sles_153_arm64.yml\
$(CURDIR)/build/goreleaser/linux/sles_154_arm64.yml\
$(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml | \
sed "s/#conflicts-suffix-placeholder#/$(shell [ -n '$(FIPS)' ] && echo '' || echo '-fips')/g" \
> $(GORELEASER_CONFIG_LINUX)

.PHONY : generate-goreleaser-legacy
Expand Down Expand Up @@ -334,6 +336,7 @@ generate-goreleaser-multiarch:
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_arm.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\
sed "s/#conflicts-suffix-placeholder#/-fips/g" \
> $(GORELEASER_CONFIG_LINUX)

.PHONY : generate-goreleaser-multiarch-fips
Expand Down Expand Up @@ -370,6 +373,7 @@ generate-goreleaser-multiarch-fips:
$(CURDIR)/build/goreleaser/linux/sles_155_arm64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_amd64.yml\
$(CURDIR)/build/goreleaser/linux/sles_156_arm64.yml\
sed "s/#conflicts-suffix-placeholder#//g" \
> $(GORELEASER_CONFIG_LINUX)

.PHONY : generate-goreleaser-for-docker
Expand Down

0 comments on commit ccc83af

Please sign in to comment.