internal

package
v1.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckChangelogEntry

func CheckChangelogEntry(changelogPath, tag string) error

CheckChangelogEntry returns an error if the given tag has no entry in the CHANGELOG.md found at changelogPath. It looks for a line starting with "## [<tag>]" (case-insensitive bracket match).

func Confirm

func Confirm(prompt string) bool

func CopyFile added in v1.11.0

func CopyFile(src, dst string) error

CopyFile copies a single file from src to dst, creating parent directories as needed.

func EnsureDockerDeploymentChangelogEntry added in v1.13.0

func EnsureDockerDeploymentChangelogEntry(changelogPath, tag, apiTag, webTag string) error

EnsureDockerDeploymentChangelogEntry checks whether the given tag already has an entry in the devguard-docker-deployment CHANGELOG.md at changelogPath. If not, it asks the user whether nothing changed in the deployment itself besides the bundled image versions; if approved, it generates and inserts a changelog entry documenting just those image bumps. If declined, it returns an error so the release can be aborted for a manual entry.

func EnsureHelmChangelogEntry added in v1.12.3

func EnsureHelmChangelogEntry(changelogPath, tag, apiTag, webTag, ciComponentsTag, kratosTag, postgresqlTag string) error

EnsureHelmChangelogEntry checks whether the given tag already has an entry in the Helm chart's CHANGELOG.md at changelogPath. If not, it asks the user whether nothing changed in the chart itself besides the bundled image versions; if approved, it generates and inserts a changelog entry documenting just those image bumps. If declined, it returns an error so the release can be aborted for a manual entry.

func GitAdd

func GitAdd(dir string, paths ...string) error

func GitCheckoutMain

func GitCheckoutMain(dir string) error

func GitCommit

func GitCommit(dir, msg string) error

func GitDirtyPaths added in v1.11.0

func GitDirtyPaths(dir, pathPrefix string) (string, error)

GitDirtyPaths returns the porcelain status lines for paths under the given path prefix (relative to dir's repo root), or empty if none are dirty.

func GitIsClean

func GitIsClean(dir string) (bool, error)

func GitLatestTagWithMinor

func GitLatestTagWithMinor(dir, minor string) (string, error)

GitLatestTagWithMinor returns the most recent tag in dir whose minor version matches the given minor string (e.g. "1.7"). Returns "" if none found.

func GitPull

func GitPull(dir string) error

func GitPush

func GitPush(dir string) error

func GitPushTags

func GitPushTags(dir string)

func GitRun

func GitRun(dir string, args ...string) error

GitRun runs a git command in dir, forwarding stdout/stderr to the terminal.

func GitTagExists

func GitTagExists(dir, tag string) (bool, error)

func GitTagSigned

func GitTagSigned(dir, tag string) error

func MinorVersion

func MinorVersion(tag string) string

MinorVersion extracts the "MAJOR.MINOR" prefix from a semver tag like "v1.7.3" → "1.7".

func NixVersion added in v1.14.0

func NixVersion(path string) (string, error)

NixVersion reads the `version = "..."` assignment pinning the vendored upstream version out of a nix file (e.g. nix/kratos.nix, nix/postgresql.nix).

func ReplaceInFile

func ReplaceInFile(path, old, new string) (bool, error)

ReplaceInFile replaces all occurrences of old with new in the file at path. Returns whether the file was modified.

func ReplaceLineInFile

func ReplaceLineInFile(path string, transform func(line string) string) (bool, error)

ReplaceLineInFile applies a per-line transform and writes back if changed.

func RunCommand added in v1.11.0

func RunCommand(dir, name string, args ...string) error

RunCommand runs an arbitrary command in dir, forwarding stdout/stderr to the terminal.

func StripPackageRevision added in v1.14.0

func StripPackageRevision(version string) string

StripPackageRevision drops a trailing apk-style "-rN" revision suffix (e.g. "16.15-r0" -> "16.15"), as pinned by nix/postgresql.nix. The published ghcr.io tag for that image omits the revision — it's a floating tag re-pushed on every build, so it always points at the latest image for that version.

func ValidateTag

func ValidateTag(tag string) (semver string, err error)

Types

type Changelog

type Changelog struct {
	// contains filtered or unexported fields
}

func (*Changelog) Change

func (c *Changelog) Change(msg string)

func (*Changelog) Fail

func (c *Changelog) Fail(msg string)

func (*Changelog) HasErrors

func (c *Changelog) HasErrors() bool

func (*Changelog) PrintSummary

func (c *Changelog) PrintSummary(title string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL