mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-19 02:33:21 +00:00
Merge remote-tracking branch 'upstream/0.4.0' into 0.4.0
This commit is contained in:
28
make.go
28
make.go
@@ -13,6 +13,8 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/jteeuwen/go-bindata"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -28,6 +30,7 @@ var steps = map[string]step{
|
|||||||
"json": json,
|
"json": json,
|
||||||
"embed": embed,
|
"embed": embed,
|
||||||
"vet": vet,
|
"vet": vet,
|
||||||
|
"bindata": bindat,
|
||||||
"build": build,
|
"build": build,
|
||||||
"test": test,
|
"test": test,
|
||||||
"image": image,
|
"image": image,
|
||||||
@@ -76,6 +79,29 @@ func json() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bindata step generates go-bindata package.
|
||||||
|
func bindat() error {
|
||||||
|
var paths = []struct {
|
||||||
|
input string
|
||||||
|
recursive bool
|
||||||
|
}{
|
||||||
|
{"cmd/drone-server/static", true},
|
||||||
|
}
|
||||||
|
|
||||||
|
c := bindata.NewConfig()
|
||||||
|
c.Output = "cmd/drone-server/drone_bindata.go"
|
||||||
|
c.Input = make([]bindata.InputConfig, len(paths))
|
||||||
|
|
||||||
|
for i, path := range paths {
|
||||||
|
c.Input[i] = bindata.InputConfig{
|
||||||
|
Path: path.input,
|
||||||
|
Recursive: path.recursive,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return bindata.Translate(c)
|
||||||
|
}
|
||||||
|
|
||||||
// build step creates the application binaries.
|
// build step creates the application binaries.
|
||||||
func build() error {
|
func build() error {
|
||||||
var bins = []struct {
|
var bins = []struct {
|
||||||
@@ -87,7 +113,7 @@ func build() error {
|
|||||||
{"github.com/drone/drone/cmd/drone-build", "bin/drone-build"},
|
{"github.com/drone/drone/cmd/drone-build", "bin/drone-build"},
|
||||||
}
|
}
|
||||||
for _, bin := range bins {
|
for _, bin := range bins {
|
||||||
ldf := fmt.Sprintf("-X main.revision %s -X main.version %s", sha, version)
|
ldf := fmt.Sprintf("-X main.revision=%s -X main.version=%s", sha, version)
|
||||||
cmd := exec.Command("go", "build", "-o", bin.output, "-ldflags", ldf, bin.input)
|
cmd := exec.Command("go", "build", "-o", bin.output, "-ldflags", ldf, bin.input)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
|
Reference in New Issue
Block a user