Documentation
¶
Index ¶
- Constants
- func DeepEqual(x, y interface{}) bool
- func ImageTargetsByID(iTargets []ImageTarget) map[TargetID]ImageTarget
- func MakeTargetMap(targets []TargetSpec) map[TargetID]TargetSpec
- func NewRelativeFileOrChildMatcher(baseDir string, paths ...string) fileOrChildMatcher
- func NewSimpleFileMatcher(paths ...string) (fileMatcher, error)
- func TimestampPrefix(ts time.Time) []byte
- func UnrecognizedSailModeError(v string) error
- func UnrecognizedWebModeError(v string) error
- type BuildDetails
- type BuildReason
- type BuildRecord
- type Cmd
- type CompositePathMatcher
- type CompositePatternMatcher
- type CustomBuild
- type DeployID
- type DockerBuild
- type DockerBuildArgs
- type DockerComposeTarget
- func (t DockerComposeTarget) Dependencies() []string
- func (t DockerComposeTarget) DependencyIDs() []TargetID
- func (t DockerComposeTarget) Dockerignores() []Dockerignore
- func (t DockerComposeTarget) Empty() bool
- func (t DockerComposeTarget) ID() TargetID
- func (t DockerComposeTarget) IgnoredLocalDirectories() []string
- func (t DockerComposeTarget) LocalPaths() []string
- func (t DockerComposeTarget) LocalRepos() []LocalGitRepo
- func (t DockerComposeTarget) ManifestName() ManifestName
- func (t DockerComposeTarget) PublishedPorts() []int
- func (t DockerComposeTarget) TiltFilename() string
- func (dc DockerComposeTarget) Validate() error
- func (t DockerComposeTarget) WithBuildPath(buildPath string) DockerComposeTarget
- func (t DockerComposeTarget) WithDependencyIDs(ids []TargetID) DockerComposeTarget
- func (t DockerComposeTarget) WithDockerignores(dockerignores []Dockerignore) DockerComposeTarget
- func (t DockerComposeTarget) WithIgnoredLocalDirectories(dirs []string) DockerComposeTarget
- func (t DockerComposeTarget) WithPublishedPorts(ports []int) DockerComposeTarget
- func (t DockerComposeTarget) WithRepos(repos []LocalGitRepo) DockerComposeTarget
- func (t DockerComposeTarget) WithTiltFilename(f string) DockerComposeTarget
- type Dockerignore
- type FastBuild
- type ImageTarget
- func (i ImageTarget) AnyFastBuildInfo() FastBuild
- func (i ImageTarget) AnyLiveUpdateInfo() LiveUpdate
- func (i ImageTarget) CachePaths() []string
- func (i ImageTarget) CustomBuildInfo() CustomBuild
- func (i ImageTarget) Dependencies() []string
- func (i ImageTarget) DependencyIDs() []TargetID
- func (i ImageTarget) DockerBuildInfo() DockerBuild
- func (i ImageTarget) Dockerignores() []Dockerignore
- func (i ImageTarget) ID() TargetID
- func (i ImageTarget) IgnoredLocalDirectories() []string
- func (i ImageTarget) IsCustomBuild() bool
- func (i ImageTarget) IsDockerBuild() bool
- func (i ImageTarget) IsFastBuild() bool
- func (i ImageTarget) LocalPaths() []string
- func (i ImageTarget) LocalRepos() []LocalGitRepo
- func (i ImageTarget) TiltFilename() string
- func (i ImageTarget) TopFastBuildInfo() FastBuild
- func (i ImageTarget) Validate() error
- func (i ImageTarget) WithBuildDetails(details BuildDetails) ImageTarget
- func (i ImageTarget) WithCachePaths(paths []string) ImageTarget
- func (i ImageTarget) WithDependencyIDs(ids []TargetID) ImageTarget
- func (i ImageTarget) WithDockerignores(dockerignores []Dockerignore) ImageTarget
- func (i ImageTarget) WithRepos(repos []LocalGitRepo) ImageTarget
- func (i ImageTarget) WithTiltFilename(f string) ImageTarget
- type K8sTarget
- type LabelPair
- type LiveUpdate
- type LiveUpdateFallBackOnStep
- type LiveUpdateRestartContainerStep
- type LiveUpdateRunStep
- type LiveUpdateStep
- type LiveUpdateSyncStep
- type LocalGitRepo
- type Log
- type LogEvent
- type Manifest
- func (m Manifest) DependencyIDs() []TargetID
- func (m Manifest) DeployTarget() TargetSpec
- func (m Manifest) DockerComposeTarget() DockerComposeTarget
- func (m Manifest) Empty() bool
- func (m1 Manifest) Equal(m2 Manifest) bool
- func (m Manifest) ID() TargetID
- func (m Manifest) ImageTargetAt(i int) ImageTarget
- func (m Manifest) IsDC() bool
- func (m Manifest) IsImageDeployed(iTarget ImageTarget) bool
- func (m Manifest) IsK8s() bool
- func (m Manifest) IsUnresourcedYAMLManifest() bool
- func (m Manifest) K8sTarget() K8sTarget
- func (m Manifest) LocalPaths() []string
- func (m Manifest) ManifestName() ManifestName
- func (m Manifest) TargetSpecs() []TargetSpec
- func (m Manifest) Validate() error
- func (m Manifest) WithDeployTarget(t TargetSpec) Manifest
- func (m Manifest) WithImageTarget(iTarget ImageTarget) Manifest
- func (m Manifest) WithImageTargets(iTargets []ImageTarget) Manifest
- func (m Manifest) WithTriggerMode(mode TriggerMode) Manifest
- type ManifestName
- type PathMatcher
- type PathSet
- type PatternMatcher
- type PortForward
- type RoomID
- type Run
- type SailMode
- type SailNewRoomRequest
- type SailPort
- type SailRoomInfo
- type SailURL
- type Sync
- type Target
- type TargetGraph
- func (g TargetGraph) DeployedImages() []ImageTarget
- func (g TargetGraph) DepsOf(t TargetSpec) ([]TargetSpec, error)
- func (g TargetGraph) Images() []ImageTarget
- func (g TargetGraph) IsDeployedImage(iTarget ImageTarget) bool
- func (g TargetGraph) IsSingleSourceDAG() bool
- func (g TargetGraph) VisitTree(root TargetSpec, visit func(dep TargetSpec) error) error
- type TargetID
- type TargetName
- type TargetSpec
- type TargetStatus
- type TargetType
- type TiltBuild
- type TriggerMode
- type WebDevPort
- type WebMode
- type WebPort
- type WebURL
- type WebVersion
Constants ¶
const (
SailSecretKey = "Secret"
SailRoomIDKey = "room_id"
)
const BuildHistoryLimit = 2
const BuildReasonNone = BuildReason(0)
const DefaultSailPort = 10450
const UnresourcedYAMLManifestName = ManifestName("k8s_yaml")
TODO(maia): throw an error if you try to name a manifest this in your Tiltfile?
Variables ¶
This section is empty.
Functions ¶
func ImageTargetsByID ¶ added in v0.7.11
func ImageTargetsByID(iTargets []ImageTarget) map[TargetID]ImageTarget
func MakeTargetMap ¶ added in v0.7.11
func MakeTargetMap(targets []TargetSpec) map[TargetID]TargetSpec
Map all the targets by their target ID.
func NewRelativeFileOrChildMatcher ¶ added in v0.8.1
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 TimestampPrefix ¶ added in v0.8.9
func TimestampPrefix(ts time.Time) []byte
func UnrecognizedSailModeError ¶ added in v0.8.4
func UnrecognizedSailModeError(v string) error
func UnrecognizedWebModeError ¶ added in v0.7.11
func UnrecognizedWebModeError(v string) error
Types ¶
type BuildDetails ¶ added in v0.4.1
type BuildDetails interface {
// contains filtered or unexported methods
}
type BuildReason ¶ added in v0.2.0
type BuildReason int
const (
BuildReasonFlagChangedFiles BuildReason = 1 << iota
BuildReasonFlagConfig
// See comments on NeedsRebuildFromCrash
BuildReasonFlagCrash
BuildReasonFlagInit
)
func (BuildReason) IsCrashOnly ¶ added in v0.2.0
func (r BuildReason) IsCrashOnly() bool
type BuildRecord ¶ added in v0.5.1
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"`
}
type Cmd ¶
type Cmd struct {
Argv []string
}
func ToShellCmd ¶
func ToShellCmd(cmd string) Cmd
func ToShellCmds ¶
func ToShellCmds(cmds []string) []Cmd
func (Cmd) EntrypointStr ¶
func (c Cmd) EntrypointStr() string
func (Cmd) IsShellStandardForm ¶
func (c Cmd) IsShellStandardForm() bool
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.
type CompositePathMatcher ¶
type CompositePathMatcher struct {
Matchers []PathMatcher
}
type CompositePatternMatcher ¶
type CompositePatternMatcher struct {
CompositePathMatcher
Matchers []PatternMatcher
}
func (CompositePatternMatcher) AsMatchPatterns ¶
func (c CompositePatternMatcher) AsMatchPatterns() []string
type CustomBuild ¶ added in v0.7.11
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
}
type DeployID ¶ added in v0.7.11
type DeployID int64 // Unix ns after epoch -- uniquely identify a deploy
func NewDeployID ¶ added in v0.7.11
func NewDeployID() DeployID
type DockerBuild ¶ added in v0.7.11
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 ¶ added in v0.2.0
type DockerBuildArgs map[string]string
type DockerComposeTarget ¶ added in v0.4.3
type DockerComposeTarget struct {
Name TargetName
ConfigPath 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 ¶ added in v0.8.1
func ExtractDockerComposeTargets(specs []TargetSpec) []DockerComposeTarget
func (DockerComposeTarget) Dependencies ¶ added in v0.5.0
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 ¶ added in v0.7.11
func (t DockerComposeTarget) DependencyIDs() []TargetID
func (DockerComposeTarget) Dockerignores ¶ added in v0.5.0
func (t DockerComposeTarget) Dockerignores() []Dockerignore
func (DockerComposeTarget) IgnoredLocalDirectories ¶ added in v0.5.0
func (t DockerComposeTarget) IgnoredLocalDirectories() []string
func (DockerComposeTarget) LocalPaths ¶ added in v0.5.0
func (t DockerComposeTarget) LocalPaths() []string
func (DockerComposeTarget) LocalRepos ¶ added in v0.5.0
func (t DockerComposeTarget) LocalRepos() []LocalGitRepo
func (DockerComposeTarget) ManifestName ¶ added in v0.5.1
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 ¶ added in v0.7.11
func (t DockerComposeTarget) PublishedPorts() []int
func (DockerComposeTarget) TiltFilename ¶ added in v0.5.0
func (t DockerComposeTarget) TiltFilename() string
func (DockerComposeTarget) Validate ¶ added in v0.5.0
func (dc DockerComposeTarget) Validate() error
func (DockerComposeTarget) WithBuildPath ¶ added in v0.7.11
func (t DockerComposeTarget) WithBuildPath(buildPath string) DockerComposeTarget
func (DockerComposeTarget) WithDependencyIDs ¶ added in v0.7.11
func (t DockerComposeTarget) WithDependencyIDs(ids []TargetID) DockerComposeTarget
func (DockerComposeTarget) WithDockerignores ¶ added in v0.5.0
func (t DockerComposeTarget) WithDockerignores(dockerignores []Dockerignore) DockerComposeTarget
func (DockerComposeTarget) WithIgnoredLocalDirectories ¶ added in v0.5.0
func (t DockerComposeTarget) WithIgnoredLocalDirectories(dirs []string) DockerComposeTarget
func (DockerComposeTarget) WithPublishedPorts ¶ added in v0.7.11
func (t DockerComposeTarget) WithPublishedPorts(ports []int) DockerComposeTarget
func (DockerComposeTarget) WithRepos ¶ added in v0.5.0
func (t DockerComposeTarget) WithRepos(repos []LocalGitRepo) DockerComposeTarget
func (DockerComposeTarget) WithTiltFilename ¶ added in v0.5.0
func (t DockerComposeTarget) WithTiltFilename(f string) DockerComposeTarget
type Dockerignore ¶ added in v0.4.1
type Dockerignore struct {
// The path to evaluate the dockerignore contents relative to
LocalPath string
Contents string
}
type FastBuild ¶ added in v0.4.1
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
}
type ImageTarget ¶ added in v0.4.3
type ImageTarget struct {
ConfigurationRef container.RefSelector
DeploymentRef reference.Named
BuildDetails BuildDetails
// contains filtered or unexported fields
}
func ExtractImageTargets ¶ added in v0.8.1
func ExtractImageTargets(specs []TargetSpec) []ImageTarget
func NewImageTarget ¶ added in v0.7.11
func NewImageTarget(ref container.RefSelector) ImageTarget
func (ImageTarget) AnyFastBuildInfo ¶ added in v0.8.1
func (i ImageTarget) AnyFastBuildInfo() FastBuild
func (ImageTarget) AnyLiveUpdateInfo ¶ added in v0.8.1
func (i ImageTarget) AnyLiveUpdateInfo() LiveUpdate
func (ImageTarget) CachePaths ¶ added in v0.4.3
func (i ImageTarget) CachePaths() []string
func (ImageTarget) CustomBuildInfo ¶ added in v0.7.11
func (i ImageTarget) CustomBuildInfo() CustomBuild
func (ImageTarget) Dependencies ¶ added in v0.5.0
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 ¶ added in v0.7.11
func (i ImageTarget) DependencyIDs() []TargetID
func (ImageTarget) DockerBuildInfo ¶ added in v0.7.11
func (i ImageTarget) DockerBuildInfo() DockerBuild
func (ImageTarget) Dockerignores ¶ added in v0.5.0
func (i ImageTarget) Dockerignores() []Dockerignore
func (ImageTarget) IgnoredLocalDirectories ¶ added in v0.5.0
func (i ImageTarget) IgnoredLocalDirectories() []string
func (ImageTarget) IsCustomBuild ¶ added in v0.7.11
func (i ImageTarget) IsCustomBuild() bool
func (ImageTarget) IsDockerBuild ¶ added in v0.7.11
func (i ImageTarget) IsDockerBuild() bool
func (ImageTarget) IsFastBuild ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (i ImageTarget) LocalPaths() []string
func (ImageTarget) LocalRepos ¶ added in v0.5.0
func (i ImageTarget) LocalRepos() []LocalGitRepo
func (ImageTarget) TiltFilename ¶ added in v0.5.0
func (i ImageTarget) TiltFilename() string
func (ImageTarget) TopFastBuildInfo ¶ added in v0.8.1
func (i ImageTarget) TopFastBuildInfo() FastBuild
FastBuildInfo returns the TOP LEVEL BUILD DETAILS, if a FastBuild. Does not return nested FastBuild details.
func (ImageTarget) WithBuildDetails ¶ added in v0.4.3
func (i ImageTarget) WithBuildDetails(details BuildDetails) ImageTarget
func (ImageTarget) WithCachePaths ¶ added in v0.4.3
func (i ImageTarget) WithCachePaths(paths []string) ImageTarget
func (ImageTarget) WithDependencyIDs ¶ added in v0.7.11
func (i ImageTarget) WithDependencyIDs(ids []TargetID) ImageTarget
func (ImageTarget) WithDockerignores ¶ added in v0.5.0
func (i ImageTarget) WithDockerignores(dockerignores []Dockerignore) ImageTarget
func (ImageTarget) WithRepos ¶ added in v0.5.0
func (i ImageTarget) WithRepos(repos []LocalGitRepo) ImageTarget
func (ImageTarget) WithTiltFilename ¶ added in v0.5.0
func (i ImageTarget) WithTiltFilename(f string) ImageTarget
type K8sTarget ¶ added in v0.4.3
type K8sTarget struct {
Name TargetName
YAML string
PortForwards []PortForward
// labels for pods that we should watch and associate with this resource
ExtraPodSelectors []labels.Selector
ResourceNames []string
// contains filtered or unexported fields
}
func ExtractK8sTargets ¶ added in v0.8.1
func ExtractK8sTargets(specs []TargetSpec) []K8sTarget
func (K8sTarget) AppendYAML ¶ added in v0.4.3
func (k8s K8sTarget) AppendYAML(y string) K8sTarget
func (K8sTarget) DependencyIDs ¶ added in v0.7.11
func (k8s K8sTarget) DependencyIDs() []TargetID
func (K8sTarget) WithDependencyIDs ¶ added in v0.7.11
func (k8s K8sTarget) WithDependencyIDs(ids []TargetID) K8sTarget
type LabelPair ¶ added in v0.7.1
type LabelPair struct {
Key string
Value string
}
func ToLabelPairs ¶ added in v0.7.11
func ToLabelPairs(m map[string]string) []LabelPair
type LiveUpdate ¶ added in v0.7.11
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.
- If any paths specified in a FallBackOn step have changed, fall back to an image build (i.e. don't do a LiveUpdate)
- If there are Sync steps in `Steps`, files will be synced as specified.
- Any time we sync one or more files, all Run and RestartContainer steps will be evaluated.
func NewLiveUpdate ¶ added in v0.7.11
func NewLiveUpdate(steps []LiveUpdateStep, baseDir string) (LiveUpdate, error)
func (LiveUpdate) FallBackOnFiles ¶ added in v0.7.11
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) ShouldRestart ¶ added in v0.7.11
func (lu LiveUpdate) ShouldRestart() bool
type LiveUpdateFallBackOnStep ¶ added in v0.7.11
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 ¶ added in v0.7.11
type LiveUpdateRestartContainerStep struct{}
Specifies that the container should be restarted when any files in `Sync` steps have changed.
type LiveUpdateRunStep ¶ added in v0.7.11
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 ¶ added in v0.7.11
type LiveUpdateStep interface {
// contains filtered or unexported methods
}
type LiveUpdateSyncStep ¶ added in v0.7.11
type LiveUpdateSyncStep struct {
Source, Dest string
}
Specifies that changes to local path `Source` should be synced to container path `Dest`
type LocalGitRepo ¶ added in v0.4.3
type LocalGitRepo struct {
LocalPath string
}
type Log ¶ added in v0.7.11
type Log struct {
// contains filtered or unexported fields
}
func AppendLog ¶ added in v0.7.11
func AppendLog(l Log, le LogEvent, timestampsEnabled bool, prefix []byte) 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 (Log) MarshalJSON ¶ added in v0.7.11
func (l Log) MarshalJSON() ([]byte, error)
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 ¶ added in v0.7.11
func (m Manifest) DependencyIDs() []TargetID
func (Manifest) DeployTarget ¶ added in v0.7.11
func (m Manifest) DeployTarget() TargetSpec
func (Manifest) DockerComposeTarget ¶ added in v0.4.3
func (m Manifest) DockerComposeTarget() DockerComposeTarget
func (Manifest) ImageTargetAt ¶ added in v0.5.1
func (m Manifest) ImageTargetAt(i int) ImageTarget
func (Manifest) IsImageDeployed ¶ added in v0.8.1
func (m Manifest) IsImageDeployed(iTarget ImageTarget) bool
func (Manifest) IsUnresourcedYAMLManifest ¶ added in v0.8.4
func (m Manifest) IsUnresourcedYAMLManifest() bool
func (Manifest) LocalPaths ¶
func (m Manifest) LocalPaths() []string
func (Manifest) ManifestName ¶ added in v0.1.0
func (m Manifest) ManifestName() ManifestName
func (Manifest) TargetSpecs ¶ added in v0.8.2
func (m Manifest) TargetSpecs() []TargetSpec
func (Manifest) WithDeployTarget ¶ added in v0.4.3
func (m Manifest) WithDeployTarget(t TargetSpec) Manifest
func (Manifest) WithImageTarget ¶ added in v0.5.1
func (m Manifest) WithImageTarget(iTarget ImageTarget) Manifest
func (Manifest) WithImageTargets ¶ added in v0.5.1
func (m Manifest) WithImageTargets(iTargets []ImageTarget) Manifest
func (Manifest) WithTriggerMode ¶ added in v0.8.10
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) TargetName ¶ added in v0.4.3
func (m ManifestName) TargetName() TargetName
type PathMatcher ¶
type PathMatcher interface {
Matches(f string, isDir bool) (bool, error)
}
var EmptyMatcher PathMatcher = emptyMatcher{}
func NewCompositeMatcher ¶
func NewCompositeMatcher(matchers []PathMatcher) PathMatcher
func NewGlobMatcher ¶ added in v0.1.0
func NewGlobMatcher(globs ...string) PathMatcher
type PathSet ¶ added in v0.7.11
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 ¶ added in v0.7.11
func NewPathSet(paths []string, baseDir string) PathSet
type PatternMatcher ¶
type PatternMatcher interface {
PathMatcher
// Express this PathMatcher as a sequence of filepath.Match
// patterns. These patterns are widely useful in Docker-land because
// they're suitable in .dockerignore or Dockerfile ADD statements
// https://docs.docker.com/engine/reference/builder/#add
AsMatchPatterns() []string
}
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 Run ¶ added in v0.7.11
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 (Run) WithTriggers ¶ added in v0.7.11
func (r Run) WithTriggers(paths []string, baseDir string) Run
type SailMode ¶ added in v0.8.4
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"
)
type SailNewRoomRequest ¶ added in v0.8.3
type SailNewRoomRequest struct {
WebVersion WebVersion `json:"web_version"`
}
type SailRoomInfo ¶ added in v0.8.1
type SailRoomInfo struct {
RoomID RoomID `json:"room_id"`
Secret string `json:"secret"`
}
type SailURL ¶ added in v0.8.0
type SailURL url.URL
func (SailURL) WithQueryParam ¶ added in v0.8.1
func (u SailURL) WithQueryParam(key, value string) SailURL
type TargetGraph ¶ added in v0.8.2
type TargetGraph struct {
// contains filtered or unexported fields
}
func NewTargetGraph ¶ added in v0.8.2
func NewTargetGraph(targets []TargetSpec) (TargetGraph, error)
func (TargetGraph) DeployedImages ¶ added in v0.8.2
func (g TargetGraph) DeployedImages() []ImageTarget
Returns all the images in the graph that are directly deployed to a container.
func (TargetGraph) DepsOf ¶ added in v0.8.2
func (g TargetGraph) DepsOf(t TargetSpec) ([]TargetSpec, error)
Return the direct dependency targets.
func (TargetGraph) IsDeployedImage ¶ added in v0.8.2
func (g TargetGraph) IsDeployedImage(iTarget ImageTarget) bool
Is this image directly deployed a container?
func (TargetGraph) IsSingleSourceDAG ¶ added in v0.8.2
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.
type TargetID ¶ added in v0.4.3
type TargetID struct {
Type TargetType
Name TargetName
}
func DedupeTargetIDs ¶ added in v0.7.11
func DedupeTargetIDs(ids []TargetID) []TargetID
De-duplicate target ids, maintaining the same order.
type TargetName ¶ added in v0.4.3
type TargetName string
type TargetSpec ¶ added in v0.5.0
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 ¶ added in v0.7.11
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 ¶ added in v0.4.3
type TargetStatus interface {
TargetID() TargetID
ActiveBuild() BuildRecord
LastBuild() BuildRecord
}
type TargetType ¶ added in v0.4.3
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 ¶ added in v0.8.2
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 ¶ added in v0.8.2
func (b TiltBuild) AnalyticsVersion() string
func (TiltBuild) WebVersion ¶ added in v0.8.3
func (b TiltBuild) WebVersion() WebVersion
type TriggerMode ¶ added in v0.4.1
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 ¶ added in v0.7.11
type WebDevPort int
type WebMode ¶ added in v0.7.11
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"
)
type WebVersion ¶ added in v0.7.11
type WebVersion string
Web version of the form vA.B.C, where A, B, and C are integers. Used for fetching web assets