-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c361f5
commit e55d122
Showing
11 changed files
with
218 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
version: 2 | ||
project_name: nri-redis | ||
builds: | ||
- id: nri-nix | ||
main: ./src | ||
|
@@ -18,6 +21,26 @@ builds: | |
- goos: darwin | ||
goarch: 386 | ||
|
||
- id: nri-nix-fips | ||
main: ./src | ||
binary: nri-redis | ||
ldflags: | ||
- -s -w -X main.integrationVersion={{.Version}} -X main.gitCommit={{.Commit}} -X main.buildDate={{.Date}} | ||
env: | ||
- CGO_ENABLED=1 | ||
- GOEXPERIMENT=boringcrypto | ||
- >- | ||
{{- if eq .Arch "arm64" -}} | ||
CC=aarch64-linux-gnu-gcc | ||
{{- end }} | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
tags: | ||
- fips | ||
|
||
- id: nri-win | ||
main: ./src | ||
binary: nri-redis | ||
|
@@ -67,9 +90,59 @@ nfpms: | |
|
||
overrides: | ||
rpm: | ||
file_name_template: "{{ .ProjectName }}-{{ .Version }}-1.{{ .Arch }}" | ||
replacements: | ||
amd64: x86_64 | ||
file_name_template: >- | ||
{{- .ProjectName }}_ | ||
{{- .Version }}-1. | ||
{{- if eq .Arch "amd64" -}}x86_64 | ||
{{- else -}} | ||
{{ .Arch }} | ||
{{- end }} | ||
# Formats to be generated. | ||
formats: | ||
- deb | ||
- rpm | ||
|
||
- id: linux-fips | ||
file_name_template: "{{ .ProjectName }}-fips_{{ .Version }}-1_{{ .Arch }}" | ||
vendor: "New Relic, Inc." | ||
homepage: "https://www.newrelic.com/infrastructure" | ||
maintainer: "New Relic Infrastructure Team <[email protected]>" | ||
description: "New Relic Infrastructure redis Integration extend the core New Relic\nInfrastructure agent's capabilities to allow you to collect metric and\nlive state data from redis components." | ||
license: "https://newrelic.com/terms (also see LICENSE installed with this package)" | ||
|
||
builds: | ||
- nri-nix-fips | ||
|
||
dependencies: | ||
- newrelic-infra (>= 1.20.0) | ||
|
||
bindir: "/var/db/newrelic-infra/newrelic-integrations/bin" | ||
|
||
contents: | ||
- src: "redis-config.yml.sample" | ||
dst: "/etc/newrelic-infra/integrations.d/redis-config.yml.sample" | ||
- src: "redis-log.yml.example" | ||
dst: "/etc/newrelic-infra/logging.d/redis-log.yml.example" | ||
- src: "CHANGELOG.md" | ||
dst: "/usr/share/doc/nri-redis/CHANGELOG.md" | ||
- src: "README.md" | ||
dst: "/usr/share/doc/nri-redis/README.md" | ||
- src: "LICENSE" | ||
dst: "/usr/share/doc/nri-redis/LICENSE" | ||
- src: "legacy/redis-definition.yml" | ||
dst: "/var/db/newrelic-infra/newrelic-integrations/redis-definition.yml" | ||
type: config | ||
|
||
overrides: | ||
rpm: | ||
file_name_template: >- | ||
{{- .ProjectName }}-fips_ | ||
{{- .Version }}-1. | ||
{{- if eq .Arch "amd64" -}}x86_64 | ||
{{- else -}} | ||
{{ .Arch }} | ||
{{- end }} | ||
# Formats to be generated. | ||
formats: | ||
|
@@ -88,6 +161,17 @@ archives: | |
strip_parent: true | ||
format: tar.gz | ||
|
||
- id: nri-nix-fips | ||
builds: | ||
- nri-nix-fips | ||
name_template: "{{ .ProjectName }}-fips_{{ .Os }}_{{ .Version }}_{{ .Arch }}_dirty" | ||
files: | ||
- redis-config.yml.sample | ||
- src: 'legacy/redis-definition.yml' | ||
dst: . | ||
strip_parent: true | ||
format: tar.gz | ||
|
||
- id: nri-win | ||
builds: | ||
- nri-win | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/expect -f | ||
|
||
# Retrieve the arguments | ||
set deb_file [lindex $argv 0]; | ||
set GPG_PASSPHRASE [lindex $argv 1]; | ||
set GPG_MAIL [lindex $argv 2]; # Capture GPG_MAIL | ||
|
||
# Set an infinite timeout to allow for longer operations | ||
set timeout -1 | ||
|
||
# Start the signing process using dpkg-sig | ||
spawn dpkg-sig --sign builder -k $GPG_MAIL $deb_file | ||
|
||
# Handle the passphrase prompt | ||
expect "Enter passphrase:" | ||
send -- "$GPG_PASSPHRASE\r" | ||
|
||
# Wait until the process completes | ||
expect eof | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/expect -f | ||
|
||
set rpm_file [lindex $argv 0]; | ||
set GPG_PASSPHRASE [lindex $argv 1]; | ||
|
||
set timeout -1 | ||
spawn rpmsign -v --addsign $rpm_file | ||
expect "Enter pass phrase:" | ||
send -- "${GPG_PASSPHRASE}\r" | ||
expect eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/expect -f | ||
|
||
set timeout -1 | ||
set targz_file [lindex $argv 0] | ||
set passphrase [lindex $argv 1] | ||
|
||
# Ensure the GPG_TTY is set correctly | ||
set env(GPG_TTY) [exec /bin/sh -c "tty"] | ||
|
||
# Debug output to verify the correct file is being processed | ||
puts "Expect script signing file: $targz_file" | ||
|
||
spawn gpg --sign --armor --detach-sig $targz_file | ||
expect { | ||
"Enter passphrase:" { | ||
send -- "$passphrase\r" | ||
exp_continue | ||
} | ||
eof { | ||
catch wait result | ||
exit [lindex $result 3] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2024 New Relic Corporation. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//go:build fips | ||
// +build fips | ||
|
||
package main | ||
|
||
import ( | ||
_ "crypto/tls/fipsonly" | ||
) |