common

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerUuidKey   = "docker_uuid"
	BuildDockerUuid = buildPath + "/" + DockerUuidKey
	SummaryId       = "build_id"

	CurrentStage = "current_stage"

	StartTime = "start_time"

	WerkerBuildMap = werkerBuildBase + "%s" // %s is hash

	WerkerIp   = werkerLocation + "/werker_ip"
	WerkerGrpc = werkerLocation + "/werker_grpc_port"
	WerkerWs   = werkerLocation + "/werker_ws_port"
	WerkerTags = werkerLocation + "/tags"
)
View Source
const BuildFileName = "ocelot.yml"

Variables

View Source
var (
	OcyConfigBase = GetPrefix() + "config/ocelot"
	StorageType   = OcyConfigBase + "/storagetype"

	PostgresCredLoc      = OcyConfigBase + "/postgres"
	PostgresDatabaseName = PostgresCredLoc + "/db"
	PostgresLocation     = PostgresCredLoc + "/location"
	PostgresPort         = PostgresCredLoc + "/port"
	PostgresUsername     = PostgresCredLoc + "/username"

	// For static DB connection info in vault
	PostgresPasswordLoc = "secret/data/" + PostgresCredLoc
	PostgresPasswordKey = "clientsecret"

	// For dynamic DB connection info in vault
	PostgresVaultConf          = PostgresCredLoc + "/vault"
	PostgresVaultRoleName      = PostgresVaultConf + "/rolename"
	PostgresVaultSecretsEngine = PostgresVaultConf + "/secretsengine"

	FilesystemConfigLoc = OcyConfigBase + "/filesystem"
	FilesystemDir       = FilesystemConfigLoc + "/savedirec"
	ConfigPath          = GetPrefix() + "creds"
)
View Source
var BitbucketEvents = []string{"repo:push", "pullrequest:approved", "pullrequest:updated"}

Functions

func Base64ToBitz

func Base64ToBitz(b64string string) ([]byte, error)

func BitzToBase64

func BitzToBase64(bits []byte) string

func BuildScriptsContainString

func BuildScriptsContainString(wc *pb.BuildConfig, desiredString string) bool

BuildScriptsContainString will check all stages' script lines for the existence of the specified desiredString

func CreateAcctRepo added in v0.8.0

func CreateAcctRepo(account, repo string) string

func GetAcctRepo

func GetAcctRepo(fullName string) (acct string, repo string, err error)

helper

func GetMapStringKeys added in v0.7.3

func GetMapStringKeys(stringMap map[string]bool) []string

helper for converting a quasi-set to an array of strings of the keys

func GetPrefix

func GetPrefix() string

func MakeBuildMapPath

func MakeBuildMapPath(gitHash string) string

func MakeBuildPath

func MakeBuildPath(werkerId string, gitHash string) string

func MakeBuildStagePath

func MakeBuildStagePath(werkerId string, gitHash string) string

func MakeBuildStartpath

func MakeBuildStartpath(werkerId string, gitHash string) string

func MakeBuildSummaryIdPath

func MakeBuildSummaryIdPath(werkerId string, gitHash string) string

func MakeBuildWerkerIdPath

func MakeBuildWerkerIdPath(werkerId string) string

func MakeDockerUuidPath

func MakeDockerUuidPath(werkerId string, gitHash string) string

func MakeWerkerGrpcPath

func MakeWerkerGrpcPath(werkerId string) string

func MakeWerkerIpPath

func MakeWerkerIpPath(werkerId string) string

func MakeWerkerLocPath

func MakeWerkerLocPath(werkerId string) string

func MakeWerkerTagsPath

func MakeWerkerTagsPath(werkerId string) string

func MakeWerkerWsPath

func MakeWerkerWsPath(werkerId string) string

func MaybeStrip

func MaybeStrip(output []byte, stripAnsi bool) []byte

func ParseBuildMapPath

func ParseBuildMapPath(path string) (hash string)

ParseBuildMapPath will return the git hash of the WerkerBuildMap key

ie: ci/werker_build_map/<hash>

func ParseGenericBuildPath

func ParseGenericBuildPath(buildPath string) (werkerId string, hash string, key string)

ParseGenericBuildPath will return the werkerId and hash out of a key related to the build path must be fully qualified key path, not prefix ie: ci/builds/<werkerId>/<hash>/docker_uuid

func ParseWerkerLocPath

func ParseWerkerLocPath(path string) (werkerId string)

ParseWerkerLocPath will return the werkerId from a werkerLocation path configured in Consul ie: ci/werker_location/<werkerId>/werker_ip must be fully qualified key path, not prefix

func StrToBase64

func StrToBase64(str string) string

Types

type FormatError

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

func BadFormat

func BadFormat(msg string) *FormatError

func (*FormatError) Error

func (f *FormatError) Error() string

type NoCreds

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

func NCErr

func NCErr(msg string) *NoCreds

func (*NoCreds) Error

func (n *NoCreds) Error() string

Directories

Path Synopsis
Package credentials is a generated GoMock package.
Package credentials is a generated GoMock package.
helpers
trigger contains the logic for determining whether or not stages and/or commits pushed to a given
trigger contains the logic for determining whether or not stages and/or commits pushed to a given

Jump to

Keyboard shortcuts

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