plugins

package
v0.0.0-...-f5fadde Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 27 Imported by: 10

Documentation

Index

Constants

View Source
const (
	// TypeGeneric ...
	TypeGeneric = "_"
	// TypeInit ...
	TypeInit = "init"
	// TypeRun ....
	TypeRun = "run"
)
View Source
const (
	// PluginConfigBitriseVersionKey ...
	PluginConfigBitriseVersionKey = "BITRISE_PLUGIN_INPUT_BITRISE_VERSION"
	// PluginConfigTriggerEventKey ...
	PluginConfigTriggerEventKey = "BITRISE_PLUGIN_INPUT_TRIGGER"
	// PluginConfigPluginModeKey ...
	PluginConfigPluginModeKey = "BITRISE_PLUGIN_INPUT_PLUGIN_MODE"
	// PluginConfigDataDirKey ...
	PluginConfigDataDirKey = "BITRISE_PLUGIN_INPUT_DATA_DIR"
	// PluginConfigFormatVersionKey ...
	PluginConfigFormatVersionKey = "BITRISE_PLUGIN_INPUT_FORMAT_VERSION"

	// PluginOutputEnvKey ...
	PluginOutputEnvKey = "BITRISE_PLUGIN_OUTPUT"
)

Variables

This section is empty.

Functions

func AddPluginRoute

func AddPluginRoute(route PluginRoute) error

AddPluginRoute ...

func CheckForNewVersion

func CheckForNewVersion(plugin Plugin) (string, error)

CheckForNewVersion ...

func CreateAndAddPluginRoute

func CreateAndAddPluginRoute(plugin Plugin, source, version string) error

CreateAndAddPluginRoute ...

func DeletePlugin

func DeletePlugin(name string) error

DeletePlugin ...

func DeletePluginRoute

func DeletePluginRoute(name string) error

DeletePluginRoute ...

func ForceInitPaths

func ForceInitPaths(bitriseDir string)

ForceInitPaths ...

func GetPluginBinDir

func GetPluginBinDir(name string) string

GetPluginBinDir ...

func GetPluginDataDir

func GetPluginDataDir(name string) string

GetPluginDataDir ...

func GetPluginDefinitionPath

func GetPluginDefinitionPath(name string) string

GetPluginDefinitionPath ...

func GetPluginDir

func GetPluginDir(name string) string

GetPluginDir ...

func GetPluginExecutablePath

func GetPluginExecutablePath(name string) (string, bool, error)

GetPluginExecutablePath ...

func GetPluginSrcDir

func GetPluginSrcDir(name string) string

GetPluginSrcDir ...

func GetPluginVersion

func GetPluginVersion(name string) (*ver.Version, error)

GetPluginVersion ...

func GitCloneAndCheckoutVersionOrLatestVersion

func GitCloneAndCheckoutVersionOrLatestVersion(cloneIntoDir, repositoryURL, checkoutVersion string) (string, error)

GitCloneAndCheckoutVersionOrLatestVersion ...

func GitVersionTags

func GitVersionTags(gitRepoDir string) ([]*ver.Version, error)

GitVersionTags ...

func InitPaths

func InitPaths() error

InitPaths ...

func NewNotInstalledError

func NewNotInstalledError(plugin string) error

NewNotInstalledError returns a not installed error with the provided plugin

func ParseArgs

func ParseArgs(args []string) (string, []string, bool)

ParseArgs ...

func PrintPluginUpdateInfos

func PrintPluginUpdateInfos(newVersion string, plugin Plugin)

PrintPluginUpdateInfos ...

func RunPluginByCommand

func RunPluginByCommand(plugin Plugin, args []string) error

RunPluginByCommand ...

func RunPluginByEvent

func RunPluginByEvent(plugin Plugin, pluginConfig PluginConfig, input []byte) error

RunPluginByEvent ...

func SortByName

func SortByName(plugins []Plugin)

SortByName ...

func TriggerEvent

func TriggerEvent(name TriggerEventName, payload interface{}) error

TriggerEvent ...

Types

type ByVersion

type ByVersion []*ver.Version

ByVersion ..

func (ByVersion) Len

func (s ByVersion) Len() int

func (ByVersion) Less

func (s ByVersion) Less(i, j int) bool

func (ByVersion) Swap

func (s ByVersion) Swap(i, j int)

type ExecutableModel

type ExecutableModel struct {
	OSX      string `yaml:"osx,omitempty"`
	OSXArm64 string `yaml:"osx-arm64,omitempty"`
	Linux    string `yaml:"linux,omitempty"`
}

ExecutableModel ...

type NotInstalledError

type NotInstalledError struct {
	// contains filtered or unexported fields
}

NotInstalledError ...

func (NotInstalledError) Error

func (e NotInstalledError) Error() string

type Plugin

type Plugin struct {
	Name          string          `yaml:"name,omitempty"`
	Description   string          `yaml:"description,omitempty"`
	Executable    ExecutableModel `yaml:"executable,omitempty"`
	TriggerEvent  string          `yaml:"trigger,omitempty"`
	TriggerEvents []string        `yaml:"triggers,omitempty"`
	Requirements  []Requirement   `yaml:"requirements,omitempty"`
}

Plugin ...

func InstallPlugin

func InstallPlugin(pluginSourceURI, versionTag string) (Plugin, string, error)

InstallPlugin ...

func InstalledPluginList

func InstalledPluginList() ([]Plugin, error)

InstalledPluginList ...

func LoadPlugin

func LoadPlugin(name string) (Plugin, bool, error)

LoadPlugin ...

func LoadPlugins

func LoadPlugins(eventName string) ([]Plugin, error)

LoadPlugins ...

func ParsePluginFromYML

func ParsePluginFromYML(ymlPth string) (Plugin, error)

ParsePluginFromYML ...

func (Plugin) ExecutableURL

func (plugin Plugin) ExecutableURL() string

ExecutableURL ...

func (Plugin) String

func (plugin Plugin) String() string

type PluginConfig

type PluginConfig map[string]string

PluginConfig ...

type PluginInfoModel

type PluginInfoModel struct {
	Name          string `json:"name,omitempty"`
	Version       string `json:"version,omitempty"`
	Source        string `json:"source,omitempty"`
	Plugin        Plugin `json:"plugin,omitempty"`
	DefinitionPth string `json:"definition_pth,omitempty"`
}

PluginInfoModel ...

func (PluginInfoModel) JSON

func (info PluginInfoModel) JSON() string

JSON ...

func (PluginInfoModel) String

func (info PluginInfoModel) String() string

String ...

type PluginInfos

type PluginInfos []PluginInfoModel

PluginInfos ...

func (PluginInfos) JSON

func (infos PluginInfos) JSON() string

JSON ...

func (PluginInfos) String

func (infos PluginInfos) String() string

String ...

type PluginMode

type PluginMode string

PluginMode ...

const (
	// TriggerMode ...
	TriggerMode PluginMode = "trigger"
	// CommandMode ...
	CommandMode PluginMode = "command"
)

type PluginRoute

type PluginRoute struct {
	Name                   string   `yaml:"name"`
	Source                 string   `yaml:"source"`
	Version                string   `yaml:"version"`
	CommitHash             string   `yaml:"commit_hash"`
	Executable             string   `yaml:"executable"`
	TriggerEvent           string   `yaml:"trigger"`
	TriggerEvents          []string `yaml:"triggers"`
	LatestAvailableVersion string   `yaml:"latest_available_version"`
}

PluginRoute ...

func NewPluginRoute

func NewPluginRoute(plugin Plugin, source, version string) (PluginRoute, error)

NewPluginRoute ...

func ReadPluginRoute

func ReadPluginRoute(name string) (PluginRoute, bool, error)

ReadPluginRoute ...

func (PluginRoute) Validate

func (route PluginRoute) Validate() error

Validate ...

type PluginRouting

type PluginRouting struct {
	RouteMap map[string]PluginRoute `yaml:"route_map"`
}

PluginRouting ...

func NewPluginRouting

func NewPluginRouting() PluginRouting

NewPluginRouting ...

func NewPluginRoutingFromBytes

func NewPluginRoutingFromBytes(bytes []byte) (PluginRouting, error)

NewPluginRoutingFromBytes ...

func NewPluginRoutingFromYMLOrEmpty

func NewPluginRoutingFromYMLOrEmpty(ymlPth string) (PluginRouting, error)

NewPluginRoutingFromYMLOrEmpty ...

func (*PluginRouting) AddRoute

func (routing *PluginRouting) AddRoute(route PluginRoute)

AddRoute ...

func (*PluginRouting) DeleteRoute

func (routing *PluginRouting) DeleteRoute(routeName string)

DeleteRoute ...

func (PluginRouting) Validate

func (routing PluginRouting) Validate() error

Validate ...

type Requirement

type Requirement struct {
	Tool       string `yaml:"tool"`
	MinVersion string `yaml:"min_version"`
	MaxVersion string `yaml:"max_version"`
}

Requirement ...

type TriggerEventName

type TriggerEventName string

TriggerEventName ...

const (
	// WillStartRun ...
	WillStartRun TriggerEventName = "WillStartRun"

	// DidFinishRun ...
	DidFinishRun TriggerEventName = "DidFinishRun"
)

Jump to

Keyboard shortcuts

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