configs

package
v2.30.5 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CIModeEnvKey ...
	CIModeEnvKey = "CI"
	// PRModeEnvKey ...
	PRModeEnvKey = "PR"
	// PullRequestIDEnvKey ...
	PullRequestIDEnvKey = "PULL_REQUEST_ID"
	// DebugModeEnvKey ...
	DebugModeEnvKey = "DEBUG"
	// IsSecretFilteringKey ...
	IsSecretFilteringKey = "BITRISE_SECRET_FILTERING"
	// IsSecretEnvsFilteringKey ...
	IsSecretEnvsFilteringKey = "BITRISE_SECRET_ENVS_FILTERING"
	// NoOutputTimeoutEnvKey ...
	NoOutputTimeoutEnvKey = "BITRISE_NO_OUTPUT_TIMEOUT"
	// IsSteplibOfflineModeEnvKey when set to true:
	// - StepLib update will be disabled when using non-exact step version (latest minor or major).
	// - When a step or step version is not found in the cache, will not be downloaded. Instead will log
	//  a error message (including what other Step versions are available).
	// - Analytics will be disabled.
	IsSteplibOfflineModeEnvKey = "BITRISE_OFFLINE_MODE"

	// DebugUseSystemTools ...
	DebugUseSystemTools = "BITRISE_DEBUG_USE_SYSTEM_TOOLS"
)
View Source
const (
	EnvstorePathEnvKey         = "ENVMAN_ENVSTORE_PATH"
	FormattedOutputPathEnvKey  = "BITRISE_STEP_FORMATTED_OUTPUT_FILE_PATH"
	BitriseDataHomeDirEnvKey   = "BITRISE_DATA_HOME_DIR"
	BitriseSourceDirEnvKey     = "BITRISE_SOURCE_DIR"
	BitriseDeployDirEnvKey     = "BITRISE_DEPLOY_DIR"
	BitriseTestDeployDirEnvKey = "BITRISE_TEST_DEPLOY_DIR"

	// BitrisePerStepTestResultDirEnvKey is a unique subdirectory in BITRISE_TEST_DEPLOY_DIR for each step run, steps should place test reports and attachments into this directory
	BitrisePerStepTestResultDirEnvKey = "BITRISE_TEST_RESULT_DIR"
	BitriseHtmlReportDirEnvKey        = "BITRISE_HTML_REPORT_DIR"
)
View Source
const (
	PluginUpdateInterval = 24 * time.Hour
)

Variables

View Source
var (
	// IsCIMode ...
	IsCIMode = false
	// IsDebugMode ...
	IsDebugMode = false
	// IsPullRequestMode ...
	IsPullRequestMode = false

	// IsSecretFiltering ...
	IsSecretFiltering = false
	// IsSecretEnvsFiltering ...
	IsSecretEnvsFiltering = false

	// IsSteplibOfflineMode should not be used, only for access from setup command
	IsSteplibOfflineMode = false
)
View Source
var (
	InputEnvstorePath       string
	OutputEnvstorePath      string
	FormattedOutputPath     string
	BitriseWorkDirPath      string
	BitriseWorkStepsDirPath string
	CurrentDir              string
)

Functions

func CheckIsCLIUpdateCheckRequired

func CheckIsCLIUpdateCheckRequired() bool

func CheckIsPluginUpdateCheckRequired

func CheckIsPluginUpdateCheckRequired(plugin string) bool

func CheckIsSetupWasDoneForVersion

func CheckIsSetupWasDoneForVersion(ver string) (bool, string)

func DeleteBitriseConfigDir

func DeleteBitriseConfigDir() error

func EnsureBitriseConfigDirExists

func EnsureBitriseConfigDirExists() error

func GeneratePATHEnvString

func GeneratePATHEnvString(currentPATHEnv, pathToInclude string) string

func GetAgentConfigPath

func GetAgentConfigPath() string

func GetBitriseHomeDirPath

func GetBitriseHomeDirPath() string

func GetBitriseToolsDirPath

func GetBitriseToolsDirPath() string

func HasAgentConfig

func HasAgentConfig() bool

func InitPaths

func InitPaths() error

func IsDebugUseSystemTools

func IsDebugUseSystemTools() bool

IsDebugUseSystemTools ...

func SaveCLIUpdateCheck

func SaveCLIUpdateCheck() error

func SavePluginUpdateCheck

func SavePluginUpdateCheck(plugin string) error

func SaveSetupSuccessForVersion

func SaveSetupSuccessForVersion(ver string) error

Types

type AgentConfig

type AgentConfig struct {
	BitriseDirs BitriseDirs `yaml:"bitrise_dirs"`
	Hooks       AgentHooks  `yaml:"hooks"`
}

func ReadAgentConfig

func ReadAgentConfig(configFile string) (AgentConfig, error)

type AgentHooks

type AgentHooks struct {
	// CleanupOnBuildStart is the list of UNEXPANDED paths to clean up before executing the main workflow.
	// The actual string value should be expanded at execution time, so that
	// Bitrise dirs defined in this config file are correctly expanded.
	CleanupOnBuildStart []string `yaml:"cleanup_on_build_start"`

	// CleanupOnBuildEnd is the list of UNEXPANDED paths to clean up after executing the main workflow.
	// The actual string value should be expanded at execution time, so that
	// Bitrise dirs defined in this config file are correctly expanded.
	CleanupOnBuildEnd []string `yaml:"cleanup_on_build_end"`

	// DoOnBuildStart is an optional executable to run before executing the main workflow..
	DoOnBuildStart string `yaml:"do_on_build_start"`

	// DoOnBuildEnd is an optional executable to run after executing the main workflow.
	DoOnBuildEnd string `yaml:"do_on_build_end"`
}

AgentHooks are various hooks that are executed before and after the CLI runs a build. In this context, a build means a CI execution triggered automatically (unlike a local invocation by `bitrise run x`). These hooks are only executed once, even if the actual workflow triggers other workflows.

type BitriseDirs

type BitriseDirs struct {
	// BitriseDataHomeDir is the root directory for all Bitrise data produced at runtime
	BitriseDataHomeDir string `yaml:"BITRISE_DATA_HOME_DIR"`

	// SourceDir is for source code checkouts.
	// It might be outside of BitriseDataHomeDir if the user has configured it so
	SourceDir string `yaml:"BITRISE_SOURCE_DIR"`

	// DeployDir is for deployable artifacts.
	// It might be outside of BitriseDataHomeDir if the user has configured it so
	DeployDir string `yaml:"BITRISE_DEPLOY_DIR"`

	// TestDeployDir is for deployable test result artifacts.
	// It might be outside of BitriseDataHomeDir if the user has configured it so
	TestDeployDir string `yaml:"BITRISE_TEST_DEPLOY_DIR"`

	// HTMLReportDir is for deployable html reports.
	// It might be outside of BitriseDataHomeDir if the user has configured it so
	HTMLReportDir string `yaml:"BITRISE_HTML_REPORT_DIR"`
}

type ConfigModel

type ConfigModel struct {
	SetupVersion           string               `json:"setup_version"`
	LastCLIUpdateCheck     time.Time            `json:"last_cli_update_check"`
	LastPluginUpdateChecks map[string]time.Time `json:"last_plugin_update_checks"`
}

ConfigModel ...

Jump to

Keyboard shortcuts

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