build

package
v0.0.0-...-9a3f633 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBuilds = map[string]string{
	types.ProjectTypeBinary: "make build",
	types.ProjectTypeNode:   "npm run build",
	types.ProjectTypeNPM:    "npm run build",
	types.ProjectTypeGo:     "go build",
	types.ProjectTypeRust:   "cargo build",
	types.ProjectTypePython: "python3 -m build",
	types.ProjectTypeDocker: "",
	types.ProjectTypeCPP:    "make build",
	types.ProjectTypeStatic: "",
}
View Source
var DefaultImages = map[string]string{
	types.ProjectTypeBinary: "gcc:bullseye",
	types.ProjectTypeNode:   "node:buster",
	types.ProjectTypeNPM:    "node:buster",
	types.ProjectTypeGo:     "golang:buster",
	types.ProjectTypeRust:   "rust:buster",
	types.ProjectTypePython: "python:buster",
	types.ProjectTypeDocker: "scratch",
	types.ProjectTypeCPP:    "gcc:bullseye",
	types.ProjectTypeStatic: "",
}
View Source
var DefaultInstalls = map[string]string{
	types.ProjectTypeBinary: "make install",
	types.ProjectTypeNode:   "npm install",
	types.ProjectTypeNPM:    "npm install",
	types.ProjectTypeGo:     "go get ./...",
	types.ProjectTypeRust:   "cargo install",
	types.ProjectTypePython: "pip install -r requirements.txt",
	types.ProjectTypeDocker: "",
	types.ProjectTypeCPP:    "make install",
	types.ProjectTypeStatic: "",
}
View Source
var DefaultTemplates = map[string]string{
	types.ProjectTypeBinary: "default.tmpl",
	types.ProjectTypeNode:   "node.tmpl",
	types.ProjectTypeNPM:    "npm.tmpl",
	types.ProjectTypeGo:     "go.tmpl",
	types.ProjectTypeRust:   "rust.tmpl",
	types.ProjectTypePython: "python.tmpl",
	types.ProjectTypeDocker: "docker.tmpl",
	types.ProjectTypeCPP:    "cpp.tmpl",
	types.ProjectTypeStatic: "static.tmpl",
}

Functions

func ConfigTemplate

func ConfigTemplate(projectType string, path string) error

ConfigTemplate creates a config from a project template.

func ConfigWizard

func ConfigWizard() error

ConfigWizard runs an interactive configurator.

func Create

func Create(imageTag string, dockerFilePath string) error

func Export

func Export(image string, hostPath string, out string) error

func GenerateDockerfile

func GenerateDockerfile(dockerConfig DockerConfig) error

func Run

func Run(projectPath string, valistFile Config) ([]string, error)

Types

type Config

type Config struct {
	Type      string            `yaml:"type"`
	Org       string            `yaml:"org"`
	Repo      string            `yaml:"repo"`
	Tag       string            `yaml:"tag"`
	Meta      string            `yaml:"meta,omitempty"`
	Image     string            `yaml:"image,omitempty"`
	Build     string            `yaml:"build,omitempty"`
	Install   string            `yaml:"install,omitempty"`
	Out       string            `yaml:"out,omitempty"`
	Platforms map[string]string `yaml:"platforms,omitempty"`
}

Config contains valist build settings.

func (*Config) Load

func (c *Config) Load(path string) error

func (Config) Save

func (c Config) Save(path string) error

type DockerConfig

type DockerConfig struct {
	Path           string
	BaseImage      string
	Source         string
	BuildCommand   string
	InstallCommand string
}

Jump to

Keyboard shortcuts

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