branching

package
v0.0.0-...-29f19f2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package branching implements logic to detect SCM branch, either via launching SCM tool or via environment variables (mostly for CI/CD systems)

Index

Constants

View Source
const (
	EnvVariableBamboo  = "planRepository_branchDisplayName"
	EnvVariableJenkins = "GIT_BRANCH"
)

Variables

View Source
var AllowFallbackDetection = true

AllowFallbackDetection Is fallback on detection methods allowed, or we do only one?

View Source
var (
	CommandRunner = TCommandRunner{&external.TCommand{}}
)

Functions

func GetBranchName

func GetBranchName(c *typeconfig.TypeConfig) (string, error)

GetBranchName Returns the branch name, based on the mechanisms defined in the configuration

func GetDetectionOrder

func GetDetectionOrder() uniquestringlist.UniqueStringList

GetDetectionOrder Retrieve detection order as a list of strings

func GetYearWeek

func GetYearWeek(c *typeconfig.TypeConfig) string

func SetDetectionOrder

func SetDetectionOrder(methods ...string) error

SetDetectionOrder Set detection order from the list of strings

Types

type TCommandLine

type TCommandLine struct {
	Command string
	Params  string
}

func CommandGit

func CommandGit() TCommandLine

type TCommandRunner

type TCommandRunner struct {
	Command external.ICommand
}

Jump to

Keyboard shortcuts

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