Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) AdditionalServices() []string
- func (c *Config) AppHomeDir() string
- func (c *Config) AppName() string
- func (c *Config) AppVersion() string
- func (c *Config) BlackfireCommand() string
- func (c *Config) BlackfireContainer() string
- func (c *Config) BlackfireEnabled() bool
- func (c *Config) Check(cmd *cobra.Command, args []string) error
- func (c *Config) CheckInvokerUser(cmd *cobra.Command) error
- func (c *Config) Cleanup() error
- func (c *Config) ComposerVersion() *version.Version
- func (c *Config) CryptKey() string
- func (c *Config) Cwd() string
- func (c *Config) DBCommand() string
- func (c *Config) DBContainer() string
- func (c *Config) DBDumpCommand() string
- func (c *Config) DBPrefix() string
- func (c *Config) DefaultSyncedContainer(envType string) string
- func (c *Config) DefaultSyncedDir(envType string) string
- func (c *Config) DockerHost() string
- func (c *Config) DockerPeeredServices(action, networkName string) error
- func (c *Config) EnvCheck() error
- func (c *Config) EnvInitialized() bool
- func (c *Config) EnvName() string
- func (c *Config) EnvNetworkName() string
- func (c *Config) EnvType() string
- func (c *Config) EnvTypes() map[string]string
- func (c *Config) FullBootstrap() bool
- func (c *Config) GitHubToken() string
- func (c *Config) Init() *Config
- func (c *Config) InstallMarkerFilePath() string
- func (c *Config) Installed() bool
- func (c *Config) IsDebug() bool
- func (c *Config) IsSvcEnabled(s string) bool
- func (c *Config) MagentoBackendFrontname() string
- func (c *Config) MagentoDisableTFA() bool
- func (c *Config) MagentoMode() string
- func (c *Config) MagentoType() string
- func (c *Config) MagentoVersion() (*version.Version, error)
- func (c *Config) MagentoVersionFromConfig() *version.Version
- func (c *Config) MutagenRequiredVersion() string
- func (c *Config) MutagenSyncFile() string
- func (c *Config) MutagenSyncIgnore() string
- func (c *Config) MutagenURL() string
- func (c *Config) NoPull() bool
- func (c *Config) OptionalServices() []string
- func (c *Config) Parallel() bool
- func (c *Config) Plugins() []*Plugin
- func (c *Config) PluginsAvailable() map[string]*Plugin
- func (c *Config) PluginsConfigDir() string
- func (c *Config) PluginsDir() string
- func (c *Config) RepoURL() string
- func (c *Config) ResetAdminURL() bool
- func (c *Config) ResolveDomainToTraefik() bool
- func (c *Config) SSLBaseDir() string
- func (c *Config) SSLCABaseDir() string
- func (c *Config) SSLCADir() string
- func (c *Config) SSLCertBaseDir() string
- func (c *Config) SSLCertDir() string
- func (c *Config) SSLDir() string
- func (c *Config) ServiceDomain() string
- func (c *Config) ServiceEnabled(servicename string) bool
- func (c *Config) Services() []string
- func (c *Config) SetDefaultShellCommand(containerName string)
- func (c *Config) SetLocalDefaults()
- func (c *Config) SetLogging()
- func (c *Config) SetNonLocalDefaults()
- func (c *Config) SetPHPDefaults(envType string)
- func (c *Config) SetPWADefaults()
- func (c *Config) SetSeleniumDefaults()
- func (c *Config) SetShellContainer(envType string)
- func (c *Config) SetShellUser(containerName string)
- func (c *Config) SetSyncSettings()
- func (c *Config) SetSyncedContainer(s string)
- func (c *Config) SetSyncedDir(s string)
- func (c *Config) ShopwareAdminPath() string
- func (c *Config) ShopwareMode() string
- func (c *Config) ShopwareVersion() (*version.Version, error)
- func (c *Config) Shortcuts() map[string]string
- func (c *Config) SilenceErrors() bool
- func (c *Config) SingleWebContainer() bool
- func (c *Config) SkipCleanup() bool
- func (c *Config) SkipComposerInstall() bool
- func (c *Config) SuperuserAllowed() bool
- func (c *Config) SvcEnabledPermissive(s string) bool
- func (c *Config) SvcEnabledStrict(s string) bool
- func (c *Config) SyncEnabled() bool
- func (c *Config) SyncedContainer() string
- func (c *Config) SyncedDir() string
- func (c *Config) TraefikDomain() string
- func (c *Config) TraefikFullDomain() string
- func (c *Config) TraefikSubdomain() string
- func (c *Config) ValidEnvTypes() []string
- func (c *Config) WebRoot() string
- func (c *Config) WithSampleData() bool
- func (c *Config) WordpressAdminPath() string
- type Plugin
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEnvNameIsInvalid occurs when the environment name is invalid. It should be a valid hostname. ErrEnvNameIsInvalid = fmt.Errorf("environment name is invalid, it should match RFC1178") // ErrEnvIsEmpty occurs when environment name is empty. ErrEnvIsEmpty = fmt.Errorf("env name is empty. please run `reward env-init`") // ErrUnknownAction occurs when an unknown actions is called. ErrUnknownAction = fmt.Errorf("unknown action error") // ErrInvokedAsRootUser occurs when the Application was called by Root user. ErrInvokedAsRootUser = fmt.Errorf( "in most cases, you should not run as root user except for `self-update` " + "if you are sure you want to do this, use REWARD_ALLOW_SUPERUSER=1", ) ErrHostnameRequired = fmt.Errorf("hostname is required") ErrCaCertDoesNotExist = fmt.Errorf( "the root CA certificate is missing, please run " + "'reward install' and try again", ) // ErrUnknownEnvType occurs when an unknown environment type is specified. ErrUnknownEnvType = fmt.Errorf("unknown env type") )
var FS = &afero.Afero{Fs: afero.NewOsFs()}
FS is the implementation of Afero Filesystem. It's a filesystem wrapper and used for testing.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { *viper.Viper Shell shell.Shell Docker *docker.Client DockerCompose *dockercompose.Client ShellUser string ShellContainer string DefaultShellCommand string TmpFiles *list.List }
func (*Config) AdditionalServices ¶
func (*Config) AppHomeDir ¶
AppHomeDir returns the application's home directory.
func (*Config) AppVersion ¶
AppVersion returns the application's version.
func (*Config) BlackfireCommand ¶
BlackfireCommand returns the command which is called when the application manipulates blackfire.
func (*Config) BlackfireContainer ¶
BlackfireContainer returns the container name of the Blackfire debug container.
func (*Config) BlackfireEnabled ¶
BlackfireEnabled returns true if the blackfire container is enabled.
func (*Config) CheckInvokerUser ¶
CheckInvokerUser returns an error if the invoker user is root.
func (*Config) ComposerVersion ¶
func (c *Config) ComposerVersion() *version.Version
ComposerVersion returns the Composer Version defined in Config settings.
func (*Config) DBCommand ¶
DBCommand returns the command which is called when the application manipulates the database.
func (*Config) DBContainer ¶
DBContainer returns the name of the database container.
func (*Config) DBDumpCommand ¶
DBDumpCommand returns the command which is called when the application dumps a database.
func (*Config) DefaultSyncedContainer ¶
func (*Config) DefaultSyncedDir ¶
func (*Config) DockerHost ¶
func (*Config) DockerPeeredServices ¶
DockerPeeredServices attaches/detaches the common services to the current environment's docker network.
func (*Config) EnvCheck ¶
EnvCheck returns an error if the env name is empty (.env file does not contain an env name).
func (*Config) EnvInitialized ¶
func (*Config) EnvNetworkName ¶
EnvNetworkName returns the environments docker network name in lowercase format.
func (*Config) FullBootstrap ¶
FullBootstrap checks if full bootstrap is enabled in configs.
func (*Config) GitHubToken ¶
func (*Config) InstallMarkerFilePath ¶
InstallMarkerFilePath returns the filepath of the Install Marker file.
func (*Config) IsSvcEnabled ¶
IsSvcEnabled returns true if the s service is enabled for the current environment.
func (*Config) MagentoBackendFrontname ¶
MagentoBackendFrontname returns Magento admin path from Config settings.
func (*Config) MagentoDisableTFA ¶
MagentoDisableTFA checks if the installer should Disable TwoFactorAuth module in configs.
func (*Config) MagentoMode ¶
MagentoMode returns Magento mode: developer or production (default: developer).
func (*Config) MagentoType ¶
MagentoType returns Magento type: enterprise or community (default: community).
func (*Config) MagentoVersion ¶
MagentoVersion returns a *version.Version object which contains the Magento version.
func (*Config) MagentoVersionFromConfig ¶
func (c *Config) MagentoVersionFromConfig() *version.Version
MagentoVersionFromConfig returns a *version.Version object from Config settings. Note: If it's unset, it will return a dedicated latest version.
func (*Config) MutagenRequiredVersion ¶
MutagenRequiredVersion returns the content of the REWARD_MUTAGEN_VERSION variable.
func (*Config) MutagenSyncFile ¶
MutagenSyncFile returns the file path of the mutagen sync file.
func (*Config) MutagenSyncIgnore ¶
MutagenSyncIgnore returns the additional mutagen ignored files.
func (*Config) MutagenURL ¶
MutagenURL returns the content of the REWARD_MUTAGEN_URL variable.
func (*Config) OptionalServices ¶
func (*Config) PluginsAvailable ¶
func (*Config) PluginsConfigDir ¶
func (*Config) PluginsDir ¶
func (*Config) ResetAdminURL ¶
ResetAdminURL checks if the installer should Reset the Admin URLs in Viper settings.
func (*Config) ResolveDomainToTraefik ¶
func (*Config) SSLBaseDir ¶
func (*Config) SSLCABaseDir ¶
func (*Config) SSLCertBaseDir ¶
func (*Config) SSLCertDir ¶
func (*Config) ServiceDomain ¶
ServiceDomain returns the application's service domain.
func (*Config) ServiceEnabled ¶
ServiceEnabled returns true if service is enabled in Config settings.
func (*Config) SetDefaultShellCommand ¶
SetDefaultShellCommand changes the command invoked by reward shell command.
func (*Config) SetLocalDefaults ¶
func (c *Config) SetLocalDefaults()
func (*Config) SetLogging ¶
func (c *Config) SetLogging()
SetLogging sets the logging level based on the command line flags and environment variables.
func (*Config) SetNonLocalDefaults ¶
func (c *Config) SetNonLocalDefaults()
func (*Config) SetPHPDefaults ¶
func (*Config) SetPWADefaults ¶
func (c *Config) SetPWADefaults()
func (*Config) SetSeleniumDefaults ¶
func (c *Config) SetSeleniumDefaults()
TODO: test if this works as expected.
func (*Config) SetShellContainer ¶
SetShellContainer changes the container used for the reward shell command.
func (*Config) SetShellUser ¶
SetShellUser changes the user of the reward shell command.
func (*Config) SetSyncSettings ¶
func (c *Config) SetSyncSettings()
SetSyncSettings sets the settings for synchronization.
func (*Config) SetSyncedContainer ¶
SetSyncedContainer sets the synced container name in REWARD_ENV_SYNCED_CONTAINER variable.
func (*Config) SetSyncedDir ¶
SetSyncedDir sets the REWARD_ENV_SYNCED_DIRECTORY variable.
func (*Config) ShopwareAdminPath ¶
ShopwareAdminPath returns shopware admin path from Config settings.
func (*Config) ShopwareMode ¶
func (*Config) ShopwareVersion ¶
func (*Config) SilenceErrors ¶
func (*Config) SingleWebContainer ¶
SingleWebContainer returns true if Single Web Container setting is enabled in Viper settings.
func (*Config) SkipCleanup ¶
func (*Config) SkipComposerInstall ¶
SkipComposerInstall checks if composer install is disabled in configs.
func (*Config) SuperuserAllowed ¶
SuperuserAllowed returns true if the application is allowed to be invoked by root.
func (*Config) SvcEnabledPermissive ¶
SvcEnabledPermissive returns true if the s service is enabled in Viper settings. This function is also going to return true if the service is not mentioned in Viper settings (defaults to true).
func (*Config) SvcEnabledStrict ¶
SvcEnabledStrict returns true if the s service is enabled in Viper settings. This function is going to return false if the service is not mentioned in Viper settings (defaults to false).
func (*Config) SyncEnabled ¶
SyncEnabled returns true for macOS and Windows if it's not disabled explicitly (or if the WSL2 Direct Mount option is not enabled on Windows).
func (*Config) SyncedContainer ¶
SyncedContainer returns the container name of the synced container from REWARD_ENV_SYNCED_CONTAINER variable.
func (*Config) SyncedDir ¶
SyncedDir returns the directory which is synced with the host stored in the REWARD_ENV_SYNCED_DIR environment variable.
func (*Config) TraefikDomain ¶
TraefikDomain returns traefik domain from Viper settings.
func (*Config) TraefikFullDomain ¶
TraefikFullDomain returns traefik full domain (subdomain + domain merged).
func (*Config) TraefikSubdomain ¶
TraefikSubdomain returns traefik subdomain from Viper settings.
func (*Config) ValidEnvTypes ¶
ValidEnvTypes return a list of valid environment types based on the predefined EnvTypes.
func (*Config) WithSampleData ¶
WithSampleData checks if Magento 2 sample data is enabled in configs.
func (*Config) WordpressAdminPath ¶
WordpressAdminPath returns WordPress admin path from Config settings.