Documentation ¶
Overview ¶
This package contains the global worker configuration and task configuration including the task payload.
This is the home for types which are exposed externally to the worker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{
PublicIP: "localhost",
LiveLogPort: 13000,
DindImage: "docker:dind",
TaskclusterProxyImage: "taskcluster/taskcluster-proxy:v41.0.0",
ConcurrentTasks: 1,
}
DefaultConfig is the recommended base configuration for the worker.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct { Name string `json:"name,omitempty"` Path string `json:"path,omitempty"` Type ArtifactType `json:"type,omitempty"` ContentType string `json:"contentType,omitempty"` }
Artifact is the information required to upload a single artifact.
type ArtifactType ¶
type ArtifactType string
ArtifactType is used to determine how to upload artifacts
const ( // FileArtifact uploads a single file verbatim FileArtifact ArtifactType = "file" )
type Config ¶
type Config struct { RootURL string `json:"rootURL"` ClientID string `json:"clientId"` AccessToken string `json:"accessToken"` Certificate string `json:"certificate,omitempty"` AuthorizedScopes []string `json:"authorizedScopes,omitempty"` ProvisionerID string `json:"provisionerId"` WorkerType string `json:"workerType"` WorkerGroup string `json:"workerGroup"` WorkerID string `json:"workerId"` PublicIP string `json:"publicIp,omitempty"` LiveLogPort int `json:"liveLogPort,omitempty"` LiveLogCertPath string `json:"liveLogCertPath,omitempty"` LiveLogKeyPath string `json:"liveLogCertPath,omitempty"` ShutdownOnIdleSeconds *int `json:"shutdownOnIdleSecs,omitempty"` DindImage string `json:"dindImage,omitempty"` TaskclusterProxyImage string `json:"taskclusterProxyImage,omitempty"` ConcurrentTasks int `json:"concurrentTasks,omitempty"` WSTAudience string `json:"wstAudience,omitempty"` WSTServerURL string `json:"wstServerURL,omitempty"` }
Config is the configuration which is used to run this worker.
func (*Config) Credentials ¶
func (c *Config) Credentials() *tcclient.Credentials
Credentials fetches the credentials from the configuration.
type EnvVar ¶
type EnvVar struct { Name string `json:"name"` Value string `json:"value,omitempty"` ValueFrom *ValueFrom `json:"valueFrom,omitempty"` }
EnvVar represents a single environment variable.
type Payload ¶
type Payload struct { MaxRunTime int `json:"maxRunTime,omitempty"` Steps []Step `json:"steps,omitempty"` // Environment shared between steps. Env []EnvVar `json:"env,omitempty"` Artifacts []Artifact `json:"artifacts,omitempty"` }
Payload contains the entire payload for a task.
type Step ¶
type Step struct { Image string `json:"image"` Command []string `json:"command,omitempty"` Args []string `json:"args,omitempty"` Env []EnvVar `json:"env,omitempty"` WorkingDir string `json:"workingDir,omitempty"` Pull *bool `json:"pull,omitempty"` Privileged bool `json:"privileged,omitempty"` }
Step is a single stage in the build process.
type ValueFrom ¶
type ValueFrom struct {
ValueFromSecret *ValueFromSecret `json:"secret,omitempty"`
}
ValueFrom is used to insert values from elsewhere.
type ValueFromSecret ¶
type ValueFromSecret struct { SecretName string `json:"secretName"` Path string `json:"path,omitempty"` }
ValueFromSecret is used to insert secret values.