Skip to content

Commit b1ac02b

Browse files
committed
jenkins-cli 0.0.47 (new formula)
Signed-off-by: Rui Chen <[email protected]>
1 parent c7c3e8c commit b1ac02b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/autobump.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,7 @@ jd
15701570
jdnssec-tools
15711571
jena
15721572
jenkins
1573+
jenkins-cli
15731574
jenkins-job-builder
15741575
jenkins-lts
15751576
jerryscript

Formula/j/jenkins-cli.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
class JenkinsCli < Formula
2+
desc "CLI for jenkins"
3+
homepage "https://github.com/jenkins-zh/jenkins-cli"
4+
url "https://github.com/jenkins-zh/jenkins-cli/archive/refs/tags/v0.0.47.tar.gz"
5+
sha256 "4e78600e214c357c08a0a83fe9cc59214b0d050de07dbb469d9f226c8c37eabc"
6+
license "MIT"
7+
head "https://github.com/jenkins-zh/jenkins-cli.git", branch: "master"
8+
9+
depends_on "go" => :build
10+
11+
def install
12+
ldflags = %W[
13+
-s -w
14+
-X github.com/linuxsuren/cobra-extension/version.version=#{version}
15+
-X github.com/linuxsuren/cobra-extension/version.commit=#{tap.user}
16+
-X github.com/linuxsuren/cobra-extension/version.date=#{time.iso8601}
17+
]
18+
system "go", "build", *std_go_args(ldflags:, output: bin/"jcli")
19+
20+
generate_completions_from_executable(bin/"jcli", "completion")
21+
end
22+
23+
test do
24+
assert_match version.to_s, shell_output("#{bin}/jcli version")
25+
26+
(testpath/".jenkins-cli.yaml").write <<~EOS
27+
current: default
28+
configurations:
29+
default:
30+
url: http://localhost:8080
31+
username: admin
32+
token: admin
33+
EOS
34+
35+
assert_equal "Name URL Description", shell_output("#{bin}/jcli config list").chomp
36+
assert_match "Cannot found Jenkins", shell_output("#{bin}/jcli plugin list 2>&1", 1)
37+
end
38+
end

0 commit comments

Comments
 (0)