platform

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountForReleaseJSON

func CountForReleaseJSON() int

CountForReleaseJSON returns the number of platforms that we expect to put into the release JSON. This is all platforms _except_ those where the `SkipForJSONFeed` field is true.

Types

type Arch

type Arch string
const (
	ArchArm64 Arch = "arm64"
	// While arm64 and aarch64 are the same architecture, some Linux distros use arm64 and others use aarch64:
	// - aarch64: RHEL/Amazon/SUSE
	// - arm64: Debian/Ubuntu
	ArchAarch64 Arch = "aarch64"
	ArchS390x   Arch = "s390x"
	ArchPpc64le Arch = "ppc64le"
	ArchX86_64  Arch = "x86_64"
)

func (Arch) ConstName

func (a Arch) ConstName() string

func (Arch) String

func (a Arch) String() string

type OS

type OS string
const (
	OSWindows OS = "windows"
	OSLinux   OS = "linux"
	OSMac     OS = "mac"
)

func (OS) ConstName

func (o OS) ConstName() string

func (OS) String

func (o OS) String() string

type Pkg

type Pkg string
const (
	PkgDeb Pkg = "deb"
	PkgRPM Pkg = "rpm"
)

func (Pkg) ConstName

func (p Pkg) ConstName() string

func (Pkg) String

func (p Pkg) String() string

type Platform

type Platform struct {
	Name string
	// This is used to override the variant name. It should only be used for
	// special builds. In general, we want to use the OS name + arch for the
	// variant name.
	VariantName       string
	Arch              Arch
	OS                OS
	Pkg               Pkg
	Repos             []Repo
	BuildTags         []string
	BinaryExt         string
	SkipForJSONFeed   bool
	ServerVariantName string
}

Platform represents a platform (a combination of OS, distro, version, and architecture) on which we may build/test the tools. There should be at least one evergreen buildvariant per platform, and there may be multiple.

func DetectLocal

func DetectLocal() (Platform, error)

DetectLocal detects the platform for non-evergreen use cases.

func GetByOsAndArch

func GetByOsAndArch(os string, arch Arch) (Platform, bool)

func GetByVariant

func GetByVariant(variant string) (Platform, bool)

func GetFromEnv

func GetFromEnv() (Platform, error)

GetFromEnv returns the Platform for this host, based on the value of EVG_VARIANT. It returns an error if EVG_VARIANT is unset or set to an unknown value.

func Platforms

func Platforms() []Platform

func (Platform) ArtifactExtensions

func (p Platform) ArtifactExtensions() []string

func (Platform) DebianArch

func (p Platform) DebianArch() string

func (Platform) RPMArch

func (p Platform) RPMArch() string

func (Platform) Variant

func (p Platform) Variant() string

type Repo

type Repo string
const (
	RepoOrg        Repo = "org"
	RepoEnterprise Repo = "enterprise"
)

func (Repo) ConstName

func (r Repo) ConstName() string

func (Repo) String

func (r Repo) String() string

Jump to

Keyboard shortcuts

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