Documentation
¶
Index ¶
- Constants
- func IsFileEncrypted(filepath string) (isEncrypted bool, err error)
- func LoadFixtureProject(t *testing.T) func()
- func TestChdir(t *testing.T, dir string) func()
- type Config
- type Detector
- type Hosts
- type Project
- type RandomStringGenerator
- type Requirement
- type RequirementResult
- type Site
- type SiteHost
- type StringGenerator
- type Trellis
- func (t *Trellis) ActivateProject() bool
- func (t *Trellis) AutocompleteEnvironment() complete.Predictor
- func (t *Trellis) AutocompleteSite() complete.Predictor
- func (t *Trellis) CheckVirtualenv(ui cli.Ui)
- func (t *Trellis) CreateConfigDir() error
- func (t *Trellis) Detect(path string) (projectPath string, ok bool)
- func (t *Trellis) EnvironmentNames() []string
- func (t *Trellis) FindSiteNameFromEnvironment(environment string, siteNameArg string) (string, error)
- func (t *Trellis) GenerateSite(site *Site, host string, env string)
- func (t *Trellis) GenerateVaultConfig(name string, env string, randomString StringGenerator) *Vault
- func (t *Trellis) GenerateVaultPassFile(path string) error
- func (t *Trellis) HostsFromDomain(domain string, env string) (canonical *publicsuffix.DomainName, redirect *publicsuffix.DomainName)
- func (t *Trellis) LoadProject() error
- func (t *Trellis) ParseConfig(path string) *Config
- func (t *Trellis) PredictEnvironment() complete.PredictFunc
- func (t *Trellis) PredictSite() complete.PredictFunc
- func (t *Trellis) SiteFromEnvironmentAndName(environment string, name string) *Site
- func (t *Trellis) SiteNamesFromEnvironment(environment string) []string
- func (t *Trellis) UpdateAnsibleConfig(section string, key string, value string) error
- func (t *Trellis) UpdateDefaultConfig(config *Config, name string, host string, env string)
- func (t *Trellis) UpdateHosts(env string, ip string) (path string, err error)
- func (t *Trellis) ValidateEnvironment(name string) (err error)
- func (t *Trellis) WriteYamlFile(s interface{}, path string, header string) error
- type Vault
- type VaultUser
- type VaultWordPressSite
- type VaultWordPressSiteEnv
- type Virtualenv
- func (v *Virtualenv) Activate()
- func (v *Virtualenv) Active() bool
- func (v *Virtualenv) Create() (err error)
- func (v *Virtualenv) Deactivate()
- func (v *Virtualenv) Initialized() bool
- func (v *Virtualenv) Install() string
- func (v *Virtualenv) Installed() (ok bool, cmd *exec.Cmd)
- func (v *Virtualenv) LocalPath() string
Constants ¶
View Source
const ConfigDir string = ".trellis"
View Source
const DefaultSiteName = "example.com"
View Source
const GlobPattern = "group_vars/*/wordpress_sites.yml"
View Source
const OldPathEnvName string = "PRE_TRELLIS_PATH"
View Source
const PathEnvName string = "PATH"
View Source
const Template = `
[{{ .Environment }}]
{{ .Host }}
[web]
{{ .Host }}
`
View Source
const TrellisVenvEnvName string = "TRELLIS_VENV"
View Source
const VenvEnvName string = "VIRTUAL_ENV"
View Source
const VirtualenvDir string = "virtualenv"
Variables ¶
This section is empty.
Functions ¶
func IsFileEncrypted ¶
func LoadFixtureProject ¶
Types ¶
type RandomStringGenerator ¶
type RandomStringGenerator struct {
Length int
}
func (*RandomStringGenerator) Generate ¶
func (rs *RandomStringGenerator) Generate() string
type Requirement ¶
type Requirement struct {
Name string
Command string
Url string
VersionConstraint string
ExtractVersion func(output string) string
}
func (*Requirement) Check ¶
func (r *Requirement) Check() (result RequirementResult, err error)
func (*Requirement) IsInstalled ¶
func (r *Requirement) IsInstalled() (path string, ok bool)
type RequirementResult ¶
type Site ¶
type Site struct {
SiteHosts []SiteHost `yaml:"site_hosts"`
LocalPath string `yaml:"local_path"`
AdminEmail string `yaml:"admin_email,omitempty"`
Branch string `yaml:"branch,omitempty"`
Repo string `yaml:"repo,omitempty"`
RepoSubtreePath string `yaml:"repo_subtree_path,omitempty"`
Multisite map[string]interface{} `yaml:"multisite"`
Ssl map[string]interface{} `yaml:"ssl"`
Cache map[string]interface{} `yaml:"cache"`
}
type StringGenerator ¶
type StringGenerator interface {
Generate() string
}
type Trellis ¶
type Trellis struct {
Environments map[string]*Config
ConfigPath string
Path string
Virtualenv *Virtualenv
VenvInitialized bool
// contains filtered or unexported fields
}
func NewTrellis ¶
func (*Trellis) ActivateProject ¶
Activates a Trellis project's virtualenv without loading the config files. This is optimized to be a lighter weight version of LoadProject more suitable for the shell hook.
func (*Trellis) AutocompleteEnvironment ¶
func (*Trellis) AutocompleteSite ¶
func (*Trellis) CheckVirtualenv ¶ added in v1.2.0
func (*Trellis) CreateConfigDir ¶
func (*Trellis) Detect ¶
Detect if a path is a Trellis project or not This will traverse up the directory tree until it finds a valid project, or stop at the root and give up.
func (*Trellis) EnvironmentNames ¶
func (*Trellis) FindSiteNameFromEnvironment ¶
func (*Trellis) GenerateVaultConfig ¶
func (t *Trellis) GenerateVaultConfig(name string, env string, randomString StringGenerator) *Vault
func (*Trellis) GenerateVaultPassFile ¶
func (*Trellis) HostsFromDomain ¶
func (t *Trellis) HostsFromDomain(domain string, env string) (canonical *publicsuffix.DomainName, redirect *publicsuffix.DomainName)
func (*Trellis) LoadProject ¶
Loads a Trellis project. If a project is detected, the wordpress_sites config files are parsed and the directory is changed to the project path.
func (*Trellis) ParseConfig ¶
func (*Trellis) PredictEnvironment ¶
func (t *Trellis) PredictEnvironment() complete.PredictFunc
func (*Trellis) PredictSite ¶
func (t *Trellis) PredictSite() complete.PredictFunc
func (*Trellis) SiteFromEnvironmentAndName ¶
func (*Trellis) SiteNamesFromEnvironment ¶
func (*Trellis) UpdateAnsibleConfig ¶
func (*Trellis) UpdateDefaultConfig ¶
func (*Trellis) UpdateHosts ¶
func (*Trellis) ValidateEnvironment ¶
type Vault ¶
type Vault struct {
MysqlRootPassword string `yaml:"vault_mysql_root_password"`
Users []VaultUser `yaml:"vault_users,omitempty"`
WordPressSites map[string]VaultWordPressSite `yaml:"vault_wordpress_sites"`
}
type VaultWordPressSite ¶
type VaultWordPressSite struct {
AdminPassword string `yaml:"admin_password"`
Env VaultWordPressSiteEnv `yaml:"env"`
}
type VaultWordPressSiteEnv ¶
type VaultWordPressSiteEnv struct {
DbPassword string `yaml:"db_password"`
AuthKey string `yaml:"auth_key,omitempty"`
SecureAuthKey string `yaml:"secure_auth_key,omitempty"`
LoggedInKey string `yaml:"logged_in_key,omitempty"`
NonceKey string `yaml:"nonce_key,omitempty"`
AuthSalt string `yaml:"auth_salt,omitempty"`
SecureAuthSalt string `yaml:"secure_auth_salt,omitempty"`
LoggedInSalt string `yaml:"logged_in_salt,omitempty"`
NonceSalt string `yaml:"nonce_salt,omitempty"`
}
type Virtualenv ¶
func NewVirtualenv ¶
func NewVirtualenv(path string) *Virtualenv
func (*Virtualenv) Activate ¶
func (v *Virtualenv) Activate()
func (*Virtualenv) Active ¶
func (v *Virtualenv) Active() bool
func (*Virtualenv) Create ¶
func (v *Virtualenv) Create() (err error)
func (*Virtualenv) Deactivate ¶
func (v *Virtualenv) Deactivate()
func (*Virtualenv) Initialized ¶
func (v *Virtualenv) Initialized() bool
func (*Virtualenv) Install ¶
func (v *Virtualenv) Install() string
func (*Virtualenv) LocalPath ¶
func (v *Virtualenv) LocalPath() string
Click to show internal directories.
Click to hide internal directories.