Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

octant, openshift-cli: fix gopath #86784

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions Formula/octant.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "language/node"

class Octant < Formula
desc "Kubernetes introspection tool for developers"
homepage "https://octant.dev"
Expand Down Expand Up @@ -28,29 +30,21 @@ class Octant < Formula
end

def install
ENV["GOPATH"] = buildpath
ENV["GOFLAGS"] = "-mod=vendor"

ENV.append_path "PATH", HOMEBREW_PREFIX/"bin"

dir = buildpath/"src/github.com/vmware-tanzu/octant"
dir.install buildpath.children
Language::Node.setup_npm_environment

cd "src/github.com/vmware-tanzu/octant" do
system "go", "run", "build.go", "go-install"
ENV.prepend_path "PATH", buildpath/"bin"
system "go", "run", "build.go", "go-install"
system "go", "run", "build.go", "web-build"

system "go", "run", "build.go", "web-build"
ldflags = ["-X main.version=#{version}",
"-X main.gitCommit=#{Utils.git_head}",
"-X main.buildTime=#{time.iso8601}"].join(" ")

ldflags = ["-X \"main.version=#{version}\"",
"-X \"main.gitCommit=#{Utils.git_head}\"",
"-X \"main.buildTime=#{time.iso8601}\""].join(" ")
tags = "embedded exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp"

tags = "embedded exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp"

system "go", "build", *std_go_args(ldflags: ldflags),
"-tags", tags, "-v", "./cmd/octant"
end
system "go", "build", *std_go_args(ldflags: ldflags),
"-tags", tags, "-v", "./cmd/octant"
end

test do
Expand Down
27 changes: 11 additions & 16 deletions Formula/openshift-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,20 @@ def install

"linux"
end
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/openshift/oc"
dir.install buildpath.children - [buildpath/".brew_home"]

cd dir do
args = ["cross-build-#{os}-#{arch}"]
args << if build.stable?
"WHAT=cmd/oc"
else
"WHAT=staging/src/github.com/openshift/oc/cmd/oc"
end
args << "SHELL=/bin/bash" if OS.linux?
args = ["cross-build-#{os}-#{arch}"]
args << if build.stable?
"WHAT=cmd/oc"
else
"WHAT=staging/src/github.com/openshift/oc/cmd/oc"
end
args << "SHELL=/bin/bash" if OS.linux?

system "make", *args
bin.install "_output/bin/#{os}_#{arch}/oc"
system "make", *args
bin.install "_output/bin/#{os}_#{arch}/oc"

bash_completion.install "contrib/completions/bash/oc"
zsh_completion.install "contrib/completions/zsh/oc" => "_oc"
end
bash_completion.install "contrib/completions/bash/oc"
zsh_completion.install "contrib/completions/zsh/oc" => "_oc"
end

test do
Expand Down