32 lines
629 B
Ruby
32 lines
629 B
Ruby
|
$goVer = "1.9"
|
||
|
$repoPath = "git.xeserv.us/xena/route"
|
||
|
|
||
|
from "xena/go-mini:#{$goVer}"
|
||
|
|
||
|
run "go download"
|
||
|
|
||
|
[
|
||
|
"vendor",
|
||
|
"internal",
|
||
|
"proto",
|
||
|
"cmd",
|
||
|
"lib",
|
||
|
"plugins",
|
||
|
"doc",
|
||
|
].each { |x| copy x+"/", "/root/go/src/#{$repoPath}/#{x}" }
|
||
|
|
||
|
run "apk --no-cache add build-base"
|
||
|
run "go build -v #{$repoPath}/cmd/... && go install -v #{$repoPath}/cmd/..."
|
||
|
run "apk del build-base"
|
||
|
|
||
|
[
|
||
|
["route", "route-cli"],
|
||
|
["routed", "routed"],
|
||
|
["route-httpagent", "route-httpagent"],
|
||
|
].each { |x| run "cp /root/go/bin/#{x[0]} /usr/local/bin/#{x[1]}" }
|
||
|
|
||
|
run "apk del go1.9 && rm -rf /root/sdk /root/go"
|
||
|
flatten
|
||
|
|
||
|
tag "xena/route:latest"
|