common

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CleaningCommandsForceOptionDescription = "First remove containers that use werf docker images which are going to be deleted"
	StubImagesRepoAddress                  = "stub/repository"
)
View Source
const (
	CmdEnvAnno                  string = "environment"
	DisableOptionsInUseLineAnno string = "disableOptionsInUseLine"

	WerfDebugAnsibleArgs Env = "WERF_DEBUG_ANSIBLE_ARGS"
	WerfSecretKey        Env = "WERF_SECRET_KEY"
	WerfOldSecretKey     Env = "WERF_OLD_SECRET_KEY"
)

Variables

This section is empty.

Functions

func ConvertInt32Value

func ConvertInt32Value(v string) (int32, error)

func ConvertIntValue

func ConvertIntValue(v string, bitSize int) (int64, error)

func DisableTerminationSignalsTrap

func DisableTerminationSignalsTrap()

func DockerRegistryInit added in v1.1.9

func DockerRegistryInit(cmdData *CmdData) error

func EnableTerminationSignalsTrap

func EnableTerminationSignalsTrap()

func EnvsDescription

func EnvsDescription(envs ...Env) string

func GetBoolEnvironmentDefaultFalse added in v1.1.0

func GetBoolEnvironmentDefaultFalse(environmentName string) bool

func GetConveyorOptions added in v1.1.19

func GetConveyorOptions(commonCmdData *CmdData) build.ConveyorOptions

func GetDeployTag

func GetDeployTag(cmdData *CmdData, opts TagOptionsGetterOptions) (string, tag_strategy.TagStrategy, error)

func GetGitCommitStrategyExpiryDays

func GetGitCommitStrategyExpiryDays(cmdData *CmdData) (int64, error)

func GetGitCommitStrategyLimit

func GetGitCommitStrategyLimit(cmdData *CmdData) (int64, error)

func GetGitTagStrategyExpiryDays

func GetGitTagStrategyExpiryDays(cmdData *CmdData) (int64, error)

func GetGitTagStrategyLimit

func GetGitTagStrategyLimit(cmdData *CmdData) (int64, error)

func GetHelmChartDir added in v1.1.11

func GetHelmChartDir(projectDir string, cmdData *CmdData) (string, error)

func GetHelmRelease

func GetHelmRelease(releaseOption string, environmentOption string, werfConfig *config.WerfConfig) (string, error)

func GetHelmReleaseStorageType

func GetHelmReleaseStorageType(helmReleaseStorageType string) (string, error)

func GetHooksStatusProgressPeriod

func GetHooksStatusProgressPeriod(cmdData *CmdData) time.Duration

func GetImagesCleanupPolicies

func GetImagesCleanupPolicies(cmdData *CmdData) (cleanup.ImagesCleanupPolicies, error)

func GetImagesRepo

func GetImagesRepo(projectName string, cmdData *CmdData) (storage.ImagesRepo, error)

func GetImagesRepoWithOptionalStubRepoAddress added in v1.1.9

func GetImagesRepoWithOptionalStubRepoAddress(projectName string, cmdData *CmdData) (storage.ImagesRepo, error)

func GetIntrospectOptions

func GetIntrospectOptions(cmdData *CmdData, werfConfig *config.WerfConfig) (build.IntrospectOptions, error)

func GetKubernetesNamespace

func GetKubernetesNamespace(namespaceOption string, environmentOption string, werfConfig *config.WerfConfig) (string, error)

func GetLongCommandDescription

func GetLongCommandDescription(text string) string

func GetManagedImageName added in v1.1.0

func GetManagedImageName(userSpecifiedImageName string) string

func GetManagedImagesNames added in v1.1.0

func GetManagedImagesNames(projectName string, stagesStorage storage.StagesStorage, werfConfig *config.WerfConfig) ([]string, error)

func GetOptionalImagesRepoAddress added in v1.1.9

func GetOptionalImagesRepoAddress(projectName string, cmdData *CmdData) (string, error)

func GetOptionalStagesStorageAddress added in v1.1.10

func GetOptionalStagesStorageAddress(cmdData *CmdData) string

func GetOptionalWerfConfig added in v1.1.0

func GetOptionalWerfConfig(projectDir string, cmdData *CmdData, logRenderedFilePath bool) (*config.WerfConfig, error)

func GetProjectDir

func GetProjectDir(cmdData *CmdData) (string, error)

func GetPublishReportFormat added in v1.1.18

func GetPublishReportFormat(cmdData *CmdData) (build.PublishReportFormat, error)

func GetRequiredWerfConfig added in v1.1.0

func GetRequiredWerfConfig(projectDir string, cmdData *CmdData, logRenderedFilePath bool) (*config.WerfConfig, error)

func GetStagesSignatureStrategyExpiryDays added in v1.1.8

func GetStagesSignatureStrategyExpiryDays(cmdData *CmdData) (int64, error)

func GetStagesSignatureStrategyLimit added in v1.1.8

func GetStagesSignatureStrategyLimit(cmdData *CmdData) (int64, error)

func GetStagesStorage added in v1.1.0

func GetStagesStorage(containerRuntime container_runtime.ContainerRuntime, cmdData *CmdData) (storage.StagesStorage, error)

func GetStagesStorageAddress added in v1.1.9

func GetStagesStorageAddress(cmdData *CmdData) (string, error)

func GetStagesStorageCache added in v1.1.9

func GetStagesStorageCache(synchronization string) (storage.StagesStorageCache, error)

func GetStatusProgressPeriod

func GetStatusProgressPeriod(cmdData *CmdData) time.Duration

func GetStorageLockManager added in v1.1.10

func GetStorageLockManager(synchronization string) (storage.LockManager, error)

func GetSynchronization added in v1.1.0

func GetSynchronization(cmdData *CmdData, stagesStorageAddress string) (string, error)

func GetTagOptions

func GetTagOptions(cmdData *CmdData, opts TagOptionsGetterOptions) (build.TagOptions, error)

func GetThreeWayMergeMode

func GetThreeWayMergeMode(threeWayMergeModeParam string) (helm.ThreeWayMergeModeType, error)

func GetUserExtraAnnotations

func GetUserExtraAnnotations(cmdData *CmdData) (map[string]string, error)

func GetUserExtraLabels

func GetUserExtraLabels(cmdData *CmdData) (map[string]string, error)

func GetWerfConfigPath

func GetWerfConfigPath(projectDir string, cmdData *CmdData, required bool) (string, error)

func GetWerfConfigTemplatesDir added in v1.1.11

func GetWerfConfigTemplatesDir(projectDir string, cmdData *CmdData) string

func InitKubedog

func InitKubedog() error

func LogKubeContext

func LogKubeContext(kubeContext string)

func LogRunningTime

func LogRunningTime(f func() error) error

func LogVersion

func LogVersion()

func PrintHelp

func PrintHelp(cmd *cobra.Command)

func ProcessLogColorMode

func ProcessLogColorMode(cmdData *CmdData) error

func ProcessLogOptions

func ProcessLogOptions(cmdData *CmdData) error

func ProcessLogProjectDir

func ProcessLogProjectDir(cmdData *CmdData, projectDir string)

func ProcessLogTerminalWidth

func ProcessLogTerminalWidth(cmdData *CmdData) error

func SetupAddAnnotations

func SetupAddAnnotations(cmdData *CmdData, cmd *cobra.Command)

func SetupAddLabels

func SetupAddLabels(cmdData *CmdData, cmd *cobra.Command)

func SetupCommonRepoData added in v1.1.9

func SetupCommonRepoData(cmdData *CmdData, cmd *cobra.Command)

func SetupConfigPath added in v1.1.11

func SetupConfigPath(cmdData *CmdData, cmd *cobra.Command)

func SetupConfigTemplatesDir added in v1.1.11

func SetupConfigTemplatesDir(cmdData *CmdData, cmd *cobra.Command)

func SetupDir

func SetupDir(cmdData *CmdData, cmd *cobra.Command)

func SetupDockerConfig

func SetupDockerConfig(cmdData *CmdData, cmd *cobra.Command, extraDesc string)

func SetupDockerHubPasswordForRepoData added in v1.1.9

func SetupDockerHubPasswordForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupDockerHubTokenForRepoData added in v1.1.9

func SetupDockerHubTokenForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupDockerHubUsernameForRepoData added in v1.1.9

func SetupDockerHubUsernameForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupDryRun

func SetupDryRun(cmdData *CmdData, cmd *cobra.Command)

func SetupEnvironment

func SetupEnvironment(cmdData *CmdData, cmd *cobra.Command)

func SetupGithubTokenForRepoData added in v1.1.9

func SetupGithubTokenForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupHarborPasswordForRepoData added in v1.1.9

func SetupHarborPasswordForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupHarborUsernameForRepoData added in v1.1.9

func SetupHarborUsernameForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupHelmChartDir added in v1.1.11

func SetupHelmChartDir(cmdData *CmdData, cmd *cobra.Command)

func SetupHelmReleaseStorageNamespace

func SetupHelmReleaseStorageNamespace(cmdData *CmdData, cmd *cobra.Command)

func SetupHelmReleaseStorageType

func SetupHelmReleaseStorageType(cmdData *CmdData, cmd *cobra.Command)

func SetupHomeDir

func SetupHomeDir(cmdData *CmdData, cmd *cobra.Command)

func SetupHooksStatusProgressPeriod

func SetupHooksStatusProgressPeriod(cmdData *CmdData, cmd *cobra.Command)

func SetupIgnoreSecretKey

func SetupIgnoreSecretKey(cmdData *CmdData, cmd *cobra.Command)

func SetupImagesCleanupPolicies

func SetupImagesCleanupPolicies(cmdData *CmdData, cmd *cobra.Command)

func SetupImagesRepoOptions added in v1.1.9

func SetupImagesRepoOptions(cmdData *CmdData, cmd *cobra.Command)

func SetupImplementationForRepoData added in v1.1.9

func SetupImplementationForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupInsecureRegistry

func SetupInsecureRegistry(cmdData *CmdData, cmd *cobra.Command)

func SetupIntrospectStage

func SetupIntrospectStage(cmdData *CmdData, cmd *cobra.Command)

func SetupKubeConfig

func SetupKubeConfig(cmdData *CmdData, cmd *cobra.Command)

func SetupKubeContext

func SetupKubeContext(cmdData *CmdData, cmd *cobra.Command)

func SetupLogOptions

func SetupLogOptions(cmdData *CmdData, cmd *cobra.Command)

func SetupLogProjectDir

func SetupLogProjectDir(cmdData *CmdData, cmd *cobra.Command)

func SetupNamespace

func SetupNamespace(cmdData *CmdData, cmd *cobra.Command)

func SetupProjectName added in v1.1.0

func SetupProjectName(cmdData *CmdData, cmd *cobra.Command)

func SetupPublishReportFormat added in v1.1.18

func SetupPublishReportFormat(cmdData *CmdData, cmd *cobra.Command)

func SetupPublishReportPath added in v1.1.18

func SetupPublishReportPath(cmdData *CmdData, cmd *cobra.Command)

func SetupQuayTokenForRepoData added in v1.1.9

func SetupQuayTokenForRepoData(repoData *RepoData, cmd *cobra.Command, paramName string, paramEnvNames []string)

func SetupRelease

func SetupRelease(cmdData *CmdData, cmd *cobra.Command)

func SetupReleasesHistoryMax

func SetupReleasesHistoryMax(cmdData *CmdData, cmd *cobra.Command)

func SetupSSHKey

func SetupSSHKey(cmdData *CmdData, cmd *cobra.Command)

func SetupSecretValues

func SetupSecretValues(cmdData *CmdData, cmd *cobra.Command)

func SetupSet

func SetupSet(cmdData *CmdData, cmd *cobra.Command)

func SetupSetString

func SetupSetString(cmdData *CmdData, cmd *cobra.Command)

func SetupSkipTlsVerifyRegistry

func SetupSkipTlsVerifyRegistry(cmdData *CmdData, cmd *cobra.Command)

func SetupStagesStorageOptions added in v1.1.9

func SetupStagesStorageOptions(cmdData *CmdData, cmd *cobra.Command)

func SetupStatusProgressPeriod

func SetupStatusProgressPeriod(cmdData *CmdData, cmd *cobra.Command)

func SetupSynchronization added in v1.1.0

func SetupSynchronization(cmdData *CmdData, cmd *cobra.Command)

func SetupTag

func SetupTag(cmdData *CmdData, cmd *cobra.Command)

func SetupThreeWayMergeMode

func SetupThreeWayMergeMode(cmdData *CmdData, cmd *cobra.Command)

func SetupTmpDir

func SetupTmpDir(cmdData *CmdData, cmd *cobra.Command)

func SetupValues

func SetupValues(cmdData *CmdData, cmd *cobra.Command)

func SetupVirtualMerge added in v1.1.19

func SetupVirtualMerge(cmdData *CmdData, cmd *cobra.Command)

func SetupVirtualMergeFromCommit added in v1.1.19

func SetupVirtualMergeFromCommit(cmdData *CmdData, cmd *cobra.Command)

func SetupVirtualMergeIntoCommit added in v1.1.19

func SetupVirtualMergeIntoCommit(cmdData *CmdData, cmd *cobra.Command)

func SetupWithoutKube

func SetupWithoutKube(cmdData *CmdData, cmd *cobra.Command)

func TerminateWithError

func TerminateWithError(errMsg string, exitCode int)

func ValidateArgumentCount

func ValidateArgumentCount(expectedCount int, args []string, cmd *cobra.Command) error

func ValidateMaximumNArgs

func ValidateMaximumNArgs(maxArgs int, args []string, cmd *cobra.Command) error

func ValidateMinimumNArgs

func ValidateMinimumNArgs(minArgs int, args []string, cmd *cobra.Command) error

func ValidateRepoImplementation added in v1.1.9

func ValidateRepoImplementation(implementation string) error

func WithoutTerminationSignalsTrap

func WithoutTerminationSignalsTrap(f func() error) error

Types

type CmdData

type CmdData struct {
	ProjectName        *string
	Dir                *string
	ConfigPath         *string
	ConfigTemplatesDir *string
	TmpDir             *string
	HomeDir            *string
	SSHKeys            *[]string

	TagCustom            *[]string
	TagGitBranch         *string
	TagGitTag            *string
	TagGitCommit         *string
	TagByStagesSignature *bool

	HelmChartDir                     *string
	Environment                      *string
	Release                          *string
	Namespace                        *string
	AddAnnotations                   *[]string
	AddLabels                        *[]string
	KubeContext                      *string
	KubeConfig                       *string
	HelmReleaseStorageNamespace      *string
	HelmReleaseStorageType           *string
	StatusProgressPeriodSeconds      *int64
	HooksStatusProgressPeriodSeconds *int64
	ReleasesHistoryMax               *int

	Set             *[]string
	SetString       *[]string
	Values          *[]string
	SecretValues    *[]string
	IgnoreSecretKey *bool

	CommonRepoData *RepoData

	StagesStorage         *string
	StagesStorageRepoData *RepoData

	ImagesRepo     *string
	ImagesRepoMode *string
	ImagesRepoData *RepoData

	Synchronization *string

	DockerConfig          *string
	InsecureRegistry      *bool
	SkipTlsVerifyRegistry *bool
	DryRun                *bool

	GitTagStrategyLimit               *int64
	GitTagStrategyExpiryDays          *int64
	GitCommitStrategyLimit            *int64
	GitCommitStrategyExpiryDays       *int64
	StagesSignatureStrategyLimit      *int64
	StagesSignatureStrategyExpiryDays *int64

	WithoutKube *bool

	StagesToIntrospect *[]string

	LogDebug         *bool
	LogPretty        *bool
	LogVerbose       *bool
	LogQuiet         *bool
	LogColorMode     *string
	LogProjectDir    *bool
	LogTerminalWidth *int64

	ThreeWayMergeMode *string

	PublishReportPath   *string
	PublishReportFormat *string

	VirtualMerge           *bool
	VirtualMergeFromCommit *string
	VirtualMergeIntoCommit *string
}

type Env

type Env string

type RepoData added in v1.1.9

type RepoData struct {
	IsCommon               bool
	DesignationStorageName string

	Implementation    *string
	DockerHubUsername *string
	DockerHubPassword *string
	DockerHubToken    *string
	GitHubToken       *string
	HarborUsername    *string
	HarborPassword    *string
	QuayToken         *string
}

func MergeRepoData added in v1.1.9

func MergeRepoData(repoDataArr ...*RepoData) *RepoData

type TagOptionsGetterOptions

type TagOptionsGetterOptions struct {
	Optional bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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