mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 10:10:39 +00:00
Renaming use_cache to pull_image
This commit is contained in:
parent
5d96ed01d2
commit
8551bcc59f
3
.gitignore
vendored
3
.gitignore
vendored
@ -26,6 +26,3 @@ _testmain.go
|
||||
|
||||
coverage.out
|
||||
drone-docker
|
||||
|
||||
# IDE/Editor related files
|
||||
**.swp
|
||||
|
8
main.go
8
main.go
@ -119,9 +119,9 @@ func main() {
|
||||
EnvVar: "PLUGIN_SQUASH",
|
||||
},
|
||||
cli.BoolTFlag{
|
||||
Name: "cache",
|
||||
Usage: "don't attempt to re-build layers of the image that already exist",
|
||||
EnvVar: "PLUGIN_USE_CACHE",
|
||||
Name: "pull-image",
|
||||
Usage: "force pull base image at build time",
|
||||
EnvVar: "PLUGIN_PULL_IMAGE",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "compress",
|
||||
@ -177,7 +177,7 @@ func run(c *cli.Context) error {
|
||||
Tags: c.StringSlice("tags"),
|
||||
Args: c.StringSlice("args"),
|
||||
Squash: c.Bool("squash"),
|
||||
Cache: c.Bool("cache"),
|
||||
Pull: c.BoolT("pull-image"),
|
||||
Compress: c.Bool("compress"),
|
||||
Repo: c.String("repo"),
|
||||
},
|
||||
|
12
plugin.go
12
plugin.go
@ -47,7 +47,7 @@ type (
|
||||
Tags []string // Docker build tags
|
||||
Args []string // Docker build args
|
||||
Squash bool // Docker build squash
|
||||
Cache bool // Docker build without pulling
|
||||
Pull bool // Docker build pull
|
||||
Compress bool // Docker build compress
|
||||
Repo string // Docker build repository
|
||||
}
|
||||
@ -186,7 +186,7 @@ func commandInfo() *exec.Cmd {
|
||||
|
||||
// helper function to create the docker build command.
|
||||
func commandBuild(build Build) *exec.Cmd {
|
||||
args := []string {
|
||||
args := []string{
|
||||
"build",
|
||||
"--rm=true",
|
||||
"-f", build.Dockerfile,
|
||||
@ -200,11 +200,9 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
if build.Compress {
|
||||
args = append(args, "--compress")
|
||||
}
|
||||
if build.Cache {
|
||||
args = append(args, "--pull=false")
|
||||
} else {
|
||||
args = append(args, "--pull=true")
|
||||
}
|
||||
if build.Pull {
|
||||
args = append(args, "--pull=true")
|
||||
}
|
||||
for _, arg := range build.Args {
|
||||
args = append(args, "--build-arg", arg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user