Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap-telemetry 0.19.0 #7198

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Formula/snap-telemetry.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class SnapTelemetry < Formula
desc "Snap is an opensource telemetry framework"
homepage "http://snap-telemetry.io/"
url "https://github.com/intelsdi-x/snap/archive/0.17.0.tar.gz"
sha256 "d627eff8155b346ce542fdf3251b2713a0bae887fb6a8ef3ba169b13c4f9fc60"
url "https://github.com/intelsdi-x/snap/archive/0.19.0.tar.gz"
sha256 "28c6ffa208b54251266d48236911d8c38fd27cabd79a84bf91d47376fd69dc7f"

head "https://github.com/intelsdi-x/snap.git"

Expand All @@ -22,37 +22,37 @@ def install
ENV["CGO_ENABLED"] = "0"
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"

snapd = buildpath/"src/github.com/intelsdi-x/snap"
snapd.install buildpath.children
snapteld = buildpath/"src/github.com/intelsdi-x/snap"
snapteld.install buildpath.children

cd snapd do
cd snapteld do
system "glide", "install"
system "go", "build", "-o", "snapd", "-ldflags", "-w -X main.gitversion=#{version}"
bin.install "snapd"
system "go", "build", "-o", "snapteld", "-ldflags", "-w -X main.gitversion=#{version}"
sbin.install "snapteld"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it was changed from snapd to snapteld?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine given the names they use in the tarball.

prefix.install_metafiles
end

snapctl = buildpath/"src/github.com/intelsdi-x/snap/cmd/snapctl"
cd snapctl do
system "go", "build", "-o", "snapctl", "-ldflags", "-w -X main.gitversion=#{version}"
bin.install "snapctl"
snaptel = buildpath/"src/github.com/intelsdi-x/snap/cmd/snaptel"
cd snaptel do
system "go", "build", "-o", "snaptel", "-ldflags", "-w -X main.gitversion=#{version}"
bin.install "snaptel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it was changed from snapctl to snaptel?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine given the names they use in the tarball.

end
end

test do
assert_match version.to_s, shell_output("#{bin}/snapd --version")
assert_match version.to_s, shell_output("#{bin}/snapctl --version")
assert_match version.to_s, shell_output("#{sbin}/snapteld --version")
assert_match version.to_s, shell_output("#{bin}/snaptel --version")

begin
snapd_pid = fork do
exec "#{bin}/snapd -t 0 -l 1 -o #{testpath}"
snapteld_pid = fork do
exec "#{sbin}/snapteld -t 0 -l 1 -o #{testpath}"
end
sleep 5
assert_match("No plugins", shell_output("#{bin}/snapctl plugin list"))
assert_match("No task", shell_output("#{bin}/snapctl task list"))
assert_predicate testpath/"snapd.log", :exist?
assert_match("No plugins", shell_output("#{bin}/snaptel plugin list"))
assert_match("No task", shell_output("#{bin}/snaptel task list"))
assert_predicate testpath/"snapteld.log", :exist?
ensure
Process.kill("TERM", snapd_pid)
Process.kill("TERM", snapteld_pid)
end
end
end