platformsh

package
v0.0.0-...-82567e2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectRootNotFoundNoGitRemote = goerr.New("project root not found, current directory not linked to a Platform.sh/Upsun project")
	ErrNoGitBranchMatching            = goerr.New("current git branch name doesn't match any Platform.sh/Upsun environments")
)
View Source
var Commands = []*console.Command{}/* 159 elements not displayed */
View Source
var NoBrand = CloudBrand{
	Name:              "",
	ProjectConfigPath: "",
	CLIConfigPath:     ".platformsh",
	CLIPrefix:         "PLATFORMSH_CLI_",
	CommandPrefix:     "cloud:",
	GitRemoteName:     "",
	BinName:           "platform",
}

NoBrand is used when there is no explicit setting for the brand.

View Source
var PlatformshBrand = CloudBrand{
	Name:              "Platform.sh",
	ProjectConfigPath: ".platform",
	CLIConfigPath:     ".platformsh",
	CLIPrefix:         "PLATFORMSH_CLI_",
	CommandPrefix:     "cloud:",
	GitRemoteName:     "platform",
	BinName:           "platform",
}
View Source
var UpsunBrand = CloudBrand{
	Name:              "Upsun",
	ProjectConfigPath: ".upsun",
	CLIConfigPath:     ".upsun-cli",
	CLIPrefix:         "UPSUN_CLI_",
	CommandPrefix:     "upsun:",
	GitRemoteName:     "upsun",
	BinName:           "upsun",
}

Functions

func DatabaseVersiondUnsynced

func DatabaseVersiondUnsynced(providedVersion, dbVersion string) bool

func GetProjectRoot

func GetProjectRoot(debug bool) (string, error)

func Install

func Install(home string, brand CloudBrand) (string, error)

Install installs or updates the Platform.sh CLI tool.

func IsPhpExtensionAvailable

func IsPhpExtensionAvailable(ext, phpVersion string) bool

func ReadDBVersionFromDoctrineConfigYAML

func ReadDBVersionFromDoctrineConfigYAML(projectDir string) (string, error)

func ReadDBVersionFromDotEnv

func ReadDBVersionFromDotEnv(projectDir string) (string, error)

func ReadDBVersionFromPlatformServiceYAML

func ReadDBVersionFromPlatformServiceYAML(projectDir string) (string, string, error)

func ServiceLastVersion

func ServiceLastVersion(name string) string

Types

type ApplicationsDotYaml

type ApplicationsDotYaml []struct {
	LocalApplication `yaml:",inline"`
	Source           struct {
		Root string
	}
}

Only a wrapper type around LocalApplication used to get Access to `source.root` when unmarshalling

type CLI

type CLI struct {
	Commands []*console.Command
	Hooks    map[string]console.BeforeFunc
	// contains filtered or unexported fields
}

func Get

func Get() (*CLI, error)

func (*CLI) AddBeforeHook

func (p *CLI) AddBeforeHook(name string, f console.BeforeFunc)

func (*CLI) PSHMainCommands

func (p *CLI) PSHMainCommands() []*console.Command

func (*CLI) RunInteractive

func (p *CLI) RunInteractive(logger zerolog.Logger, projectDir string, args []string, debug bool, stdin io.Reader) (bytes.Buffer, bool)

func (*CLI) WrapHelpPrinter

func (p *CLI) WrapHelpPrinter() func(w io.Writer, templ string, data interface{})

type CloudBrand

type CloudBrand struct {
	Name              string
	ProjectConfigPath string
	CommandPrefix     string
	CLIConfigPath     string
	CLIPrefix         string
	GitRemoteName     string
	BinName           string
}

func GuessCloudFromCommandName

func GuessCloudFromCommandName(name string) CloudBrand

func GuessCloudFromDirectory

func GuessCloudFromDirectory(dir string) CloudBrand

func (CloudBrand) BinaryPath

func (b CloudBrand) BinaryPath() string

BinaryPath returns the cloud binary path.

func (CloudBrand) String

func (b CloudBrand) String() string

type LocalApplication

type LocalApplication struct {
	DefinitionFile string                 `yaml:"-"`
	LocalRootDir   string                 `yaml:"-"`
	Name           string                 `yaml:"name"`
	Type           string                 `yaml:"type"`
	Workers        map[string]LocalWorker `yaml:"workers"`
}

func GuessSelectedAppByDirectory

func GuessSelectedAppByDirectory(directory string, apps LocalApplications) *LocalApplication

func GuessSelectedAppByWd

func GuessSelectedAppByWd(apps LocalApplications) *LocalApplication

func (LocalApplication) GetName

func (p LocalApplication) GetName() string

ApplicationInterface interface

type LocalApplications

type LocalApplications []LocalApplication

func FindLocalApplications

func FindLocalApplications(rootDirectory string) LocalApplications

func (LocalApplications) Len

func (p LocalApplications) Len() int

LocalApplications attaches the methods of Interface to []LocalApplication, sorting in increasing order.

func (LocalApplications) Less

func (p LocalApplications) Less(i, j int) bool

func (LocalApplications) Sort

func (p LocalApplications) Sort()

Sort is a convenience method.

func (LocalApplications) Swap

func (p LocalApplications) Swap(i, j int)

type LocalWorker

type LocalWorker struct {
}

type Project

type Project struct {
	ID  string
	App string
	Env string
}

func ProjectFromDir

func ProjectFromDir(dir string, debug bool) (*Project, error)

type UpsunDotYaml

type UpsunDotYaml struct {
	Applications map[string]struct {
		LocalApplication `yaml:",inline"`
		Source           struct {
			Root string
		}
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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