docker: remove -ce suffix, set date and platform
Closes #35012. Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
parent
609d68ed1b
commit
d0e2fc6be7
1 changed files with 6 additions and 2 deletions
|
@ -4,6 +4,7 @@ class Docker < Formula
|
|||
url "https://github.com/docker/docker-ce.git",
|
||||
:tag => "v18.09.0",
|
||||
:revision => "4d60db472b2bde6931072ca6467f2667c2590dff"
|
||||
revision 1
|
||||
|
||||
bottle do
|
||||
cellar :any_skip_relocation
|
||||
|
@ -20,8 +21,11 @@ class Docker < Formula
|
|||
dir.install (buildpath/"components/cli").children
|
||||
cd dir do
|
||||
commit = Utils.popen_read("git rev-parse --short HEAD").chomp
|
||||
ldflags = ["-X github.com/docker/cli/cli.GitCommit=#{commit}",
|
||||
"-X github.com/docker/cli/cli.Version=#{version}-ce"]
|
||||
build_time = Utils.popen_read("date -u +'%Y-%m-%dT%H:%M:%SZ' 2> /dev/null").chomp
|
||||
ldflags = ["-X \"github.com/docker/cli/cli.BuildTime=#{build_time}\"",
|
||||
"-X github.com/docker/cli/cli.GitCommit=#{commit}",
|
||||
"-X github.com/docker/cli/cli.Version=#{version}",
|
||||
"-X \"github.com/docker/cli/cli.PlatformName=Docker Engine - Community\""]
|
||||
system "go", "build", "-o", bin/"docker", "-ldflags", ldflags.join(" "),
|
||||
"github.com/docker/cli/cmd/docker"
|
||||
|
||||
|
|
Loading…
Reference in a new issue