extensions

package
v3.0.118 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 20 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// PluginCommandLabel is the label applied to plugins to allow them to be found
	PluginCommandLabel = "jenkins.io/pluginCommand"
)

Variables

View Source
var (
	// DefaultPlatforms the default list of platforms to create plugins for
	DefaultPlatforms = []Platform{
		{
			Goarch: "amd64",
			Goos:   "Windows",
		},
		{
			Goarch: "amd64",
			Goos:   "Darwin",
		},
		{
			Goarch: "amd64",
			Goos:   "Linux",
		},
		{
			Goarch: "arm64",
			Goos:   "Linux",
		},
		{
			Goarch: "386",
			Goos:   "Linux",
		},
	}
)

Functions

func CreateBinaries

func CreateBinaries(createURLFn func(Platform) string) []jenkinsv1.Binary

CreateBinaries a helper function to create the binary resources for the platforms for a given callback

func CreateJXPlugin added in v3.0.28

func CreateJXPlugin(org, name, version string) jxCore.Plugin

CreateJXPlugin creates a jx plugin

func EnsurePluginInstalled

func EnsurePluginInstalled(plugin jxCore.Plugin, pluginBinDir string) (string, error)

EnsurePluginInstalled ensures that the correct version of a plugin is installed locally. It will clean up old versions.

func EnsurePluginInstalledForAliasFile

func EnsurePluginInstalledForAliasFile(plugin jxCore.Plugin, pluginBinDir string, aliasFileName string) (string, error)

EnsurePluginInstalledForAliasFile ensures that the correct version of a plugin is installed locally. It will clean up old versions.

func FindPluginUrl

func FindPluginUrl(plugin jxCore.PluginSpec) (string, error)

FindPluginUrl finds the download URL for the current platform for a plugin

func ValidatePlugins

func ValidatePlugins(jxClient jxClient.Interface, ns string) error

ValidatePlugins tells the user about any problems with plugins installed

Types

type CommandOverrideVerifier

type CommandOverrideVerifier struct {
	Root        *cobra.Command
	SeenPlugins map[string]string
}

CommandOverrideVerifier verifies a set of plugins

func (*CommandOverrideVerifier) Verify

func (v *CommandOverrideVerifier) Verify(path string) []error

Verify implements PathVerifier and determines if a given path is valid depending on whether or not it overwrites an existing jx command path, or a previously seen plugin.

type PathVerifier

type PathVerifier interface {
	// Verify determines if a given path is valid
	Verify(path string) []error
}

PathVerifier receives a path and determines if it is valid or not

type Platform

type Platform struct {
	Goarch string
	Goos   string
}

Platform represents a platform for binaries

func (Platform) Extension

func (p Platform) Extension() string

Extension returns the default distribution extension; `tar.gz` or `zip` for windows

func (Platform) IsWindows

func (p Platform) IsWindows() bool

IsWindows returns true if the platform is windows

Jump to

Keyboard shortcuts

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