common

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CIProviderBitrise ...
	CIProviderBitrise = "bitrise"
	// CIProviderCircleCI ...
	CIProviderCircleCI = "circle-ci"
	// CIProviderGitHubActions ...
	CIProviderGitHubActions = "github-actions"
)

Variables

View Source
var (
	ErrAuthTokenNotProvided   = errors.New("BITRISE_BUILD_CACHE_AUTH_TOKEN or BITRISEIO_BITRISE_SERVICES_ACCESS_TOKEN environment variable not set")
	ErrWorkspaceIDNotProvided = errors.New("BITRISE_BUILD_CACHE_WORKSPACE_ID environment variable not set")
)

Functions

func SelectCacheEndpointURL added in v0.15.12

func SelectCacheEndpointURL(endpointURL string, envs map[string]string) string

SelectCacheEndpointURL - if endpointURL provided use that, otherwise select the best build cache endpoint automatically

func SelectRBEEndpointURL added in v0.15.12

func SelectRBEEndpointURL(endpointURL string, envs map[string]string) string

SelectRBEEndpointURL - if endpointURL provided use that, otherwise select the RBE endpoint from environment

Types

type CacheAuthConfig

type CacheAuthConfig struct {
	AuthToken   string
	WorkspaceID string
}

CacheAuthConfig holds the auth config for the cache.

func ReadAuthConfigFromEnvironments

func ReadAuthConfigFromEnvironments(envs map[string]string) (CacheAuthConfig, error)

ReadAuthConfigFromEnvironments reads auth information from the environment variables

func (CacheAuthConfig) TokenInGradleFormat

func (cac CacheAuthConfig) TokenInGradleFormat() string

TokenInGradleFormat returns the auth token in gradle format.

type CacheConfigMetadata added in v0.7.0

type CacheConfigMetadata struct {
	CIProvider   string
	CLIVersion   string
	RedactedEnvs map[string]string
	HostMetadata HostMetadata
	GitMetadata  GitMetadata
	// BitriseCI specific
	BitriseAppID           string
	BitriseWorkflowName    string
	BitriseBuildID         string
	BitriseStepExecutionID string
	Datacenter             string
}

func NewMetadata added in v0.16.10

func NewMetadata(envs map[string]string, commandFunc CommandFunc, logger log.Logger) CacheConfigMetadata

NewMetadata creates a new CacheConfigMetadata instance based on the environment variables.

type CommandFunc added in v0.15.23

type CommandFunc func(string, ...string) (string, error)

type GitMetadata added in v1.0.2

type GitMetadata struct {
	RepoURL     string
	CommitHash  string
	Branch      string
	CommitEmail string
}

type HostMetadata added in v0.15.23

type HostMetadata struct {
	OS             string
	CPUCores       int
	MemSize        int64
	Locale         string
	DefaultCharset string
	Hostname       string
	Username       string
}

HostMetadata contains metadata about the local environment. Only used for Bazel to generate bazelrc. For Gradle, it's done by the plugin dynamically.

Jump to

Keyboard shortcuts

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