fabricate

package module
v0.0.0-...-f5c6216 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

README

Fabricate

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayContains

func ArrayContains(a []string, str string) bool

func GetPackageManager

func GetPackageManager(ctx *context.Context, containerId string, cli *client.Client) (string, error)

func GetPackageManagerDefaultPackages

func GetPackageManagerDefaultPackages(pm string) []string

func GetPackageManagerInstallCommand

func GetPackageManagerInstallCommand(pm string, packages []string) ([]string, error)

func GetPackageManagerUpdateCommand

func GetPackageManagerUpdateCommand(pm string) ([]string, error)

func GetPackageManagerUpgradeCommand

func GetPackageManagerUpgradeCommand(pm string) ([]string, error)

func GetRandomString

func GetRandomString(n int) string

func IsFileExists

func IsFileExists(filename string) bool

func RemoveFromArray

func RemoveFromArray(a, b []string) []string

Types

type Args

type Args struct {
	Env                   StringArray
	Config                string
	Version               bool
	IgnoreDefaultPackages bool
	IgnoreSystemUpdate    bool
	IgnoreSystemUpgrade   bool
	NoCachedImage         bool
	KeepRunning           bool
}

type Artifacts

type Artifacts struct {
	OutputDirectory string `yaml:"output-directory"`
	Files           []File `yaml:"files"`
}

type BuildStep

type BuildStep struct {
	Name string `yaml:"name"`
	//Timeout    int    `yaml:"timeout"`
	//Retries    int    `yaml:"retries"`
	//RetryDelay int    `yaml:"retry-delay"`
	Source string `yaml:"source"`
}

type Container

type Container struct {
	Project                  Project
	Env                      map[string]string
	AllowConcurrentExecution bool
	Executors                []Executor
	Extensions               []Extension

	SshPort int
	// contains filtered or unexported fields
}

func (*Container) Create

func (c *Container) Create(args Args) error

func (*Container) Exec

func (c *Container) Exec() error

func (*Container) GetElapsedTimef

func (c *Container) GetElapsedTimef() string

func (*Container) GetId

func (c *Container) GetId() string

func (*Container) Setup

func (c *Container) Setup(args Args) error

func (*Container) Shutdown

func (c *Container) Shutdown() error

func (*Container) StartSshServer

func (c *Container) StartSshServer(password string) error

type Executor

type Executor struct {
	Name    string  `yaml:"name"`
	Cpus    float32 `yaml:"cpus"`
	Memory  string  `yaml:"memory"`
	Host    string  `yaml:"host"`
	CaCert  string  `yaml:"ca-cert"`
	TlsCert string  `yaml:"tls-cert"`
	TlsKey  string  `yaml:"tls-key"`
}

type Extension

type Extension struct {
	Packages []string          `yaml:"packages"`
	Env      map[string]string `yaml:"env"`
	Source   string            `yaml:"source"`
}

type Fabricate

type Fabricate struct {
	Version                  string            `yaml:"version"`
	Projects                 []Project         `yaml:"projects"`
	Executors                []Executor        `yaml:"executors"`
	Env                      map[string]string `yaml:"env"`
	AllowConcurrentExecution bool              `yaml:"allow-concurrent-execution"`
	Hooks                    []Hook            `yaml:"hooks"`
}

type File

type File struct {
	Source          string `yaml:"source"`
	TargetDirectory string `yaml:"target-directory"`
}

type Hook

type Hook struct {
	When string `yaml:"when"`
	Url  string `yaml:"url"`
}

type Mount

type Mount struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
}

type PrefixedWriter

type PrefixedWriter struct {
	// contains filtered or unexported fields
}

func (*PrefixedWriter) Write

func (p *PrefixedWriter) Write(data []byte) (int, error)

type Project

type Project struct {
	Name  string `yaml:"name"`
	Image string `yaml:"image"`
	//Executor     string                `yaml:"executor"`
	Packages     []string          `yaml:"packages"`
	Repositories []Repository      `yaml:"repositories"`
	Extensions   []string          `yaml:"extensions"`
	Env          map[string]string `yaml:"env"`
	Secrets      []string          `yaml:"secrets"`
	Pipeline     []BuildStep       `yaml:"pipeline"`
	Artifacts    Artifacts         `yaml:"artifacts"`
	Mounts       []Mount           `yaml:"mounts"`
}

type Repository

type Repository struct {
	Uri string `yaml:"uri"`
	Ref string `yaml:"ref"`
	Vcs string `yaml:"vcs"`
}

type Secret

type Secret struct {
	Source string `yaml:"source"`
	Path   string `yaml:"path"`
}

type StringArray

type StringArray []string

func (*StringArray) Set

func (s *StringArray) Set(v string) error

func (*StringArray) String

func (s *StringArray) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳