mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-18 12:42:19 +00:00
Finish pushing tag
This commit is contained in:
@@ -163,13 +163,13 @@ var release = &cobra.Command{
|
||||
} else if !noDryRun {
|
||||
logInfo("Skipping push module %s. Run with --no-dry-run to push the release.", mod.name)
|
||||
} else {
|
||||
// TODO: Push tags
|
||||
pushRelease(tempDir, branch, mod)
|
||||
}
|
||||
// Clean
|
||||
cleanGit()
|
||||
pruneWorktree(pwd)
|
||||
deleteBranch(pwd, branch)
|
||||
logInfo("Done")
|
||||
logInfo("Module %s completes", mod.name)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -442,3 +442,33 @@ func merge(path, branch string) {
|
||||
}
|
||||
logInfo("Finished merging")
|
||||
}
|
||||
|
||||
func pushRelease(path, branch string, mod module) {
|
||||
logInfo("Pushing branch %s", branch)
|
||||
cmd := exec.Command("git", "push", "upstream", branch)
|
||||
cmd.Dir = path
|
||||
stdoutStderr, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
logFatal(string(stdoutStderr))
|
||||
}
|
||||
|
||||
logInfo("Creating tag %s", mod.Tag())
|
||||
cmd = exec.Command(
|
||||
"git", "tag",
|
||||
"-a", mod.Tag(),
|
||||
"-m", fmt.Sprintf("Release %s on branch %s", mod.Tag(), branch),
|
||||
)
|
||||
cmd.Dir = path
|
||||
stdoutStderr, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
logFatal(string(stdoutStderr))
|
||||
}
|
||||
|
||||
logInfo("Pushing tag %s", mod.Tag())
|
||||
cmd = exec.Command("git", "push", "upstream", mod.Tag())
|
||||
cmd.Dir = path
|
||||
stdoutStderr, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
logFatal(string(stdoutStderr))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user