Skip to content

Commit 134929b

Browse files
committed
glci 0.7.0 (new formula)
GitLab Local CI: run GitLab CI/CD pipelines locally using Docker or Podman. Parses .gitlab-ci.yml offline to lint, list jobs and render pipeline graphs, and executes jobs in containers without pushing.
1 parent d27cec5 commit 134929b

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Formula/g/glci.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
class Glci < Formula
2+
desc "Run GitLab CI/CD pipelines locally"
3+
homepage "https://gitlab.com/gitlab-org/ci-cd/runner-tools/glci"
4+
url "https://gitlab.com/gitlab-org/ci-cd/runner-tools/glci/-/archive/v0.7.0/glci-v0.7.0.tar.gz"
5+
sha256 "350367daf09af8da22b0d4376222bc004c43b372151d6206b3ce717857c15d62"
6+
license "MIT"
7+
head "https://gitlab.com/gitlab-org/ci-cd/runner-tools/glci.git", branch: "main"
8+
9+
depends_on "go" => :build
10+
11+
deny_network_access! [:postinstall, :test]
12+
13+
def install
14+
ldflags = %W[
15+
-X gitlab.com/gitlab-org/ci-cd/runner-tools/glci/pkg/version.Commit=#{tap&.user || "homebrew"}
16+
]
17+
system "go", "build", *std_go_args(ldflags:), "./cmd/glci"
18+
generate_completions_from_executable(bin/"glci", "completion")
19+
end
20+
21+
def caveats
22+
<<~EOS
23+
glci requires a running container engine (Docker or Podman) to execute jobs.
24+
EOS
25+
end
26+
27+
test do
28+
(testpath/".gitlab-ci.yml").write <<~YAML
29+
test-job:
30+
stage: test
31+
script:
32+
- echo hello
33+
YAML
34+
assert_match "test-job", shell_output("#{bin}/glci jobs")
35+
assert_match "test-job", shell_output("#{bin}/glci show --plain")
36+
assert_match tap&.user || "homebrew", shell_output("#{bin}/glci version 2>&1")
37+
end
38+
end

0 commit comments

Comments
 (0)