Added install task to make.go
This commit is contained in:
parent
4977375d33
commit
dafa042e76
1 changed files with 32 additions and 0 deletions
32
make.go
32
make.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue