atlasfile

package
v0.0.1-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ContainerRestartsAlways        = "always"
	ContainerRestartsOnFailure     = "on-failure"
	ContainerRestartsUnlessStopped = "unless-stopped"
	ContainerRestartsNo            = "no"
)
View Source
const JumpUpLimit = 5

Variables

This section is empty.

Functions

func BuildImageName

func BuildImageName(artifact *ArtifactConfig) string

func FindAtlasDirectories

func FindAtlasDirectories(dir string) ([]string, error)

func FindRootDir

func FindRootDir(cwd string) (string, error)

Types

type ArtifactConfig

type ArtifactConfig struct {
	Name string `json:"name"`

	Build     BuildOptions      `json:"build"`
	DependsOn ArtifactDependsOn `json:"depends_on"`
	// contains filtered or unexported fields
}

func (*ArtifactConfig) GetDirpath

func (ac *ArtifactConfig) GetDirpath() string

GetDirpath returns path of .atlas directory artifact was declared in

type ArtifactDependsOn

type ArtifactDependsOn struct {
	Services  []string `json:"services"`
	Artifacts []string `json:"artifacts"`
}

type ArtifactRef

type ArtifactRef struct {
	Name     string          `json:"name"`
	Artifact *ArtifactConfig `json:"artifact"`
}

type Atlasfile

type Atlasfile struct {
	Artifacts []ArtifactConfig `json:"artifacts"`
	Services  []ServiceConfig  `json:"services"`
	Stacks    []StackConfig    `json:"stacks"`
	// contains filtered or unexported fields
}

func Collect

func Collect(ctx context.Context, logger logrus.FieldLogger, version, cwd string) (*Atlasfile, error)

func (*Atlasfile) GetArtifact

func (a *Atlasfile) GetArtifact(name string) *ArtifactConfig

func (*Atlasfile) GetService

func (a *Atlasfile) GetService(name string) *ServiceConfig

func (*Atlasfile) GetServiceImage

func (a *Atlasfile) GetServiceImage(service *ServiceConfig) (string, error)

func (*Atlasfile) GetStack

func (a *Atlasfile) GetStack(name string) *StackConfig

func (*Atlasfile) GetStacks

func (a *Atlasfile) GetStacks(stackNames []string) ([]StackConfig, error)

func (*Atlasfile) String

func (a *Atlasfile) String() string

type BuildOptions

type BuildOptions struct {
	Dockerfile string            `json:"dockerfile"`
	Context    string            `json:"context"`
	BuildArgs  map[string]string `json:"build_args"`
	Target     string            `json:"target"`

	ImageName string `json:"imageName"`
	TagName   string `json:"tagName"`
}

type ContainerRestarts

type ContainerRestarts string

type PortExpose

type PortExpose struct {
	HostPort      int
	ContainerPort int
}

type PortRequest

type PortRequest struct {
	ContainerPort int    `json:"containerPort"`
	Protocol      string `json:"protocol"`
}

func GetServicePort

func GetServicePort(requests []PortRequest, port int) *PortRequest

type ServiceConfig

type ServiceConfig struct {
	Name string `json:"name"`

	Artifact *ArtifactRef `json:"artifact"`
	Image    string       `json:"image"`

	Entrypoint []string `json:"entrypoint"`
	Command    []string `json:"command"`

	Ports []PortRequest `json:"port_requests"`

	Environment      map[string]string `json:"environment"`
	EnvironmentFiles []string          `json:"environment_files"`

	Volumes []VolumeConfig `json:"volumes"`

	Restart ContainerRestarts `json:"restart"`

	Interactive bool `json:"interactive"`
	TTY         bool `json:"tty"`
	// contains filtered or unexported fields
}

func (*ServiceConfig) GetDirpath

func (s *ServiceConfig) GetDirpath() string

GetDirpath returns path of .atlas directory service was declared in

type StackConfig

type StackConfig struct {
	Name     string         `json:"name"`
	Services []StackService `json:"services"`
	// contains filtered or unexported fields
}

func (*StackConfig) GetContainerName

func (s *StackConfig) GetContainerName(service string) string

func (*StackConfig) GetService

func (s *StackConfig) GetService(serviceName string) *StackService

func (*StackConfig) SetContainerName

func (s *StackConfig) SetContainerName(service, containerName string)

type StackService

type StackService struct {
	Name        string `json:"name"`
	ServiceName string `json:"serviceName"`

	// Environment overwrites environment variables specified in ServiceConfig.Environment and ServiceConfig.EnvironmentFiles
	Environment map[string]string `json:"environment"`

	JoinStackNetworks []string     `json:"joinStackNetworks"`
	ExposePorts       []PortExpose `json:"exposePorts"`

	// LocalEnvironment specifies variables that overwrite Environment, ServiceConfig.Environment and ServiceConfig.EnvironmentFiles
	// when running atlas env (usually URLs that should be rewritten to localhost when running a service outside of Docker)
	LocalEnvironment map[string]string `json:"localEnvironment"`
}

type VolumeConfig

type VolumeConfig struct {
	IsVolume             bool   `json:"isVolume"`
	HostPathOrVolumeName string `json:"hostPath"`
	ContainerPath        string `json:"containerPath"`
}

func (*VolumeConfig) GetVolumeNameOrHostPath

func (c *VolumeConfig) GetVolumeNameOrHostPath(cwd string, physicalVolName string) string

Jump to

Keyboard shortcuts

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