Skip to content

Commit da61f1c

Browse files
author
yuyang
committed
support -f flag
1 parent 428a812 commit da61f1c

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

Dotamfile.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var "versions" {
22
prod = "v0.1.1"
3-
release = "v0.1.44-beta"
3+
release = "v0.1.45-beta"
44
}
55

66
temp "version.go" {

TODO.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@
2626
- [ ] ! 自举
2727
- [ ] ! git 插件
2828
- [ ] git hook
29-
- [ ] ! docker 插件
29+
- [ ] !! docker 插件
3030
- [x] !! build
3131
- [x] !! push
32-
- [x] pass auth from command line
32+
- [x] ! pass auth from command line
33+
- [ ] !! support multi tags for pushing
34+
- [x] !! support specifying Dockerfile
35+
3336
- [ ] ! refactor code
3437
- [ ] !! caporal
3538
- [x] 创建容器

config.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ type Temp struct {
2121
}
2222

2323
type Docker struct {
24-
Repo string `json:"repo" hcl:"repo" yaml:"repo"`
25-
Tag string `json:"tag" hcl:"tag" yaml:"tag"`
26-
Auth Auth `json:"auth" hcl:"auth" yaml:"auth"`
27-
Caporal Caporal `json:"caporal" hcl:"caporal" yaml:"caporal"`
24+
Repo string `json:"repo" hcl:"repo" yaml:"repo"`
25+
Tag string `json:"tag" hcl:"tag" yaml:"tag"`
26+
Dockerfile string `json:"dockerfile,omitempty" hcl:"dockerfile,omitempty" yaml:"dockerfile,omitempty"`
27+
Auth Auth `json:"auth" hcl:"auth" yaml:"auth"`
28+
Caporal Caporal `json:"caporal" hcl:"caporal" yaml:"caporal"`
2829
}
2930

3031
// Caporal is a built-in plugin for scheduling containers remotely

util.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ func ParseBuildArgs(src []string) (dotamFile string, dest []string) {
181181

182182
func BuildImage(d Docker, c *docker.Client) (err error) {
183183

184+
dockerfile := ""
185+
if len(d.Dockerfile) != 0 {
186+
dockerfile = d.Dockerfile
187+
} else {
188+
dockerfile = "Dockerfile"
189+
}
184190
log.WithFields(log.Fields{"PROCESS": "DOCKER REPO"}).Debug(d.Repo)
185191
log.WithFields(log.Fields{"PROCESS": "DOCKER TAG"}).Debug(d.Tag)
186192
log.WithFields(log.Fields{"PROCESS": "DOCKER AUTH"}).Debug(d.Auth)
@@ -191,7 +197,7 @@ func BuildImage(d Docker, c *docker.Client) (err error) {
191197
if err = c.BuildImage(docker.BuildImageOptions{
192198
Name: imageName,
193199
ContextDir: ".",
194-
Dockerfile: "Dockerfile",
200+
Dockerfile: dockerfile,
195201
SuppressOutput: false,
196202
OutputStream: os.Stdout,
197203
RmTmpContainer: true,

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package main
22

3-
var RELEASE_VERSION = "v0.1.44-beta"
3+
var RELEASE_VERSION = "v0.1.45-beta"

0 commit comments

Comments
 (0)