model

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SailSecretKey = "Secret"
	SailRoomIDKey = "room_id"
)
View Source
const BuildHistoryLimit = 2
View Source
const BuildReasonNone = BuildReason(0)
View Source
const DefaultSailPort = 10450
View Source
const OrchestratorDC = Orchestrator("DockerCompose")
View Source
const OrchestratorK8s = Orchestrator("Kubernetes")
View Source
const OrchestratorUnknown = Orchestrator("")
View Source
const UnresourcedYAMLManifestName = ManifestName("uncategorized")

TODO(maia): throw an error if you try to name a manifest this in your Tiltfile?

Variables

This section is empty.

Functions

func ChangesInvalidateBuild

func ChangesInvalidateBuild(old, new Manifest) bool

ChangesInvalidateBuild checks whether the changes from old => new manifest invalidate our build of the old one; i.e. if we're replacing `old` with `new`, should we perform a full rebuild?

func DeepEqual

func DeepEqual(x, y interface{}) bool

func ImageTargetsByID

func ImageTargetsByID(iTargets []ImageTarget) map[TargetID]ImageTarget

func MakeTargetMap

func MakeTargetMap(targets []TargetSpec) map[TargetID]TargetSpec

Map all the targets by their target ID.

func NewRelativeFileOrChildMatcher

func NewRelativeFileOrChildMatcher(baseDir string, paths ...string) fileOrChildMatcher

NewRelativeFileOrChildMatcher returns a matcher for the given paths (with any relative paths converted to absolute, relative to the given baseDir).

func NewSimpleFileMatcher

func NewSimpleFileMatcher(paths ...string) (fileMatcher, error)

NewSimpleFileMatcher returns a matcher for the given paths; any relative paths are converted to absolute (relative to cwd).

func TargetIDSet

func TargetIDSet(tids []TargetID) map[TargetID]bool

func TimestampPrefix

func TimestampPrefix(ts time.Time) []byte

func UnrecognizedSailModeError

func UnrecognizedSailModeError(v string) error

func UnrecognizedWebModeError

func UnrecognizedWebModeError(v string) error

Types

type BuildDetails

type BuildDetails interface {
	// contains filtered or unexported methods
}

type BuildReason

type BuildReason int
const (
	BuildReasonFlagChangedFiles BuildReason = 1 << iota
	BuildReasonFlagConfig

	// See comments on NeedsRebuildFromCrash
	BuildReasonFlagCrash

	BuildReasonFlagInit
)

func (BuildReason) Has

func (r BuildReason) Has(flag BuildReason) bool

func (BuildReason) IsCrashOnly

func (r BuildReason) IsCrashOnly() bool

func (BuildReason) With

func (r BuildReason) With(flag BuildReason) BuildReason

type BuildRecord

type BuildRecord struct {
	Edits      []string
	Error      error
	Warnings   []string
	StartTime  time.Time
	FinishTime time.Time // IsZero() == true for in-progress builds
	Reason     BuildReason
	Log        Log `testdiff:"ignore"`
}

func (BuildRecord) Duration

func (bs BuildRecord) Duration() time.Duration

func (BuildRecord) Empty

func (bs BuildRecord) Empty() bool

type Cmd

type Cmd struct {
	Argv []string
}

func ToShellCmd

func ToShellCmd(cmd string) Cmd

func ToShellCmds

func ToShellCmds(cmds []string) []Cmd

func TrySquash

func TrySquash(runs []Cmd) []Cmd

func (Cmd) Empty

func (c Cmd) Empty() bool

func (Cmd) EntrypointStr

func (c Cmd) EntrypointStr() string

func (Cmd) IsShellStandardForm

func (c Cmd) IsShellStandardForm() bool

func (Cmd) RunStr

func (c Cmd) RunStr() string

func (Cmd) ShellStandardScript

func (c Cmd) ShellStandardScript() string

Get the script when the shell is in standard form. Panics if the command is not in shell standard form.

func (Cmd) String

func (c Cmd) String() string

type CompositePathMatcher

type CompositePathMatcher struct {
	Matchers []PathMatcher
}

func (CompositePathMatcher) Matches

func (c CompositePathMatcher) Matches(f string) (bool, error)

func (CompositePathMatcher) MatchesEntireDir

func (c CompositePathMatcher) MatchesEntireDir(f string) (bool, error)

type CustomBuild

type CustomBuild struct {
	Command string
	// Deps is a list of file paths that are dependencies of this command.
	Deps []string

	// Optional: tag we expect the image to be built with (we use this to check that
	// the expected image+tag has been created).
	// If empty, we create an expected tag at the beginning of CustomBuild (and
	// export $EXPECTED_REF=name:expected_tag )
	Tag string

	Fast        FastBuild
	LiveUpdate  LiveUpdate // Optionally, can use LiveUpdate to update this build in place.
	DisablePush bool
}

func (CustomBuild) WithTag

func (cb CustomBuild) WithTag(t string) CustomBuild

type DeployID

type DeployID int64 // Unix ns after epoch -- uniquely identify a deploy

TODO(nick): I'm pretty sure this is obsolete now.

func NewDeployID

func NewDeployID() DeployID

func (DeployID) Empty

func (dID DeployID) Empty() bool

func (DeployID) String

func (dID DeployID) String() string

type DockerBuild

type DockerBuild struct {
	Dockerfile string
	BuildPath  string // the absolute path to the files
	BuildArgs  DockerBuildArgs
	FastBuild  FastBuild  // Optionally, can use FastBuild to update this build in place.
	LiveUpdate LiveUpdate // Optionally, can use LiveUpdate to update this build in place.
}

type DockerBuildArgs

type DockerBuildArgs map[string]string

type DockerComposeTarget

type DockerComposeTarget struct {
	Name        TargetName
	ConfigPaths []string

	YAMLRaw []byte // for diff'ing when config files change
	DfRaw   []byte // for diff'ing when config files change
	// contains filtered or unexported fields
}

func ExtractDockerComposeTargets

func ExtractDockerComposeTargets(specs []TargetSpec) []DockerComposeTarget

func (DockerComposeTarget) Dependencies

func (t DockerComposeTarget) Dependencies() []string

TODO(nick): This method should be deleted. We should just de-dupe and sort LocalPaths once when we create it, rather than have a duplicate method that does the "right" thing.

func (DockerComposeTarget) DependencyIDs

func (t DockerComposeTarget) DependencyIDs() []TargetID

func (DockerComposeTarget) Dockerignores

func (t DockerComposeTarget) Dockerignores() []Dockerignore

func (DockerComposeTarget) Empty

func (t DockerComposeTarget) Empty() bool

func (DockerComposeTarget) ID

func (DockerComposeTarget) IgnoredLocalDirectories

func (t DockerComposeTarget) IgnoredLocalDirectories() []string

func (DockerComposeTarget) LocalPaths

func (t DockerComposeTarget) LocalPaths() []string

func (DockerComposeTarget) LocalRepos

func (t DockerComposeTarget) LocalRepos() []LocalGitRepo

func (DockerComposeTarget) ManifestName

func (t DockerComposeTarget) ManifestName() ManifestName

TODO(nick): This is a temporary hack until we figure out how we want to pass these IDs to the docker-compose UX.

func (DockerComposeTarget) PublishedPorts

func (t DockerComposeTarget) PublishedPorts() []int

func (DockerComposeTarget) TiltFilename

func (t DockerComposeTarget) TiltFilename() string

func (DockerComposeTarget) Validate

func (dc DockerComposeTarget) Validate() error

func (DockerComposeTarget) WithBuildPath

func (t DockerComposeTarget) WithBuildPath(buildPath string) DockerComposeTarget

func (DockerComposeTarget) WithDependencyIDs

func (t DockerComposeTarget) WithDependencyIDs(ids []TargetID) DockerComposeTarget

func (DockerComposeTarget) WithDockerignores

func (t DockerComposeTarget) WithDockerignores(dockerignores []Dockerignore) DockerComposeTarget

func (DockerComposeTarget) WithIgnoredLocalDirectories

func (t DockerComposeTarget) WithIgnoredLocalDirectories(dirs []string) DockerComposeTarget

func (DockerComposeTarget) WithPublishedPorts

func (t DockerComposeTarget) WithPublishedPorts(ports []int) DockerComposeTarget

func (DockerComposeTarget) WithRepos

func (DockerComposeTarget) WithTiltFilename

func (t DockerComposeTarget) WithTiltFilename(f string) DockerComposeTarget

type Dockerignore

type Dockerignore struct {
	// The path to evaluate the dockerignore contents relative to
	LocalPath string
	Contents  string
}

type FastBuild

type FastBuild struct {
	BaseDockerfile string
	Syncs          []Sync
	Runs           []Run
	Entrypoint     Cmd

	// A HotReload container image knows how to automatically
	// reload any changes in the container. No need to restart it.
	HotReload bool
}

func (FastBuild) Empty

func (fb FastBuild) Empty() bool

type ImageTarget

type ImageTarget struct {
	ConfigurationRef container.RefSelector
	DeploymentRef    reference.Named
	BuildDetails     BuildDetails
	MatchInEnvVars   bool

	// User-supplied command to run when the container runs
	// (i.e. overrides k8s yaml "command", container ENTRYPOINT, etc.)
	OverrideCmd Cmd
	// contains filtered or unexported fields
}

func ExtractImageTargets

func ExtractImageTargets(specs []TargetSpec) []ImageTarget

func NewImageTarget

func NewImageTarget(ref container.RefSelector) ImageTarget

func (ImageTarget) AnyFastBuildInfo

func (i ImageTarget) AnyFastBuildInfo() FastBuild

func (ImageTarget) AnyLiveUpdateInfo

func (i ImageTarget) AnyLiveUpdateInfo() LiveUpdate

func (ImageTarget) CachePaths

func (i ImageTarget) CachePaths() []string

func (ImageTarget) CustomBuildInfo

func (i ImageTarget) CustomBuildInfo() CustomBuild

func (ImageTarget) Dependencies

func (i ImageTarget) Dependencies() []string

TODO(nick): This method should be deleted. We should just de-dupe and sort LocalPaths once when we create it, rather than have a duplicate method that does the "right" thing.

func (ImageTarget) DependencyIDs

func (i ImageTarget) DependencyIDs() []TargetID

func (ImageTarget) DockerBuildInfo

func (i ImageTarget) DockerBuildInfo() DockerBuild

func (ImageTarget) Dockerignores

func (i ImageTarget) Dockerignores() []Dockerignore

func (ImageTarget) ID

func (i ImageTarget) ID() TargetID

func (ImageTarget) IgnoredLocalDirectories

func (i ImageTarget) IgnoredLocalDirectories() []string

func (ImageTarget) IsCustomBuild

func (i ImageTarget) IsCustomBuild() bool

func (ImageTarget) IsDockerBuild

func (i ImageTarget) IsDockerBuild() bool

func (ImageTarget) IsFastBuild

func (i ImageTarget) IsFastBuild() bool

IsFastBuild checks if the TOP LEVEL BUILD DETAILS are for a FastBuild. (If this target is a DockerBuild || CustomBuild with a nested FastBuild, returns FALSE.)

func (ImageTarget) LocalPaths

func (i ImageTarget) LocalPaths() []string

func (ImageTarget) LocalRepos

func (i ImageTarget) LocalRepos() []LocalGitRepo

func (ImageTarget) TiltFilename

func (i ImageTarget) TiltFilename() string

func (ImageTarget) TopFastBuildInfo

func (i ImageTarget) TopFastBuildInfo() FastBuild

FastBuildInfo returns the TOP LEVEL BUILD DETAILS, if a FastBuild. Does not return nested FastBuild details.

func (ImageTarget) Validate

func (i ImageTarget) Validate() error

func (ImageTarget) WithBuildDetails

func (i ImageTarget) WithBuildDetails(details BuildDetails) ImageTarget

func (ImageTarget) WithCachePaths

func (i ImageTarget) WithCachePaths(paths []string) ImageTarget

func (ImageTarget) WithDependencyIDs

func (i ImageTarget) WithDependencyIDs(ids []TargetID) ImageTarget

func (ImageTarget) WithDockerignores

func (i ImageTarget) WithDockerignores(dockerignores []Dockerignore) ImageTarget

func (ImageTarget) WithOverrideCommand

func (i ImageTarget) WithOverrideCommand(cmd Cmd) ImageTarget

func (ImageTarget) WithRepos

func (i ImageTarget) WithRepos(repos []LocalGitRepo) ImageTarget

func (ImageTarget) WithTiltFilename

func (i ImageTarget) WithTiltFilename(f string) ImageTarget

type K8sTarget

type K8sTarget struct {
	Name         TargetName
	YAML         string
	PortForwards []PortForward
	// labels for pods that we should watch and associate with this resource
	ExtraPodSelectors []labels.Selector

	// Each K8s entity should have a display name for user interfaces
	// that balances brevity and uniqueness
	DisplayNames []string
	// contains filtered or unexported fields
}

func ExtractK8sTargets

func ExtractK8sTargets(specs []TargetSpec) []K8sTarget

func (K8sTarget) AppendYAML

func (k8s K8sTarget) AppendYAML(y string) K8sTarget

func (K8sTarget) DependencyIDs

func (k8s K8sTarget) DependencyIDs() []TargetID

func (K8sTarget) Empty

func (k8s K8sTarget) Empty() bool

func (K8sTarget) ID

func (k8s K8sTarget) ID() TargetID

func (K8sTarget) RefInjectCounts

func (k8s K8sTarget) RefInjectCounts() map[string]int

func (K8sTarget) Validate

func (k8s K8sTarget) Validate() error

func (K8sTarget) WithDependencyIDs

func (k8s K8sTarget) WithDependencyIDs(ids []TargetID) K8sTarget

func (K8sTarget) WithRefInjectCounts

func (k8s K8sTarget) WithRefInjectCounts(ric map[string]int) K8sTarget

type LabelPair

type LabelPair struct {
	Key   string
	Value string
}

func ToLabelPairs

func ToLabelPairs(m map[string]string) []LabelPair

type LiveUpdate

type LiveUpdate struct {
	Steps   []LiveUpdateStep
	BaseDir string // directory where the LiveUpdate was initialized (we'll use this to eval. any relative paths)
}

Specifies how to update a running container.

  1. If any paths specified in a FallBackOn step have changed, fall back to an image build (i.e. don't do a LiveUpdate)
  2. If there are Sync steps in `Steps`, files will be synced as specified.
  3. Any time we sync one or more files, all Run and RestartContainer steps will be evaluated.

func NewLiveUpdate

func NewLiveUpdate(steps []LiveUpdateStep, baseDir string) (LiveUpdate, error)

func (LiveUpdate) Empty

func (lu LiveUpdate) Empty() bool

func (LiveUpdate) FallBackOnFiles

func (lu LiveUpdate) FallBackOnFiles() PathSet

FallBackOnFiles returns a PathSet of files which, if any have changed, indicate that we should fall back to an image build.

func (LiveUpdate) RunSteps

func (lu LiveUpdate) RunSteps() []Run

func (LiveUpdate) ShouldRestart

func (lu LiveUpdate) ShouldRestart() bool

func (LiveUpdate) SyncSteps

func (lu LiveUpdate) SyncSteps() []Sync

type LiveUpdateFallBackOnStep

type LiveUpdateFallBackOnStep struct {
	Files []string
}

Specifies that changes to any of the given files should cause the builder to fall back (i.e. do a full image build)

type LiveUpdateRestartContainerStep

type LiveUpdateRestartContainerStep struct{}

Specifies that the container should be restarted when any files in `Sync` steps have changed.

type LiveUpdateRunStep

type LiveUpdateRunStep struct {
	Command  Cmd
	Triggers PathSet
}

Specifies that `Command` should be executed when any files in `Sync` steps have changed If `Trigger` is non-empty, `Command` will only be executed when the local paths of changed files covered by at least one `Sync` match one of `PathSet.Paths` (evaluated relative to `PathSet.BaseDirectory`.

type LiveUpdateStep

type LiveUpdateStep interface {
	// contains filtered or unexported methods
}

type LiveUpdateSyncStep

type LiveUpdateSyncStep struct {
	Source, Dest string
}

Specifies that changes to local path `Source` should be synced to container path `Dest`

type LocalGitRepo

type LocalGitRepo struct {
	LocalPath string
}

func (LocalGitRepo) IsRepo

func (LocalGitRepo) IsRepo()

type Log

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

func AppendLog

func AppendLog(l Log, le LogEvent, timestampsEnabled bool, prefix string) Log

Returns a new instance of `Log` with content equal to `b` appended to the end of `l` Performs truncation off the start of the log (at a newline) to ensure the resulting log is not longer than `maxLogLengthInBytes`. (which maybe means a pedant would say this isn't strictly an `append`?)

func NewLog

func NewLog(s string) Log

func (Log) Empty

func (l Log) Empty() bool

func (Log) Len

func (l Log) Len() int

func (Log) MarshalJSON

func (l Log) MarshalJSON() ([]byte, error)

func (Log) String

func (l Log) String() string

func (Log) Tail

func (l Log) Tail(n int) Log

Get at most N lines from the tail of the log.

type LogEvent

type LogEvent interface {
	Message() []byte
	Time() time.Time
}

type Manifest

type Manifest struct {
	// Properties for all manifests.
	Name ManifestName

	// Info needed to build an image. (This struct contains details of DockerBuild, FastBuild... etc.)
	ImageTargets []ImageTarget

	// How updates are triggered:
	// - automatically, when we detect a change
	// - manually, when the user tells us to
	TriggerMode TriggerMode
	// contains filtered or unexported fields
}

NOTE: If you modify Manifest, make sure to modify `Manifest.Equal` appropriately

func (Manifest) DependencyIDs

func (m Manifest) DependencyIDs() []TargetID

func (Manifest) DeployTarget

func (m Manifest) DeployTarget() TargetSpec

func (Manifest) DockerComposeTarget

func (m Manifest) DockerComposeTarget() DockerComposeTarget

func (Manifest) Empty

func (m Manifest) Empty() bool

func (Manifest) Equal

func (m1 Manifest) Equal(m2 Manifest) bool

func (Manifest) ID

func (m Manifest) ID() TargetID

func (Manifest) ImageTargetAt

func (m Manifest) ImageTargetAt(i int) ImageTarget

func (Manifest) IsDC

func (m Manifest) IsDC() bool

func (Manifest) IsImageDeployed

func (m Manifest) IsImageDeployed(iTarget ImageTarget) bool

func (Manifest) IsK8s

func (m Manifest) IsK8s() bool

func (Manifest) IsUnresourcedYAMLManifest

func (m Manifest) IsUnresourcedYAMLManifest() bool

func (Manifest) K8sTarget

func (m Manifest) K8sTarget() K8sTarget

func (Manifest) LocalPaths

func (m Manifest) LocalPaths() []string

func (Manifest) ManifestName

func (m Manifest) ManifestName() ManifestName

func (Manifest) TargetSpecs

func (m Manifest) TargetSpecs() []TargetSpec

func (Manifest) Validate

func (m Manifest) Validate() error

func (Manifest) WithDeployTarget

func (m Manifest) WithDeployTarget(t TargetSpec) Manifest

func (Manifest) WithImageTarget

func (m Manifest) WithImageTarget(iTarget ImageTarget) Manifest

func (Manifest) WithImageTargets

func (m Manifest) WithImageTargets(iTargets []ImageTarget) Manifest

func (Manifest) WithTriggerMode

func (m Manifest) WithTriggerMode(mode TriggerMode) Manifest

type ManifestName

type ManifestName string

TODO(nick): We should probably get rid of ManifestName completely and just use TargetName everywhere.

func (ManifestName) String

func (m ManifestName) String() string

func (ManifestName) TargetName

func (m ManifestName) TargetName() TargetName

type NoBrowser

type NoBrowser bool // flag for disabling automatic browser opening

type Orchestrator

type Orchestrator string

The current orchestrator we're running with (K8s or DockerCompose)

type PathMatcher

type PathMatcher interface {
	Matches(f string) (bool, error)

	// If this matches the entire dir, we can often optimize filetree walks a bit
	MatchesEntireDir(file string) (bool, error)
}
var EmptyMatcher PathMatcher = emptyMatcher{}

func NewCompositeMatcher

func NewCompositeMatcher(matchers []PathMatcher) PathMatcher

type PathSet

type PathSet struct {
	Paths         []string
	BaseDirectory string
}

A PathSet stores one or more filepaths, along with the directory that any relative paths are relative to NOTE(maia): in its current usage (for LiveUpdate.Run.Triggers, LiveUpdate.FallBackOnFiles()) this isn't strictly necessary, could just as easily convert paths to Abs when specified in the Tiltfile--but leaving this code in place for now because it was already written and may help with complicated future cases (glob support, etc.)

func NewPathSet

func NewPathSet(paths []string, baseDir string) PathSet

func (PathSet) AnyMatch

func (ps PathSet) AnyMatch(paths []string) (bool, string, error)

AnyMatch returns true if any of the given filepaths match any paths contained in the pathset (along with the first path that matched).

func (PathSet) Empty

func (ps PathSet) Empty() bool

type PortForward

type PortForward struct {
	// The port to expose on localhost of the current machine.
	LocalPort int

	// The port to connect to inside the deployed container.
	// If 0, we will connect to the first containerPort.
	ContainerPort int
}

type RoomID

type RoomID string

type Run

type Run struct {
	// Required. The command to run.
	Cmd Cmd
	// Optional. If not specified, this command runs on every change.
	// If specified, we only run the Cmd if the changed file matches a trigger.
	Triggers PathSet
}

func ToRun

func ToRun(cmd Cmd) Run

func ToRuns

func ToRuns(cmds []Cmd) []Run

func (Run) WithTriggers

func (r Run) WithTriggers(paths []string, baseDir string) Run

type SailMode

type SailMode string

Mode for developing Tilt against the Sail server.

Currently controls whether we use a local instance or the production instance.

const (
	SailModeDefault SailMode = "default"

	SailModeDisabled SailMode = "none"

	// Local sail server on localhost:10350
	SailModeLocal SailMode = "local"

	// Remote sail server on sail-staging.tilt.dev. Useful for testing SSL.
	// Always uses precompiled JS, because one of the things we want to test
	// with sail-staging is the JS at head (rather than testing the production JS).
	SailModeStaging SailMode = "staging"

	// Production sail server at sail.tilt.dev.
	// Serves production JS according to the version of Tilt that opened the room.
	SailModeProd SailMode = "prod"
)

func (*SailMode) IsEnabled

func (m *SailMode) IsEnabled() bool

func (*SailMode) Set

func (m *SailMode) Set(v string) error

func (*SailMode) String

func (m *SailMode) String() string

func (*SailMode) Type

func (m *SailMode) Type() string

type SailNewRoomRequest

type SailNewRoomRequest struct {
	WebVersion WebVersion `json:"web_version"`
}

type SailPort

type SailPort int

type SailRoomInfo

type SailRoomInfo struct {
	RoomID RoomID `json:"room_id"`
	Secret string `json:"secret"`
}

type SailURL

type SailURL url.URL

func (SailURL) Empty

func (u SailURL) Empty() bool

func (SailURL) Hostname

func (u SailURL) Hostname() string

func (SailURL) Http

func (u SailURL) Http() SailURL

func (SailURL) String

func (u SailURL) String() string

func (SailURL) WithQueryParam

func (u SailURL) WithQueryParam(key, value string) SailURL

func (SailURL) Ws

func (u SailURL) Ws() SailURL

type Sync

type Sync struct {
	LocalPath     string
	ContainerPath string
}

type Target

type Target interface {
	Spec() TargetSpec
	Status() TargetStatus
}

type TargetGraph

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

func NewTargetGraph

func NewTargetGraph(targets []TargetSpec) (TargetGraph, error)

func (TargetGraph) DeployedImages

func (g TargetGraph) DeployedImages() []ImageTarget

Returns all the images in the graph that are directly deployed to a container.

func (TargetGraph) DepsOf

func (g TargetGraph) DepsOf(t TargetSpec) ([]TargetSpec, error)

Return the direct dependency targets.

func (TargetGraph) Images

func (g TargetGraph) Images() []ImageTarget

func (TargetGraph) IsDeployedImage

func (g TargetGraph) IsDeployedImage(iTarget ImageTarget) bool

Is this image directly deployed a container?

func (TargetGraph) IsSingleSourceDAG

func (g TargetGraph) IsSingleSourceDAG() bool

In Tilt, Manifests should always be DAGs with a single root node (the deploy target). This is just a quick sanity check to make sure that's true, because many of our graph-traversal algorithms won't work if it's not true.

func (TargetGraph) VisitTree

func (g TargetGraph) VisitTree(root TargetSpec, visit func(dep TargetSpec) error) error

Visit t and its transitive dependencies in post-order (aka depth-first)

type TargetID

type TargetID struct {
	Type TargetType
	Name TargetName
}

func DedupeTargetIDs

func DedupeTargetIDs(ids []TargetID) []TargetID

De-duplicate target ids, maintaining the same order.

func ImageID

func ImageID(ref container.RefSelector) TargetID

func (TargetID) Empty

func (id TargetID) Empty() bool

func (TargetID) String

func (id TargetID) String() string

type TargetName

type TargetName string

func (TargetName) String

func (n TargetName) String() string

type TargetSpec

type TargetSpec interface {
	ID() TargetID

	// Check to make sure the spec is well-formed.
	// All TargetSpecs should throw an error in the case where the ID is empty.
	Validate() error

	DependencyIDs() []TargetID
}

func TopologicalSort

func TopologicalSort(targets []TargetSpec) ([]TargetSpec, error)

Create a topologically sorted list of targets. Returns an error if the targets can't be topologically sorted. (e.g., there's a cycle).

type TargetStatus

type TargetStatus interface {
	TargetID() TargetID
	ActiveBuild() BuildRecord
	LastBuild() BuildRecord
}

type TargetType

type TargetType string
const (
	// Deployed k8s entities
	TargetTypeK8s TargetType = "k8s"

	// Image builds
	// TODO(nick): It might make sense to represent FastBuild and normal Docker builds
	// as separate types.
	TargetTypeImage TargetType = "image"

	// Docker-compose service build and deploy
	// TODO(nick): Currently, build and deploy are represented as a single target.
	// In the future, we might have a separate build target and deploy target.
	TargetTypeDockerCompose TargetType = "docker-compose"

	// Aggregation of multiple targets into one UI view.
	// TODO(nick): Currenly used as the type for both Manifest and YAMLManifest, though
	// we expect YAMLManifest to go away.
	TargetTypeManifest TargetType = "manifest"

	// Changes that affect all targets, rebuilding the target graph.
	TargetTypeConfigs TargetType = "configs"
)

type TiltBuild

type TiltBuild struct {
	// Version w/o leading "v"
	Version string
	Date    string
	Dev     bool
}

Information on a build of the Tilt binary

func (TiltBuild) AnalyticsVersion

func (b TiltBuild) AnalyticsVersion() string

func (TiltBuild) Empty

func (b TiltBuild) Empty() bool

func (TiltBuild) WebVersion

func (b TiltBuild) WebVersion() WebVersion

type TriggerMode

type TriggerMode int
const (
	// Automatically, whenever we detect a change, or
	TriggerModeAuto TriggerMode = iota
	// Manually (i.e. only when the user tells us to update)
	TriggerModeManual
)

How builds are triggered (per manifest or globally):

type WebDevPort

type WebDevPort int

type WebMode

type WebMode string
const (
	// By default, we serve the js locally in dev builds and from prod in released
	// builds.
	DefaultWebMode WebMode = "default"

	// Local webpack server
	LocalWebMode WebMode = "local"

	// Prod gcloud bucket
	ProdWebMode WebMode = "prod"

	// Precompiled with `make build-js`. This is an experimental mode
	// we're playing around with to avoid the cost of webpack startup.
	PrecompiledWebMode WebMode = "precompiled"
)

func (*WebMode) Set

func (m *WebMode) Set(v string) error

func (*WebMode) String

func (m *WebMode) String() string

func (*WebMode) Type

func (m *WebMode) Type() string

type WebPort

type WebPort int

type WebURL

type WebURL url.URL

func (WebURL) Empty

func (u WebURL) Empty() bool

func (WebURL) String

func (u WebURL) String() string

type WebVersion

type WebVersion string

Web version of the form vA.B.C, where A, B, and C are integers. Used for fetching web assets

Jump to

Keyboard shortcuts

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