func (rb *RepoBuilder) Build(force bool) error { fmt.Fprintf(rb.writer, " %s (%s)\n", BuildFile, rb.R.Gitr()) custom, err := rb.custom() if err != nil { return err } rb.BP.custom = custom if _, err = os.Stat(rb.BP.custom); err == nil { return provision.ExecuteCommandOnce(strings.Fields(rb.BP.custom), rb.writer) } if _, err = os.Stat(rb.BP.platform); err == nil { return provision.ExecuteCommandOnce(strings.Fields(rb.BP.platform), rb.writer) } fmt.Fprintf(rb.writer, " %s (%s) failed\n", BuildFile, rb.R.Gitr()) return ErrBuildableNotFound }
fmt.Fprintf(args.writer, " generate solo config for box failed.\n%s\n", err.Error()) return err, nil } fmt.Fprintf(args.writer, " generate solo config for box (%s) OK\n", args.box.GetFullName()) return nil, nil }, Backward: func(ctx action.BWContext) { }, } var chefSoloRun = action.Action{ Name: "chef-solo-run", Forward: func(ctx action.FWContext) (action.Result, error) { args := ctx.Params[0].(runMachineActionsArgs) fmt.Fprintf(args.writer, " chefsolo run started.\n") err := provision.ExecuteCommandOnce(args.provisioner.Command(), args.writer) if err != nil { fmt.Fprintf(args.writer, " chefsolo run ended failed.\n%s\n", err.Error()) return nil, err } fmt.Fprintf(args.writer, " chefsolo run OK.\n") return &args, err }, Backward: func(ctx action.BWContext) { }, } var cloneBox = action.Action{ Name: "clone-box", Forward: func(ctx action.FWContext) (action.Result, error) { args := ctx.Params[0].(runMachineActionsArgs)