Ejemplo n.º 1
0
func createTaskRunner(bg *baseGroup) (*system.TaskRunner, error) {
	log.Printf("Creating and running sub tasks")

	list, err := system.System.NewTasksFromArray(bg.subTasks)
	if err != nil {
		return nil, err
	}

	tr := system.NewTaskRunner(list)
	return tr, nil
}
Ejemplo n.º 2
0
func main() {
	path := flag.String("config", "", "Relative path to configuration")
	flag.Parse()

	tasks.Do()

	config, err := system.System.Read(*path)
	if err != nil {
		log.Printf("ERROR, %v", err)
		os.Exit(1)
	}

	log.Printf("Creating tasks")
	tasks, err := system.System.NewTasksFromConfig(config)
	if err != nil {
		log.Fatalf("Could not create tasks, %v", err)
	}

	log.Printf("Running %v tasks", tasks.Len())
	tr := system.NewTaskRunner(tasks)
	tr.Run()
}