Skip to content

Commit c042117

Browse files
author
yuyang
committed
support logDriver flag
testting....
1 parent 3698ecd commit c042117

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

cli/git.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package cli
2+
3+
import (
4+
"github.com/mitchellh/cli"
5+
log "github.com/sirupsen/logrus"
6+
)
7+
8+
func GitCMDFactor() (cli.Command, error) {
9+
return InitCmd{}, nil
10+
}
11+
12+
type GitCmd struct {
13+
}
14+
15+
func (r GitCmd) Help() string {
16+
return "this is help message"
17+
}
18+
19+
func (r GitCmd) Run(args []string) (exitCode int) {
20+
log.Debug(args)
21+
22+
return
23+
}
24+
25+
func (r GitCmd) Synopsis() string {
26+
return string(`this cmd is used by git's commit-msg hook`)
27+
}

conf/config.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ type Docker struct {
3131
Tag string `json:"tag" hcl:"tag" yaml:"tag"`
3232
Dockerfile string `json:"dockerfile,omitempty" hcl:"dockerfile,omitempty" yaml:"dockerfile,omitempty"`
3333
BuildArgs []BuildArg `json:"buildArgs,omitempty" hcl:"buildArgs,omitempty" yaml:"buildArgs,omitempty"`
34-
Auth Auth `json:"auth" hcl:"auth" yaml:"auth"`
34+
Auth Auth `json:"auth,omitempty" hcl:"auth,omitempty" yaml:"auth,omitempty"`
3535
NotPrivate bool `json:"notPrivate,omitempty" hcl:"notPrivate,omitempty" yaml:"notPrivate,omitempty"`
36-
Caporal Caporal `json:"caporal" hcl:"caporal" yaml:"caporal"`
36+
Caporal Caporal `json:"caporal,omitempty" hcl:"caporal,omitempty" yaml:"caporal,omitempty"`
3737
}
3838

3939
// BuildArg the docker --build-args
@@ -51,9 +51,10 @@ type Caporal struct {
5151

5252
// CaporalOptions are flags for docker run
5353
type CaporalOptions struct {
54-
Publish []string `json:"publish" hcl:"publish" yaml:"publish"`
55-
Network string `json:"network" hcl:"network" yaml:"network"`
56-
Mount []HostMount `json:"mount" hcl:"mount" yaml:"mount"`
54+
Publish []string `json:"publish,omitempty" hcl:"publish,omitempty" yaml:"publish,omitempty"`
55+
Network string `json:"network,omitempty" hcl:"network,omitempty" yaml:"network,omitempty"`
56+
Mount []HostMount `json:"mount,omitempty" hcl:"mount,omitempty" yaml:"mount,omitempty"`
57+
LogDriver docker.LogConfig `json:"logDriver,omitempty" hcl:"logDriver,omitempty" yaml:"logDriver,omitempty"`
5758
}
5859
type HostMount struct {
5960
Bind string `json:"bind" hcl:"bind" yaml:"bind"`

0 commit comments

Comments
 (0)