// BuildMultiple builds a list of stackerfiles
BuildMultiple builds a list of stackerfiles
// BuildMultiple builds a list of stackerfiles
func (b *Builder) BuildMultiple(paths []string) error {
	opts := b.opts
	s, err := NewStorage(opts.Config)
	if err != nil {
		return err
	}
	if !opts.LeaveUnladen {
		defer s.Detach()
	}
	stackerFiles, err := types.NewStackerFiles(paths, append(opts.Substitute, b.opts.Config.Substitutions()...))
	if err != nil {
		return err
	}
	dag, err := NewStackerFilesDAG(stackerFiles)
	if err != nil {
		return err
	}
	sortedPaths := dag.Sort()
	log.Debugf("stacker build order:")
	for i, p := range sortedPaths {
		prerequisites, err := dag.GetStackerFile(p).Prerequisites()
		if err != nil {
			return err
		}
		log.Debugf("%d build %s: requires: %v", i, p, prerequisites)
	}
	if opts.OrderOnly {
		return nil
	}
	for i, p := range sortedPaths {
		log.Debugf("building: %d %s", i, p)
		err = b.Build(s, p)
		if err != nil {
			return err
		}
	}
	return nil
}
func ( b * Builder ) BuildMultiple ( paths [ ] string ) error { opts := b . opts s , err := NewStorage ( opts . Config ) if err != nil { return err } if ! opts . LeaveUnladen { defer s . Detach ( ) } stackerFiles , err := types . NewStackerFiles ( paths , append ( opts . Substitute , b . opts . Config . Substitutions ( ) ... ) ) if err != nil { return err } dag , err := NewStackerFilesDAG ( stackerFiles ) if err != nil { return err } sortedPaths := dag . Sort ( ) log . Debugf ( " " ) for i , p := range sortedPaths { prerequisites , err := dag . GetStackerFile ( p ) . Prerequisites ( ) if err != nil { return err } log . Debugf ( " " , i , p , prerequisites ) } if opts . OrderOnly { return nil } for i , p := range sortedPaths { log . Debugf ( " " , i , p ) err = b . Build ( s , p ) if err != nil { return err } } return nil }
BuildMultiple builds a list of stackerfiles
BuildMultiple builds a list of stackerfiles
// Read all the stacker recipes // Initialize the DAG // Show the serial build order // User has requested only to see the build order, so skipping the actual build // Build all Stackerfiles