Skip to content

Commit

Permalink
egctl: add new formula
Browse files Browse the repository at this point in the history
egctl is a command line tool to provide additional functionality
for Envoy Gateway users, add a formula make it easier for brew
users to install it.
  • Loading branch information
zirain committed Jun 29, 2024
1 parent d767dd1 commit 92e32f1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ editorconfig-checker
efl
efm-langserver
eg-examples
egctl
eget
ehco
eigenpy
Expand Down
31 changes: 31 additions & 0 deletions Formula/e/egctl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Egctl < Formula
desc "Command-line utility for operating Envoy Gateway"
homepage "https://gateway.envoyproxy.io/"
url "https://github.com/envoyproxy/gateway/archive/refs/tags/v1.0.2.tar.gz"
sha256 "05406182dc165513925cf60722582613d4de9ea789d60e014e6da456bb229f65"
license "Apache-2.0"
head "https://github.com/envoyproxy/gateway.git", branch: "main"

livecheck do
url :stable
strategy :github_latest
end

depends_on "go" => :build

def install
ldflags = %W[
-s -w
-X github.com/envoyproxy/gateway/internal/cmd/version.envoyGatewayVersion=#{version}
-X github.com/envoyproxy/gateway/internal/cmd/version.gitCommitID=#{tap.user}
]
system "go", "build", *std_go_args(ldflags:), "./cmd/egctl"

generate_completions_from_executable(bin/"egctl", "completion")
end

test do

Check failure on line 27 in Formula/e/egctl.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew test --verbose egctl` failed on Linux!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/bundle clean ==> Testing egctl ==> /home/linuxbrew/.linuxbrew/Cellar/egctl/1.0.2/bin/egctl version --remote=false Error: egctl: failed ::error::egctl: failed An exception occurred within a child process: Minitest::Assertion: Expected: "envd: v1.0.2" Actual: "1.0.2" /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.24.0/lib/minitest/assertions.rb:183:in `assert' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.24.0/lib/minitest/assertions.rb:223:in `assert_equal' /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/e/egctl.rb:33:in `block in <class:Egctl>' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2783:in `block (3 levels) in run_test' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/kernel.rb:528:in `with_env' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2782:in `block (2 levels) in run_test' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1188:in `with_logging' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2781:in `block in run_test' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/mktemp.rb:75:in `run' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:3092:in `mktemp' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:2775:in `run_test' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:46:in `block in <main>' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:50:in `<main>'

Check failure on line 27 in Formula/e/egctl.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew test --verbose egctl` failed on macOS Sonoma (14) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/bundle clean ==> Testing egctl ==> /opt/homebrew/Cellar/egctl/1.0.2/bin/egctl version --remote=false Error: egctl: failed ::error::egctl: failed An exception occurred within a child process: Minitest::Assertion: Expected: "envd: v1.0.2" Actual: "1.0.2" /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.24.0/lib/minitest/assertions.rb:183:in `assert' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.24.0/lib/minitest/assertions.rb:223:in `assert_equal' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/e/egctl.rb:33:in `block in <class:Egctl>' /opt/homebrew/Library/Homebrew/formula.rb:2783:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:528:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2782:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1188:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2781:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `run' /opt/homebrew/Library/Homebrew/formula.rb:3092:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2775:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:46:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:50:in `<main>'

Check failure on line 27 in Formula/e/egctl.rb

View workflow job for this annotation

GitHub Actions / macOS 12-arm64

`brew test --verbose egctl` failed on macOS Monterey (12) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/bundle clean ==> Testing egctl ==> /opt/homebrew/Cellar/egctl/1.0.2/bin/egctl version --remote=false Error: egctl: failed ::error::egctl: failed An exception occurred within a child process: Minitest::Assertion: Expected: "envd: v1.0.2" Actual: "1.0.2" /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.24.0/lib/minitest/assertions.rb:183:in `assert' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.24.0/lib/minitest/assertions.rb:223:in `assert_equal' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/e/egctl.rb:33:in `block in <class:Egctl>' /opt/homebrew/Library/Homebrew/formula.rb:2783:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:528:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2782:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1188:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2781:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `run' /opt/homebrew/Library/Homebrew/formula.rb:3092:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2775:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:46:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:50:in `<main>'
output = shell_output("#{bin}/egctl version --remote=false")
assert_equal "envd: v#{version}", output.strip
end
end

0 comments on commit 92e32f1

Please sign in to comment.