mirror of
https://github.com/drone/drone-kaniko.git
synced 2026-06-04 18:23:49 +08:00
add flag --no-push (#21)
This commit is contained in:
@@ -26,6 +26,7 @@ type (
|
||||
CacheRepo string // Remote repository that will be used to store cached layers
|
||||
CacheTTL int // Cache timeout in hours
|
||||
DigestFile string // Digest file location
|
||||
NoPush bool // Set this flag if you only want to build the image, without pushing to a registry
|
||||
}
|
||||
// Artifact defines content of artifact file
|
||||
Artifact struct {
|
||||
@@ -34,7 +35,6 @@ type (
|
||||
Registry string // Docker artifact registry
|
||||
RegistryType artifact.RegistryTypeEnum // Rocker artifact registry type
|
||||
ArtifactFile string // Artifact file location
|
||||
|
||||
}
|
||||
|
||||
// Plugin defines the Docker plugin parameters.
|
||||
@@ -100,6 +100,10 @@ func (p Plugin) Exec() error {
|
||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--digest-file=%s", p.Build.DigestFile))
|
||||
}
|
||||
|
||||
if p.Build.NoPush {
|
||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--no-push"))
|
||||
}
|
||||
|
||||
cmd := exec.Command("/kaniko/executor", cmdArgs...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
Reference in New Issue
Block a user