Skip to content

Commit

Permalink
build: rename Prometheus exporter binary
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-soubeyrand committed Jul 23, 2024
1 parent cf6c4d1 commit 23af660
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const (

// Varnish Prometheus exporter version
PrometheusExporterVersion string = "1.6.1"
// Varnish Prometheus exporter binary name
PrometheusExporterBinaryName string = "prometheus-varnish-exporter"

// jq version
JqVersion string = "1.7.1"
Expand Down Expand Up @@ -111,12 +113,12 @@ func (prometheusExporter *VarnishPrometheusExporter) Binary(
WithEnvVariable("GOARCH", arch).
WithMountedDirectory(".", source.Tree()).
WithExec([]string{
"go", "build", "-ldflags", "-s -w " +
"go", "build", "-o", PrometheusExporterBinaryName, "-ldflags", "-s -w " +
fmt.Sprintf("-X 'main.Version=%s'", prometheusExporter.Version) + " " +
fmt.Sprintf("-X 'main.VersionHash=%s'", commit) + " " +
fmt.Sprintf("-X 'main.VersionDate=%s'", time.Now().Format("2006-01-02 15:04:05 -07:00")),
}).
File("prometheus_varnish_exporter")
File(PrometheusExporterBinaryName)

return binary, nil
}
Expand All @@ -143,7 +145,9 @@ func (prometheusExporter *VarnishPrometheusExporter) Overlay(

overlay := dag.Directory().
WithDirectory(prefix, dag.Directory().
WithFile("bin/prometheus-varnish-exporter", binary),
WithDirectory("bin", dag.Directory().
WithFile(PrometheusExporterBinaryName, binary),
),
)

return overlay, nil
Expand Down

0 comments on commit 23af660

Please sign in to comment.