buildRelease = flag.Bool("release", false, "Build and upload binary release archives")
buildRevision = flag.String("rev", "", "Build specified revision and exit")
buildCmd = flag.String("cmd", filepath.Join(".", allCmd), "Build command (specify relative to go/src/)")
+ failAll = flag.Bool("fail", false, "fail all builds")
external = flag.Bool("external", false, "Build external packages")
parallel = flag.Bool("parallel", false, "Build multiple targets in parallel")
verbose = flag.Bool("v", false, "verbose")
}
builders[i] = b
}
+
+ if *failAll {
+ failMode(builders)
+ return
+ }
// set up work environment
if err := os.RemoveAll(*buildroot); err != nil {
}
}
+// go continuous fail mode
+// check for new commits and FAIL them
+func failMode(builders []*Builder) {
+ for {
+ built := false
+ for _, b := range builders {
+ built = b.failBuild() || built
+ }
+ // stop if there was nothing to fail
+ if !built {
+ break
+ }
+ }
+}
+
func NewBuilder(builder string) (*Builder, error) {
b := &Builder{name: builder}
return nil
}
+// failBuild checks for a new commit for this builder
+// and fails it if one is found.
+// It returns true if a build was "attempted".
+func (b *Builder) failBuild() bool {
+ hash, err := b.todo("build-go-commit", "", "")
+ if err != nil {
+ log.Println(err)
+ return false
+ }
+ if hash == "" {
+ return false
+ }
+
+ log.Printf("fail %s %s\n", b.name, hash)
+
+ if err := b.recordResult(false, "", hash, "", "auto-fail mode run by " + os.Getenv("USER"), 0); err != nil {
+ log.Print(err)
+ }
+ return true
+}
+
func (b *Builder) buildSubrepos(goRoot, goHash string) {
for _, pkg := range dashboardPackages("subrepo") {
// get the latest todo for this package