Skip to content

Commit e22897f

Browse files
author
yuyang
committed
add supporting for volume bind of caporal
1 parent 0ec078a commit e22897f

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

Dotamfile.hcl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ git "dev" {
3333
name = "dotam"
3434
opts {
3535
publish = ["8080:8080"]
36+
mount = [
37+
{
38+
bind = "/tmp/foo:/tmp/foo"
39+
type = "bind"
40+
}
41+
]
42+
3643
}
3744
}
3845
}

TODO.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
- [x] hcl
2121
- [x] !! init命令
2222
- [ ] !! 文档
23-
- [ ] template syntax
24-
- [ ] en
25-
- [ ] zh
23+
- [x] template syntax
24+
- [x] en
25+
- [x] zh
2626
- [ ] ! 自举
2727
- [ ] ! git 插件
2828
- [ ] git hook
@@ -31,6 +31,16 @@
3131
- [x] !! push
3232
- [x] pass auth from command line
3333
- [ ] ! refactor code
34+
- [ ] !! caporal
35+
- [x] 创建容器
36+
- [x] 更新容器
37+
- [x] 指定网络
38+
- [x] 指定volume
39+
- [ ] more opts support
40+
41+
- [ ] !!三方插件支持
42+
43+
- [ ] ! 完善日志
3444
- [x] !! build args
3545
- [x] ! 参数及conf文件自动解析
3646

config.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ type Caporal struct {
3636

3737
// CaporalOptions are flags for docker run
3838
type CaporalOptions struct {
39-
Publish []string `json:"publish" hcl:"publish" yaml:"publish"`
40-
Network string `json:"network" hcl:"network" yaml:"network"`
39+
Publish []string `json:"publish" hcl:"publish" yaml:"publish"`
40+
Network string `json:"network" hcl:"network" yaml:"network"`
41+
Mount []HostMount `json:"mount" hcl:"mount" yaml:"mount"`
42+
}
43+
type HostMount struct {
44+
Bind string `json:"bind" hcl:"bind" yaml:"bind"`
45+
Type string `json:"type" hcl:"type" yaml:"type"`
4146
}
4247

4348
type Auth struct {

util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func RunTasks(conf DotamConf) (err error) {
8888
}
8989

9090
if err = ProcessDocker(conf.Docker); err != nil {
91+
log.Error(err)
9192
return
9293
}
9394

0 commit comments

Comments
 (0)