-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from algobot76/add-devstream
ci: make it possible to install dtm using homebrew
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class DevStream < Formula | ||
desc "Open-source DevOps toolchain manager (DTM)" | ||
homepage "https://github.com/merico-dev/stream" | ||
url "https://github.com/merico-dev/stream/archive/refs/tags/v0.3.0.tar.gz" | ||
sha256 "3223ff4ea46626d6849831ad9abfa6f67699731fd927fe477ab945b3ab9424eb" | ||
license "Apache-2.0" | ||
|
||
depends_on "go" => :build | ||
|
||
def install | ||
goos = Utils.safe_popen_read("#{Formula["go"].bin}/go", "env", "GOOS").chomp | ||
goarch = Utils.safe_popen_read("#{Formula["go"].bin}/go", "env", "GOARCH").chomp | ||
ENV["GOPATH"] = buildpath | ||
ENV["GO111MODULE"] = "auto" | ||
mkdir_p buildpath/"bin" | ||
ENV.prepend_path "PATH", buildpath/"bin" | ||
(buildpath/"src/github.com/merico-dev/stream").install buildpath.children | ||
cd "src/github.com/merico-dev/stream" do | ||
system "make", "build-core" | ||
mv "dtm-#{goos}-#{goarch}", "dtm" | ||
bin.install "dtm" | ||
end | ||
end | ||
|
||
test do | ||
assert_match version.to_s, shell_output("#{bin}/dtm version") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters