Skip to content

Commit 09859ed

Browse files
committed
kafkactl-aws-plugin: 1.3.0 (new formula)
introduces a new formula for the kafkactl-aws-plugin
1 parent 414791c commit 09859ed

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Formula/k/kafkactl-aws-plugin.rb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
class KafkactlAwsPlugin < Formula
2+
desc "AWS Plugin for kafkactl"
3+
homepage "https://deviceinsight.github.io/kafkactl/"
4+
url "https://github.com/deviceinsight/kafkactl-plugins/archive/refs/tags/v1.3.0.tar.gz"
5+
sha256 "9fcab4135e68ffba6af40db21ab4c36f798a502be402f6c2d6557d316084b445"
6+
license "Apache-2.0"
7+
8+
depends_on "go" => :build
9+
depends_on "kafkactl"
10+
11+
def install
12+
Dir.chdir("aws") do
13+
ldflags = %W[
14+
-s -w
15+
-X main.Version=v#{version}
16+
-X main.GitCommit=#{tap.user}
17+
-X main.BuildTime=#{time.iso8601}
18+
]
19+
system "go", "build", *std_go_args(ldflags:)
20+
end
21+
end
22+
23+
test do
24+
assert_match version.to_s, shell_output("#{bin}/kafkactl-aws-plugin 2>&1", 1)
25+
config_file = testpath/".kafkactl.yml"
26+
config_file.write <<~YAML
27+
contexts:
28+
default:
29+
brokers:
30+
- unknown-cluster.kafka.eu-west-1.amazonaws.com:9098
31+
sasl:
32+
enabled: true
33+
mechanism: oauth
34+
tokenprovider:
35+
plugin: aws
36+
tls:
37+
enabled: true
38+
YAML
39+
40+
ENV["KAFKA_CTL_PLUGIN_PATHS"] = bin
41+
42+
kafkactl = Formula["kafkactl"].bin/"kafkactl"
43+
output = shell_output("#{kafkactl} -C #{config_file} get topics -V 2>&1", 1)
44+
assert_match "kafkactl-aws-plugin: plugin initialized", output
45+
end
46+
end

0 commit comments

Comments
 (0)