-
Notifications
You must be signed in to change notification settings - Fork 3
/
pull.go
43 lines (35 loc) · 1.13 KB
/
pull.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package cmd
import (
"github.com/spf13/cobra"
"github.com/get-bridge/muss/config"
)
func newPullCommand(cfg *config.ProjectConfig) *cobra.Command {
var cmd = &cobra.Command{
Use: "pull",
Short: "Pull the latest images for services",
Long: `Pulls docker images for defined services but does not start the containers.
`,
Args: cobra.ArbitraryArgs,
// TODO: ArgsInUseLine: "[service...]"
PreRunE: configSavePreRun(cfg),
RunE: func(cmd *cobra.Command, args []string) error {
// TODO: pull repos
delegator := cmdDelegator(cmd)
err := delegator.FilterStderr(newDCErrorFilter(cfg))
if err != nil {
return err
}
return delegator.Delegate(
dockerComposeCmd(cmd, args),
)
},
}
cmd.Flags().BoolP("ignore-pull-failures", "", false, "Pull what it can and ignores images with pull failures.")
cmd.Flags().BoolP("no-parallel", "", false, "Disable parallel pulling.")
cmd.Flags().BoolP("quiet", "q", false, "Pull without printing progress information.")
cmd.Flags().BoolP("include-deps", "", false, "Also pull services declared as dependencies.")
return cmd
}
func init() {
AddCommandBuilder(newPullCommand)
}