Documentation ¶
Index ¶
- Variables
- func Execute()
- func FileExists(path string) bool
- func GetDomainTypeEnum(domainType string) string
- func GetFileContentType(ouput *os.File) (string, error)
- func GetFrameworkEnum(framework string) string
- func GetNodeEnum(node string) string
- func GetProtocolEnum(protocol string) string
- func GetProviderEnum(provider string) string
- func ReadLocalConfig() *spheron.Config
- func SanitizeFixedSelect(items []string, prompt string) (string, error)
- func SanitizeInput(query string) string
- func SanitizeInputMultiple(initPrompt string, repeatPrompt string) ([]string, error)
- func SanitizeSelectMultiple(items []string, initPrompt string, repeatPrompt string) ([]string, error)
- func SetSpheronConfigFile()
- func WriteLocalConfig()
Constants ¶
This section is empty.
Variables ¶
var ConfigDir string
var ConfigName string = "spheron"
var ConfigPath string
var ConfigType string = "json"
var DeploymentEnvironmentId string
var DeploymentEnvironmentName string
var DeploymentId string
var DomainId string
var EnvCreate = &cobra.Command{ Use: "create", Short: "Creates an environment variable", Long: `Creates an environment variable`, Run: func(cmd *cobra.Command, args []string) { projectId := viper.GetString("project") if projectId == "" { panic("No project selected. Please select a project with `spheronctl set project`") } deploymentEnvironmentVariables, err := spheron.GetDeploymentEnvironmentVariables(projectId) if err != nil { panic(err) } var showingDepEnvs []string for _, env := range deploymentEnvironmentVariables { showingDepEnvs = append(showingDepEnvs, env.Name) } envKey := SanitizeInput("Enter the environment variable key: ") envValue := SanitizeInput("Enter the environment variable value: ") selectedEnvName, err := SanitizeSelectMultiple(showingDepEnvs, "Select Deployment Environment: ", "Do you want to add another Deployment Environment?") if err != nil { panic(err) } constructedEnvVariable := spheron.EnvironmentVariables{ Name: envKey, Value: envValue, DeploymentEnvironments: selectedEnvName, } envsToPush := []spheron.EnvironmentVariables{constructedEnvVariable} pushedEnvs, err := spheron.PostEnvironmentVariables(projectId, envsToPush) fmt.Println("Pushing the following environment variables to Spheron: ") for _, env := range pushedEnvs { fmt.Println(env.Name, env.Value, env.ID) } }, }
EnvCreate is a command to create an environment variable
var EnvFile string
var EnvironmentId string
var Image string
var Name string
var ProjectId string
var Secret string
var UserEmail string
var Username string
Functions ¶
func FileExists ¶ added in v0.2.0
is file exist function, used to look for existing config file
func GetDomainTypeEnum ¶ added in v0.3.0
a function that switches case for a selected domain type value on the CLI
func GetFrameworkEnum ¶ added in v0.4.0
a function that switches case for a selected framework value on the CLI
func GetNodeEnum ¶ added in v0.4.0
a function that switches case for a selected node value on the CLI
func GetProtocolEnum ¶ added in v0.3.0
a function that switches case for a selected protocol value on the CLI
func GetProviderEnum ¶ added in v0.4.0
a function that switches case for a selected provider value on the CLI
func ReadLocalConfig ¶ added in v0.2.0
func SanitizeFixedSelect ¶ added in v0.2.0
sanitized fixed select and return selected input as string function
func SanitizeInput ¶ added in v0.2.0
sanitized input function
func SanitizeInputMultiple ¶ added in v0.2.0
sanitizied input multiple and return inputs as string array function
func SanitizeSelectMultiple ¶ added in v0.2.0
func SanitizeSelectMultiple(items []string, initPrompt string, repeatPrompt string) ([]string, error)
sanitized select multiple and return Selected as string array function
func WriteLocalConfig ¶ added in v0.2.0
func WriteLocalConfig()
function to write the configuration in viper memory to the local config file
Types ¶
This section is empty.
Source Files ¶
- configure.go
- depenv.go
- depenv_activate.go
- depenv_create.go
- depenv_deactivate.go
- depenv_delete.go
- depenv_edit.go
- deployment.go
- deployment_authorize.go
- deployment_cancel.go
- deployment_create.go
- deployment_logs.go
- deployment_redeploy.go
- deployment_view.go
- domain.go
- domain_create.go
- domain_delete.go
- domain_edit.go
- domain_verify.go
- domain_view.go
- env.go
- env_create.go
- env_delete.go
- env_edit.go
- env_pull.go
- env_push.go
- organization.go
- organization_edit.go
- organization_invite.go
- organization_switch.go
- project.go
- project_deployment.go
- root.go
- set.go
- set_deployment.go
- set_project.go
- tst.go
- upload.go
- utils.go