update

package
v0.0.0-...-02d3535 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PlatformTypeDarwin is platform type for OS X
	PlatformTypeDarwin = "darwin"
	// PlatformTypeLinux is platform type for Linux
	PlatformTypeLinux = "linux"
	// PlatformTypeWindows is platform type for windows
	PlatformTypeWindows = "windows"
)

Variables

This section is empty.

Functions

func AnnounceBuild

func AnnounceBuild(keybaseToken string, buildA string, buildB string, platform string) error

AnnounceBuild tells the API server about the existence of a new build. It does not enroll it in smoke testing.

func CombineErrors

func CombineErrors(errs ...error) error

CombineErrors returns a single error for multiple errors, or nil if none

func CopyLatest

func CopyLatest(bucketName string, platform string, dryRun bool) error

CopyLatest copies latest release to a fixed path

func EncodeJSON

func EncodeJSON(version string, name string, descriptionPath string, props []string, src string, uri fmt.Stringer, signaturePath string) ([]byte, error)

EncodeJSON returns JSON (as bytes) for an update

func FromTime

func FromTime(t Time) time.Time

FromTime converts millis to Time

func KBWebPromote

func KBWebPromote(keybaseToken string, buildA string, platform string, dryRun bool) (releaseTime time.Time, err error)

KBWebPromote tells the API server that a new build is promoted.

func PromoteTestReleases

func PromoteTestReleases(bucketName string, platformName string, release string) error

PromoteTestReleases creates test releases for a platform

func RandBytes

func RandBytes(length int) ([]byte, error)

RandBytes returns random bytes of length

func RandomID

func RandomID() (string, error)

RandomID returns a random identifier

func ReleaseBroken

func ReleaseBroken(releaseName string, bucketName string, platformName string) ([]string, error)

ReleaseBroken marks a release as broken. The releaseName is the version, for example, 1.2.3+400-deadbeef.

func RemoveNilErrors

func RemoveNilErrors(errs []error) []error

RemoveNilErrors returns error slice with nil errors removed

func Report

func Report(bucketName string, writer io.Writer) error

Report returns a summary of releases

func SaveLog

func SaveLog(bucketName string, localPath string, maxNumBytes int64) (string, error)

SaveLog saves log to S3 bucket (last maxNumBytes) and returns the URL. The log is publicly readable on S3 but the url is not discoverable.

func SetBuildInTesting

func SetBuildInTesting(keybaseToken string, buildA string, platform string, inTesting string, maxTesters int) error

SetBuildInTesting tells the API server to enroll or unenroll a build in smoke testing.

func WriteHTML

func WriteHTML(bucketName string, prefixes string, suffix string, outPath string, uploadDest string) error

WriteHTML creates an html file for releases

func WriteHTMLForLinks(title string, sections []Section, writer io.Writer) error

WriteHTMLForLinks writes a summary document for a set of releases

Types

type APIResponseWrapper

type APIResponseWrapper interface {
	StatusCode() int
}

type AppResponseBase

type AppResponseBase struct {
	Status struct {
		Code int
		Desc string
	}
}

func (*AppResponseBase) StatusCode

func (s *AppResponseBase) StatusCode() int

type Asset

type Asset struct {
	Name      string `codec:"name" json:"name"`
	URL       string `codec:"url" json:"url"`
	Digest    string `codec:"digest" json:"digest"`
	Signature string `codec:"signature" json:"signature"`
	LocalPath string `codec:"localPath" json:"localPath"`
}

Asset describes a downloadable file.

type ByRelease

type ByRelease []Release

ByRelease defines how to sort releases

func (ByRelease) Len

func (s ByRelease) Len() int

func (ByRelease) Less

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

func (ByRelease) Swap

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

type Client

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

Client is an S3 client

func NewClient

func NewClient() (*Client, error)

NewClient constructs a Client

func (*Client) CopyLatest

func (c *Client) CopyLatest(bucketName string, platform string, dryRun bool) error

CopyLatest copies latest release to a fixed path for the Client

func (*Client) CurrentUpdate

func (c *Client) CurrentUpdate(bucketName string, channel string, platformName string, env string) (currentUpdate *Update, path string, err error)

CurrentUpdate returns current update for a platform

func (*Client) PromoteRelease

func (c *Client) PromoteRelease(bucketName string, delay time.Duration, beforeHourEastern int, toChannel string, platform Platform, env string, allowDowngrade bool, releaseName string) (*Release, error)

PromoteRelease promotes a release to a channel

type Platform

type Platform struct {
	Name          string
	Prefix        string
	PrefixSupport string
	Suffix        string
	LatestName    string
}

Platform defines where platform specific files are (in darwin, linux, windows)

func Platforms

func Platforms(name string) ([]Platform, error)

Platforms returns platforms for a name (linux may have multiple platforms) or all platforms is "" is specified

func (Platform) Files

func (p Platform) Files(releaseName string) ([]string, error)

Files returns all files associated with this platforms release

func (*Platform) FindRelease

func (p *Platform) FindRelease(bucketName string, f func(r Release) bool) (*Release, error)

FindRelease searches for a release matching a predicate

func (Platform) WriteHTML

func (p Platform) WriteHTML(bucketName string) error

WriteHTML will generate index.html for the platform

type Property

type Property struct {
	Name  string `codec:"name" json:"name"`
	Value string `codec:"value" json:"value"`
}

Property is a generic key value pair for custom properties

type Release

type Release struct {
	Name       string
	Key        string
	URL        string
	Version    string
	DateString string
	Date       time.Time
	Commit     string
}

Release defines a release bundle

func PromoteARelease

func PromoteARelease(releaseName string, bucketName string, platform string, dryRun bool) (release *Release, err error)

PromoteARelease promotes a specific release to Prod.

func PromoteReleases

func PromoteReleases(bucketName string, platform string) (release *Release, err error)

PromoteReleases creates releases for a platform

type Section

type Section struct {
	Header   string
	Releases []Release
}

Section defines a set of releases

type Time

type Time int64

Time as millis

func ToTime

func ToTime(t time.Time) Time

ToTime converts Time to millis

type Type

type Type int

Type is the type of update

const (
	// Normal is a normal update
	Normal Type = 0
	// Bugfix is a bugfix
	Bugfix Type = 1
	// Critical is critical
	Critical Type = 2
)

type Update

type Update struct {
	Version      string     `codec:"version" json:"version"`
	Name         string     `codec:"name" json:"name"`
	Description  string     `codec:"description" json:"description"`
	Instructions *string    `codec:"instructions,omitempty" json:"instructions,omitempty"`
	Type         Type       `codec:"type" json:"type"`
	PublishedAt  *Time      `codec:"publishedAt,omitempty" json:"publishedAt,omitempty"`
	Props        []Property `codec:"props" json:"props,omitempty"`
	Asset        *Asset     `codec:"asset,omitempty" json:"asset,omitempty"`
}

Update defines an update

func DecodeJSON

func DecodeJSON(r io.Reader) (*Update, error)

DecodeJSON returns an update object from JSON (bytes)

Jump to

Keyboard shortcuts

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