cy_args

package
v1.0.100 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultIcon  = ""
	DefaultColor = ""
	ValidIcons   = []string{
		"folder_open",
		"mdi-cube-outline",
		"public",
		"extension",
		"science",
		"bug_report",
		"bolt",
		"call_merge",
		"commit",
		"mdi-source-branch",
		"traffic",
		"mdi-clipboard-check-outline",
		"mdi-progress-clock",
		"visibility",
		"vpn_key",
		"lightbulb",
		"favorite",
		"star",
		"auto_awesome",
		"mdi-controller-classic",
		"precision_manufacturing",
		"tour",
		"podcasts",
		"inventory",
		"save",
		"security",
		"mdi-lifebuoy",
		"mdi-ab-testing",
		"mdi-api",
		"mdi-console",
		"mdi-database",
		"mdi-vpn",
		"mdi-server",
		"mdi-server-security",
		"mdi-network-outline",
		"mdi-lan",
		"mdi-nas",
		"mdi-ansible",
		"mdi-aws",
		"mdi-microsoft-azure",
		"mdi-google-cloud",
		"mdi-kubernetes",
		"mdi-terraform",
	}
	ValidColors = []string{
		"dev",
		"prod",
		"demo",
		"success",
		"default",
		"error",
		"staging",
		"preprod",
	}
)
View Source
var (
	StackformsEnvVarName = "CY_STACKFORMS_VARS"
)

Functions

func AddCatalogRepositoryFlag

func AddCatalogRepositoryFlag(cmd *cobra.Command)

func AddCloudProviderFlag

func AddCloudProviderFlag(cmd *cobra.Command)

func AddColorFlag

func AddColorFlag(cmd *cobra.Command)

func AddComponentDescriptionFlag

func AddComponentDescriptionFlag(cmd *cobra.Command)

func AddComponentFlag

func AddComponentFlag(cmd *cobra.Command)

func AddConfigRepositoryFlag

func AddConfigRepositoryFlag(cmd *cobra.Command)

func AddCyContext

func AddCyContext(cmd *cobra.Command)

func AddDescriptionFlag

func AddDescriptionFlag(cmd *cobra.Command)

func AddEnvFlag

func AddEnvFlag(cmd *cobra.Command)

func AddIconFlag

func AddIconFlag(cmd *cobra.Command)

func AddNameFlag

func AddNameFlag(cmd *cobra.Command)

func AddOwnerFlag

func AddOwnerFlag(cmd *cobra.Command)

func AddProjectFlag

func AddProjectFlag(cmd *cobra.Command)

func AddStackFormsInputFlags

func AddStackFormsInputFlags(cmd *cobra.Command)

func AddStackRefFlag

func AddStackRefFlag(cmd *cobra.Command)

func AddUseCaseFlag

func AddUseCaseFlag(cmd *cobra.Command)

func GetCatalogRepository

func GetCatalogRepository(cmd *cobra.Command) (string, error)

func GetCloudProvider

func GetCloudProvider(cmd *cobra.Command) (*string, error)

func GetColor

func GetColor(cmd *cobra.Command) (string, error)

func GetComponent

func GetComponent(cmd *cobra.Command) (string, error)

func GetComponentDescription

func GetComponentDescription(cmd *cobra.Command) (*string, error)

func GetConfigRepository

func GetConfigRepository(cmd *cobra.Command, org string, m middleware.Middleware) (string, error)

GetConfigRepository return the config repository flag, if empty, will try to return the current org default config repository

func GetCyContext

func GetCyContext(cmd *cobra.Command) (org, project, env, component string, err error)

func GetDescription

func GetDescription(cmd *cobra.Command) (string, error)

func GetEnv

func GetEnv(cmd *cobra.Command) (string, error)

func GetIcon

func GetIcon(cmd *cobra.Command) (string, error)

func GetName

func GetName(cmd *cobra.Command) (string, error)

func GetOrg

func GetOrg(cmd *cobra.Command) (string, error)

func GetOutput

func GetOutput(cmd *cobra.Command) (string, error)

func GetOwner

func GetOwner(cmd *cobra.Command) (string, error)

func GetProject

func GetProject(cmd *cobra.Command) (string, error)

func GetStackRef

func GetStackRef(cmd *cobra.Command) (*string, error)

func GetStackformsVars

func GetStackformsVars(cmd *cobra.Command, defaults *models.FormVariables) (*models.FormVariables, error)

GetStackformsVars wrap the flag parsing and the merge of the variables set by the user. The caller must provide the defaults values as he only knows if it must be fetched from a stack or a current component.

func GetUseCase

func GetUseCase(cmd *cobra.Command) (*string, error)

func MergeJSONFileVars

func MergeJSONFileVars(jsonFiles []string) (*models.FormVariables, error)

MergeJSONFileVars will read and merge the Stackforms vars from the `json-file` arg

func MergeJSONVars

func MergeJSONVars(jsonVars []string) (*models.FormVariables, error)

MergeJSONVars expect an array of valid JSON string as stackforms input and return a models.FormVariables

func MergeStackformsVars

func MergeStackformsVars(defaults *models.FormVariables, envVars *models.FormVariables, jsonFiles, jsonStrings []string, keyValueField map[string]string) (*models.FormVariables, error)

MergeStackformsVars will parse and merge all variables inputs in the following order of precedence: file < jsonString < keyValueField

func PickRandomColor

func PickRandomColor(env *string) string

PickRandomColor will select a random color, if you fill env != nil it will try to infer the color based on the env name with our convention. This is define in the FE here: https://github.com/cycloidio/youdeploy-frontend-web/blob/develop/src/utils/config/icons.js

func PickRandomIcon

func PickRandomIcon(env *string) string

PickRandomIcon will select a random icon, if you fill env != nil it will try to infer the icon based on the env name with our convention. This is define in the FE here: https://github.com/cycloidio/youdeploy-frontend-web/blob/develop/src/utils/config/icons.js

func UpdateFormVar

func UpdateFormVar(field string, value string, vars models.FormVariables) error

UpdateFormVar will take a Stackform variable ref in the format section.group.var and update its value. The value is passed as string but can be any valid 'JSON' type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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