utils

package
v2.0.23+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BashCmdExec

func BashCmdExec(cmd string, workingDir string, environ []string, logPrefix string) error

func CmdExec

func CmdExec(cmdName string, cmdArgs []string, workingDir string, environ []string, logPrefix string) error

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func FileExists

func FileExists(filePath string) bool

func GitCheckout

func GitCheckout(repoPath string, branchName string) error

func GitClone

func GitClone(parentPath string, repositoryName string, gitRemote string) (string, error)

Clone a git repo into a local directory. Credentials need to be specified by embedding in gitRemote url. TODO: this pattern may not work on Bitbucket/GitLab

func GitCommit

func GitCommit(repoPath string, message string) error

Add all modified files to index, and commit.

func GitFindNearestTagName

func GitFindNearestTagName(repoPath string) (string, error)

Get the nearest tag on branch. tag must be nearest, ie. sorted by their distance from the HEAD of the branch, not the date or tagname. basically `git describe --tags --abbrev=0`

func GitGenerateChangelog

func GitGenerateChangelog(repoPath string, baseSha string, headSha string) (string, error)

func GitGenerateGitIgnore

func GitGenerateGitIgnore(repoPath string, ignoreType string) error

func GitGetTagDetails

func GitGetTagDetails(repoPath string, tagName string) (*pipeline.GitTagDetails, error)

func GitPush

func GitPush(repoPath string, localBranch string, remoteBranch string, tagName string) error

func GitTag

func GitTag(repoPath string, version string) (string, error)

func LeftPad

func LeftPad(s string, padStr string, pLen int) string

func LeftPad2Len

func LeftPad2Len(s string, padStr string, overallLen int) string

func RightPad

func RightPad(s string, padStr string, pLen int) string

func RightPad2Len

func RightPad2Len(s string, padStr string, overallLen int) string

func SnakeCaseToCamelCase

func SnakeCaseToCamelCase(inputUnderScoreStr string) (camelCase string)

func StripIndent

func StripIndent(multilineStr string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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