Added install task to make.go

This commit is contained in:
Thomas Boerger 2015-09-16 11:25:58 +02:00
parent 4977375d33
commit dafa042e76

32
make.go
View file

@ -31,6 +31,7 @@ var steps = map[string]step{
"fmt": executeFmt, "fmt": executeFmt,
"test": executeTest, "test": executeTest,
"build": executeBuild, "build": executeBuild,
"install": executeInstall,
"image": executeImage, "image": executeImage,
"bindata": executeBindata, "bindata": executeBindata,
"clean": executeClean, "clean": executeClean,
@ -209,6 +210,37 @@ func executeTest() error {
"github.com/drone/drone/cmd/...") "github.com/drone/drone/cmd/...")
} }
// install step installs the application binaries.
func executeInstall() error {
var bins = []struct {
input string
}{
{
"github.com/drone/drone/cmd/drone-server",
},
}
for _, bin := range bins {
ldf := fmt.Sprintf(
"-X main.revision=%s -X main.version=%s",
sha,
version)
err := run(
"go",
"install",
"-ldflags",
ldf,
bin.input)
if err != nil {
return err
}
}
return nil
}
// build step creates the application binaries. // build step creates the application binaries.
func executeBuild() error { func executeBuild() error {
var bins = []struct { var bins = []struct {