dockerconfiggenerator

package
v0.0.0-...-e4664ba Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTar

func ExtractTar(tarFilePath string, destFolder string) error

Extract tar file to a folder.

func ParseBuildArgsFromDockerfile

func ParseBuildArgsFromDockerfile(dockerfile string) map[string]Variable

Parses build arguments from dockerfile. Accepts a dockerfile as a string and returns a map of build arguments.

Types

type Config

type Config struct {
	ServiceOrder []string                `yaml:"service_order"`
	LookupFiles  []string                `yaml:"lookup_files"`
	Services     map[string]Service      `yaml:"services"`
	Templates    map[string]Template     `yaml:"templates"`
	Identifiers  map[string][]Identifier `yaml:"identifiers"`
}

type DockerFileConfig

type DockerFileConfig struct {
	DetectedService string              `json:"detected_service"`
	DockerFile      string              `json:"docker_file"`
	Variables       map[string]Variable `json:"variables"`
}

DockerFile Config

type Identifier

type Identifier struct {
	Selectors  []IdentifierSelector `yaml:"selectors"`
	Extensions []string             `yaml:"extensions"`
}

type IdentifierSelector

type IdentifierSelector struct {
	File     string   `yaml:"file"`
	Keywords []string `yaml:"keywords"`
}

type Manager

type Manager struct {
	Config          Config            `yaml:"config"`
	DockerTemplates map[string]string `yaml:"docker_files"`
}

func (Manager) AvailableDockerConfigs

func (m Manager) AvailableDockerConfigs() []string

AvailableDockerConfigs returns available docker configs.

func (Manager) DefaultArgsFromService

func (m Manager) DefaultArgsFromService(serviceName string) map[string]string

DefaultArgs returns default arguments for a service.

func (Manager) DockerConfigFromServiceName

func (m Manager) DockerConfigFromServiceName(serviceName string) (DockerFileConfig, error)

DockerConfigFromServiceName returns docker config for a service.

func (Manager) GenerateConfigFromCustomDocker

func (m Manager) GenerateConfigFromCustomDocker(dockerfile string) (DockerFileConfig, error)

Generate DockerConfig from custom dockerfile. If GenerateConfigFromGitRepository fails to detect service, this function will be used.

func (Manager) GenerateConfigFromGitRepository

func (m Manager) GenerateConfigFromGitRepository(git_url string, branch string, codePath string, username string, password string, privateKey string) (DockerFileConfig, error)

Generate DockerConfig from git repository.

func (Manager) GenerateConfigFromSourceCodeTar

func (m Manager) GenerateConfigFromSourceCodeTar(tarFile string) (DockerFileConfig, error)

Generate DockerConfig from source code .tar file.

func (*Manager) Init

func (m *Manager) Init() error

Initialize the docker config generator manager

type Service

type Service struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
}

type Template

type Template struct {
	Name      string              `yaml:"name"`
	Variables map[string]Variable `yaml:"variables"`
}

type Variable

type Variable struct {
	Type        string `yaml:"type" json:"type"`
	Description string `yaml:"description" json:"description"`
	Default     string `yaml:"default" json:"default"`
}

Jump to

Keyboard shortcuts

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