utils

package
v1.47.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// This env var is mandatory for the 'publish' command.
	// The env var is optional for the install command - if provided, the plugin will be downloaded from a custom
	// plugins server, instead of the official registry.
	// The env var should store a server ID configured by JFrog CLI.
	PluginsServerEnv = "JFROG_CLI_PLUGINS_SERVER"
	// Used to set a custom plugins repo for the 'publish' & 'install' commands.
	PluginsRepoEnv     = "JFROG_CLI_PLUGINS_REPO"
	DefaultPluginsRepo = "jfrog-cli-plugins"

	PluginsOfficialRegistryUrl = "https://releases.jfrog.io/artifactory/"

	LatestVersionName = "latest"
)

Variables

View Source
var ArchitecturesMap = map[string]Architecture{
	"linux-386":     {"linux", "386", ""},
	"linux-amd64":   {"linux", "amd64", ""},
	"linux-s390x":   {"linux", "s390x", ""},
	"linux-arm64":   {"linux", "arm64", ""},
	"linux-arm":     {"linux", "arm", ""},
	"mac-386":       {"darwin", "amd64", ""},
	"windows-amd64": {"windows", "amd64", ".exe"},
}

Functions

func AssertPluginVersion added in v1.47.0

func AssertPluginVersion(versionCmdOut string, expectedPluginVersion string) error

Asserts a plugin's version is as expected, by parsing the output of the version command.

func CreatePluginsHttpDetails

func CreatePluginsHttpDetails(rtDetails *config.ServerDetails) httputils.HttpClientDetails

func GetLocalArchitecture

func GetLocalArchitecture() (string, error)

Get the local architecture name corresponding to the architectures that exist in registry.

func GetLocalPluginExecutableName

func GetLocalPluginExecutableName(pluginName string) string

func GetPluginPathInArtifactory

func GetPluginPathInArtifactory(pluginName, pluginVersion, architecture string) string

Returns the full path of a plugin in Artifactory. Example path: "repo-name/plugin-name/version/architecture-name/executable-name"

func GetPluginVersionDirInArtifactory

func GetPluginVersionDirInArtifactory(pluginName, pluginVersion string) string

Example path: "repo-name/plugin-name/v1.0.0/"

func GetPluginsRepo

func GetPluginsRepo() string

Returns a custom plugins repo if provided, default otherwise.

Types

type Architecture

type Architecture struct {
	Goos          string
	Goarch        string
	FileExtension string
}

type PluginBuildCmd

type PluginBuildCmd struct {
	OutputFullPath string
	Env            map[string]string
}

Command used to build plugins.

func (*PluginBuildCmd) GetCmd

func (buildCmd *PluginBuildCmd) GetCmd() *exec.Cmd

func (*PluginBuildCmd) GetEnv

func (buildCmd *PluginBuildCmd) GetEnv() map[string]string

func (*PluginBuildCmd) GetErrWriter

func (buildCmd *PluginBuildCmd) GetErrWriter() io.WriteCloser

func (*PluginBuildCmd) GetStdWriter

func (buildCmd *PluginBuildCmd) GetStdWriter() io.WriteCloser

Jump to

Keyboard shortcuts

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