dockerfilegenerator

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// GolangModFilePathType points to the go.mod file path
	GolangModFilePathType transformertypes.PathType = "GoModFilePath"
	// GolangVersionsMappingKind defines kind of GolangVersionMappingKind
	GolangVersionsMappingKind types.Kind = "GolangVersionsMapping"
)
View Source
const (

	//RequirementsTxtPathType points to the requirements.txt file if it's present
	RequirementsTxtPathType transformertypes.PathType = "RequirementsTxtPathType"
	// PythonServiceConfigType points to python config
	PythonServiceConfigType transformertypes.ConfigType = "PythonConfig"
	// MainPythonFilesPathType points to the .py files path which contain main function
	MainPythonFilesPathType transformertypes.PathType = "MainPythonFilesPathType"
	// PythonFilesPathType points to the .py files path
	PythonFilesPathType transformertypes.PathType = "PythonFilesPathType"
)
View Source
const (

	// NodeVersionsMappingKind defines kind of NodeVersionMappingKind
	NodeVersionsMappingKind types.Kind = "NodeVersionsMapping"
)

Variables

This section is empty.

Functions

func GetConfFileForService

func GetConfFileForService(confFiles []string, serviceName string) string

GetConfFileForService returns ports used by a service

Types

type CargoTomlConfig

type CargoTomlConfig struct {
	Package PackageInfo
}

CargoTomlConfig implements Cargo.toml config interface

type DotNetCoreDockerfileGenerator

type DotNetCoreDockerfileGenerator struct {
	Config           transformertypes.Transformer
	Env              *environment.Environment
	DotNetCoreConfig *DotNetCoreDockerfileYamlConfig
	Spec             NodeVersionsMappingSpec
	SortedVersions   []string
}

DotNetCoreDockerfileGenerator implements the Transformer interface

func (*DotNetCoreDockerfileGenerator) DirectoryDetect

func (t *DotNetCoreDockerfileGenerator) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in each sub directory

func (*DotNetCoreDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*DotNetCoreDockerfileGenerator) Init

Init Initializes the transformer

func (*DotNetCoreDockerfileGenerator) Transform

Transform transforms the artifacts

func (*DotNetCoreDockerfileGenerator) TransformArtifact added in v0.3.3

TransformArtifact transforms a single artifact

type DotNetCoreDockerfileYamlConfig

type DotNetCoreDockerfileYamlConfig struct {
	DefaultDotNetCoreVersion string `yaml:"defaultDotNetCoreVersion"`
	NodejsDockerfileYamlConfig
}

DotNetCoreDockerfileYamlConfig represents the configuration of the DotNetCore dockerfile

type DotNetCoreTemplateConfig

type DotNetCoreTemplateConfig struct {
	IncludeBuildStage     bool
	BuildStageImageTag    string
	BuildContainerName    string
	IsNodeJSProject       bool
	PublishProfilePath    string
	IncludeRunStage       bool
	RunStageImageTag      string
	Ports                 []int32
	EntryPointPath        string
	CopyFrom              string
	EnvVariables          map[string]string
	NodeVersion           string
	NodeVersionProperties map[string]string
	PackageManager        string
}

DotNetCoreTemplateConfig implements DotNetCore config interface

type GlobalParameters

type GlobalParameters struct {
	Address string
	Port    int32
}

GlobalParameters implements global properties in Rocket.toml

type GolangDockerfileGenerator

type GolangDockerfileGenerator struct {
	Config       transformertypes.Transformer
	Env          *environment.Environment
	GolangConfig *GolangDockerfileYamlConfig
	Spec         GolangVersionsMappingSpec
}

GolangDockerfileGenerator implements the Transformer interface

func (*GolangDockerfileGenerator) DirectoryDetect

func (t *GolangDockerfileGenerator) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*GolangDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*GolangDockerfileGenerator) Init

Init Initializes the transformer

func (*GolangDockerfileGenerator) Transform

Transform transforms the artifacts

type GolangDockerfileYamlConfig

type GolangDockerfileYamlConfig struct {
	DefaultGoVersion string `yaml:"defaultGoVersion"`
}

GolangDockerfileYamlConfig represents the configuration of the Golang dockerfile

type GolangTemplateConfig

type GolangTemplateConfig struct {
	Ports          []int32
	AppName        string
	GolangImageTag string
}

GolangTemplateConfig implements Golang config interface

type GolangVersionsMapping added in v0.3.6

type GolangVersionsMapping struct {
	types.TypeMeta   `yaml:",inline"`
	types.ObjectMeta `yaml:"metadata,omitempty"`
	Spec             GolangVersionsMappingSpec `yaml:"spec,omitempty"`
}

GolangVersionsMapping stores the Go versions mapping

type GolangVersionsMappingSpec added in v0.3.6

type GolangVersionsMappingSpec struct {
	DisableSort    bool                `yaml:"disableSort"`
	GolangVersions []map[string]string `yaml:"golangVersions"`
}

GolangVersionsMappingSpec stores the Go version spec

func LoadGolangVersionMappingsFile added in v0.3.6

func LoadGolangVersionMappingsFile(mappingFilePath string) (GolangVersionsMappingSpec, error)

LoadGolangVersionMappingsFile loads the Golang version mappings file

type LaunchProfile

type LaunchProfile struct {
	CommandName          string            `json:"CommandName"`
	LaunchBrowser        bool              `json:"launchBrowser"`
	ApplicationURL       string            `json:"applicationUrl"`
	EnvironmentVariables map[string]string `json:"environmentVariables"`
}

LaunchProfile implements launch profile properties

type LaunchSettings

type LaunchSettings struct {
	Profiles map[string]LaunchProfile `json:"profiles"`
}

LaunchSettings is to load the launchSettings.json properties

type NodeVersionsMapping added in v0.3.3

type NodeVersionsMapping struct {
	types.TypeMeta   `yaml:",inline"`
	types.ObjectMeta `yaml:"metadata,omitempty"`
	Spec             NodeVersionsMappingSpec `yaml:"spec,omitempty"`
}

NodeVersionsMapping stores the Node versions mapping

type NodeVersionsMappingSpec added in v0.3.3

type NodeVersionsMappingSpec struct {
	DisableSort  bool                `yaml:"disableSort"`
	NodeVersions []map[string]string `yaml:"nodeVersions"`
}

NodeVersionsMappingSpec stores the Node version spec

func LoadNodeVersionMappingsFile added in v0.3.3

func LoadNodeVersionMappingsFile(mappingFilePath string) (NodeVersionsMappingSpec, error)

LoadNodeVersionMappingsFile loads the node version mappings file

type NodejsDockerfileGenerator

type NodejsDockerfileGenerator struct {
	Config       transformertypes.Transformer
	Env          *environment.Environment
	NodejsConfig *NodejsDockerfileYamlConfig
	Spec         NodeVersionsMappingSpec
}

NodejsDockerfileGenerator implements the Transformer interface

func (*NodejsDockerfileGenerator) DirectoryDetect

func (t *NodejsDockerfileGenerator) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*NodejsDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*NodejsDockerfileGenerator) Init

Init Initializes the transformer

func (*NodejsDockerfileGenerator) Transform

Transform transforms the artifacts

type NodejsDockerfileYamlConfig

type NodejsDockerfileYamlConfig struct {
	DefaultNodejsVersion  string `yaml:"defaultNodejsVersion"`
	DefaultPackageManager string `yaml:"defaultPackageManager"`
}

NodejsDockerfileYamlConfig represents the configuration of the Nodejs dockerfile

type NodejsTemplateConfig

type NodejsTemplateConfig struct {
	Port                  int32
	Build                 bool
	NodeVersion           string
	NodeImageTag          string
	NodeMajorVersion      string
	NodeVersionProperties map[string]string
	PackageManager        string
}

NodejsTemplateConfig implements Nodejs config interface

type PHPDockerfileGenerator

type PHPDockerfileGenerator struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
}

PHPDockerfileGenerator implements the Transformer interface

func (*PHPDockerfileGenerator) DirectoryDetect

func (t *PHPDockerfileGenerator) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*PHPDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*PHPDockerfileGenerator) Init

Init Initializes the transformer

func (*PHPDockerfileGenerator) Transform

Transform transforms the artifacts

type PackageInfo

type PackageInfo struct {
	Name    string
	Version string
}

PackageInfo implements package properties

type PackageJSON

type PackageJSON struct {
	Private        bool              `json:"private"`
	Name           string            `json:"name"`
	Version        string            `json:"version"`
	Description    string            `json:"description"`
	Homepage       string            `json:"homepage"`
	License        string            `json:"license"`
	Main           string            `json:"main"`
	PackageManager string            `json:"packageManager,omitempty"`
	Keywords       []string          `json:"keywords,omitempty"`
	Files          []string          `json:"files,omitempty"`
	Os             []string          `json:"os,omitempty"`
	CPU            []string          `json:"cpu,omitempty"`
	Scripts        map[string]string `json:"scripts,omitempty"`
	Engines        map[string]string `json:"engines,omitempty"`
	Dependencies   map[string]string `json:"dependencies,omitempty"`
}

PackageJSON represents NodeJS package.json

type PhpTemplateConfig

type PhpTemplateConfig struct {
	ConfFile     string
	ConfFilePort int32
}

PhpTemplateConfig implements Php config interface

type PropertyGroup

type PropertyGroup struct {
	XMLName     xml.Name `xml:"PropertyGroup"`
	PublishUrl  string   `xml:"PublishUrl"`
	PublishUrlS string   `xml:"publishUrl"`
}

PropertyGroup has publish properties of the project

type PublishProfile

type PublishProfile struct {
	XMLName       xml.Name       `xml:"Project"`
	PropertyGroup *PropertyGroup `xml:"PropertyGroup"`
}

PublishProfile defines the publish profile

type PythonConfig

type PythonConfig struct {
	IsDjango bool `json:"IsDjango" yaml:"IsDjango"`
}

PythonConfig implements python config interface

type PythonDockerfileGenerator

type PythonDockerfileGenerator struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
}

PythonDockerfileGenerator implements the Transformer interface

func (*PythonDockerfileGenerator) DirectoryDetect

func (t *PythonDockerfileGenerator) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*PythonDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*PythonDockerfileGenerator) Init

Init Initializes the transformer

func (*PythonDockerfileGenerator) Transform

Transform transforms the artifacts

type PythonTemplateConfig

type PythonTemplateConfig struct {
	AppName               string
	Port                  int32
	StartingScriptRelPath string
	RequirementsTxt       string
	IsDjango              bool
}

PythonTemplateConfig implements python config interface

type RocketTomlConfig

type RocketTomlConfig struct {
	Global GlobalParameters
}

RocketTomlConfig implements Rocket.toml config interface

type RubyDockerfileGenerator

type RubyDockerfileGenerator struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
}

RubyDockerfileGenerator implements the Transformer interface

func (*RubyDockerfileGenerator) DirectoryDetect

func (t *RubyDockerfileGenerator) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*RubyDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*RubyDockerfileGenerator) Init

Init Initializes the transformer

func (*RubyDockerfileGenerator) Transform

Transform transforms the artifacts

type RubyTemplateConfig

type RubyTemplateConfig struct {
	Port    int32
	AppName string
}

RubyTemplateConfig implements Ruby config interface

type RustDockerfileGenerator

type RustDockerfileGenerator struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
}

RustDockerfileGenerator implements the Transformer interface

func (*RustDockerfileGenerator) DirectoryDetect

func (t *RustDockerfileGenerator) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*RustDockerfileGenerator) GetConfig

GetConfig returns the transformer config

func (*RustDockerfileGenerator) Init

Init Initializes the transformer

func (*RustDockerfileGenerator) Transform

Transform transforms the artifacts

type RustTemplateConfig

type RustTemplateConfig struct {
	Port          int32
	AppName       string
	RocketToml    string
	RocketAddress string
}

RustTemplateConfig implements Nodejs config interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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