generator

package
v1.1.1-0...-9418116 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ComponentsRepoPath = ".devspace/components"

ComponentsRepoPath is the path relative to the user folder where the components are stored

View Source
const ComponentsRepoURL = "https://github.com/devspace-cloud/components.git"

ComponentsRepoURL is the repository url

View Source
const DockerfileRepoPath = ".devspace/dockerfileRepo"

DockerfileRepoPath is the path relative to the user folder where the docker file repo is stored

View Source
const DockerfileRepoURL = "https://github.com/devspace-cloud/devspace-templates.git"

DockerfileRepoURL is the default repository url

Variables

View Source
var VarMatchRegex = regexp.MustCompile("^(.*)(\\$\\{[^\\}]+\\})(.*)$")

VarMatchRegex is the regex to check if a value matches the devspace var format

Functions

func ContainerizeApplication

func ContainerizeApplication(dockerfilePath, localPath string, templateRepoURL string, log log.Logger) error

ContainerizeApplication will create a dockerfile at the given path based on the language detected

func CustomResolveVars

func CustomResolveVars(yamlFileContent []byte, matchFn func(string, string, string) bool, replaceFn func(string, string) (interface{}, error)) ([]byte, error)

CustomResolveVars resolves variables with a custom replace function

Types

type ComponentSchema

type ComponentSchema struct {
	Name           string            `yaml:"name"`
	Description    string            `yaml:"description"`
	Variables      []latest.Variable `yaml:"variables"`
	VariableValues map[string]string
}

ComponentSchema is the component schema

type ComponentsGenerator

type ComponentsGenerator struct {
	LocalPath string
	// contains filtered or unexported fields
}

ComponentsGenerator holds the information to create a component

func NewComponentGenerator

func NewComponentGenerator() (*ComponentsGenerator, error)

NewComponentGenerator creates a new component generator for the given path

func (*ComponentsGenerator) GetComponent

func (cg *ComponentsGenerator) GetComponent(name string) (*ComponentSchema, error)

GetComponent retrieves a component

func (*ComponentsGenerator) GetComponentTemplate

func (cg *ComponentsGenerator) GetComponentTemplate(name string, log log.Logger) (*latest.ComponentConfig, error)

GetComponentTemplate retrieves a component templates

func (*ComponentsGenerator) ListComponents

func (cg *ComponentsGenerator) ListComponents() ([]*ComponentSchema, error)

ListComponents returns an array with all available components

type DockerfileGenerator

type DockerfileGenerator struct {
	Language  string
	LocalPath string
	// contains filtered or unexported fields
}

DockerfileGenerator is a type of object that generates a Helm Chart

func NewDockerfileGenerator

func NewDockerfileGenerator(localPath string, templateRepoURL *string) (*DockerfileGenerator, error)

NewDockerfileGenerator creates a new dockerfile generator

func (*DockerfileGenerator) CreateDockerfile

func (cg *DockerfileGenerator) CreateDockerfile(language string) error

CreateDockerfile creates a dockerfile for a given language

func (*DockerfileGenerator) GetLanguage

func (cg *DockerfileGenerator) GetLanguage() (string, error)

GetLanguage gets the language from DockerfileGenerator either from its field "Language" or by detecting it

func (*DockerfileGenerator) GetSupportedLanguages

func (cg *DockerfileGenerator) GetSupportedLanguages() ([]string, error)

GetSupportedLanguages returns all languages that are available in the local Template Rempository

func (*DockerfileGenerator) IsSupportedLanguage

func (cg *DockerfileGenerator) IsSupportedLanguage(language string) bool

IsSupportedLanguage returns true if the given language is supported by the DockerfileGenerator

Jump to

Keyboard shortcuts

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