Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cli.Command{ Name: "build", Usage: "Builds the current project", Aliases: []string{"b"}, Flags: []cli.Flag{ &cli.StringFlag{Name: "config", Aliases: []string{"c"}, Value: ".rain.yml", Usage: "Load configuration from file"}, &cli.IntFlag{Name: "parallelism", Value: 2, Usage: "number of tasks running concurrently"}, &cli.DurationFlag{Name: "timeout", Value: 10 * time.Minute, Usage: "timeout to the entire push process", DefaultText: "10 minutes"}, &cli.BoolFlag{Name: "rm-dist", Value: false, Usage: "remove the dist folder before build"}, }, Action: func(c *cli.Context) error { start := time.Now() log.Infof(color.New(color.Bold).Sprint("building...")) conf := c.String("config") cfg, err := config.Load(conf) if err != nil { return err } ctx, cancel := context.NewWithTimeout(cfg, c.Duration("timeout")) defer cancel() setupPushContext(ctx, c) err = ctrlc.Default.Run(ctx, func() error { for _, pipe := range pipeline.BuildPipeline { if err := middleware.Log( pipe.String(), middleware.ErrHandler(pipe.Run), middleware.DefaultInitialPadding, )(ctx); err != nil { return err } } return nil }) if err != nil { return errors.Wrap(err, color.New(color.Bold).Sprintf("build failed after %0.2fs", time.Since(start).Seconds())) } log.Infof(color.New(color.Bold).Sprintf("build succeeded after %0.2fs", time.Since(start).Seconds())) return nil }, }
Command build
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.