context

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package context manages the state of the pipeline

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	ctx.Context
	Config                  config.Project
	RawConfig               config.Project
	Env                     Env
	Date                    time.Time
	Git                     GitInfo
	CurrentDirectory        string
	Credentials             Credentials
	AppsToRelease           []string
	PublishMode             PublishMode
	Log                     log.Interface
	MaxProcesses            int
	SkipGit                 bool
	SkipUpdatePricing       bool
	SkipUpdateMetadata      bool
	SkipSubmit              bool
	OverrideBetaGroups      bool
	OverrideBetaTesters     bool
	VersionIsInitialRelease bool
	Version                 string
	Build                   string
	Semver                  Semver
}

Context carries along some data through the pipes.

func New

func New(config config.Project) *Context

New context.

func NewWithTimeout

func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc)

NewWithTimeout new context with the given timeout.

func Wrap

func Wrap(ctx ctx.Context, config config.Project) *Context

Wrap wraps an existing context.

type Credentials

type Credentials interface {
	Client() *http.Client
}

Credentials stores credentials used by clients.

func NewCredentials

func NewCredentials(keyID, issuerID string, privateKey []byte) (Credentials, error)

NewCredentials returns a new store object for App Store Connect credentials.

type Env

type Env map[string]string

Env is the environment variables.

func (Env) Copy

func (e Env) Copy() Env

Copy returns a copy of the environment.

func (Env) Strings

func (e Env) Strings() []string

Strings returns the current environment as a list of strings, suitable for os executions.

type GitInfo

type GitInfo struct {
	CurrentTag  string
	Commit      string
	ShortCommit string
	FullCommit  string
	CommitDate  time.Time
	URL         string
}

GitInfo includes tags and refs.

type Interrupt

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

Interrupt tracks signals from the OS to determine whether to interrupt.

func NewInterrupt

func NewInterrupt() *Interrupt

NewInterrupt creates an interrupt instance.

func (*Interrupt) Run

func (i *Interrupt) Run(ctx context.Context, task Task) error

Run executes a given task with a given context, dealing with its timeouts, cancels and SIGTERM and SIGINT signals. It will return an error if the context is canceled, if deadline exceeds, if a SIGTERM or SIGINT is received and of course if the task itself fails.

type PublishMode

type PublishMode string

PublishMode describes which review destination to publish to.

const (
	// PublishModeTestflight publishes to Testflight via beta app review.
	PublishModeTestflight PublishMode = "testflight"
	// PublishModeAppStore publishes for App Store review.
	PublishModeAppStore PublishMode = "appstore"
)

func (*PublishMode) Set

func (m *PublishMode) Set(value string) error

Set the mode to an allowed value, or return an error.

func (PublishMode) String

func (m PublishMode) String() string

String returns the string value of the mode.

func (PublishMode) Type

func (m PublishMode) Type() string

Type returns a representation of permissible values.

type Semver

type Semver struct {
	Major      uint64
	Minor      uint64
	Patch      uint64
	Prerelease string
	RawVersion string
}

Semver represents a semantic version.

type Task

type Task func() error

Task is function that can be executed by an interrupt.

Jump to

Keyboard shortcuts

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