util

package
v0.0.0-...-c0404c8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(repo string, dep model.Dependency, dest string) error

func CopyDir

func CopyDir(src, dst string) error

func CopyDirFiltered

func CopyDirFiltered(src, dst string, include []string) error

CopyDirFiltered copies a directory, but only includes files that match given patterns

func CopyFile

func CopyFile(src, dst string) error

func CopyFilesToDir

func CopyFilesToDir(src, dst string) error

CopyFilesToDir copies all files in one directory to another

func CreatePR

func CreatePR(manifest model.Manifest, repo, newBranchName, commitString, description string, dryrun bool, githubToken, git, branch string,
	labels []string,
) error

CreatePR will look for changes. If changes exist, it will create a branch and push a commit with the specified commit text, and then create a PR in the upstream repo.

func CreateSha

func CreateSha(src string) error

CreateSha will create and write a sha256sum of a file

func FetchAuto

func FetchAuto(repo string, dep *model.Dependency, dest string) error

FetchAuto looks up the SHA to use for the dependency from istio/istio

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists

func GetGithubToken

func GetGithubToken(file string) (string, error)

GetGithubToken returns the GitHub token from the specified file. If the filename isn't specified, it will return the token set in the GITHUB_TOKEN environment variable.

func IsValidSemver

func IsValidSemver(v string) bool

IsValidSemver checks if the string is a valid semver Mirror https://github.com/helm/helm/blob/9fafb4ad6811afb017cc464b630be2ff8390ac63/pkg/chart/metadata.go#L144

func PushCommit

func PushCommit(manifest model.Manifest, repo, branch, commitString string, dryrun bool, githubToken string, user github.User) (changes bool, err error)

PushCommit will look for changes. If changes exist, it will create a branch and push a commit with the specified commit text to the upstremam repo.

func RunMake

func RunMake(manifest model.Manifest, repo string, env []string, c ...string) error

RunMake runs a make command for the repo, with standard environment variables set

func RunWithOutput

func RunWithOutput(name string, arg ...string) (string, error)

RunWithOutput runs a command, outputting stderr and stdout, and returning the command's stdout

func StandardEnv

func StandardEnv(manifest model.Manifest) []string

func VerboseCommand

func VerboseCommand(name string, arg ...string) *exec.Cmd

VerboseCommand runs a command, outputting stderr and stdout

func YamlLog

func YamlLog(prefix string, i interface{})

YamlLog logs a object as yaml

func ZipFolder

func ZipFolder(source, target string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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