config

package
v0.0.0-...-294dc8c Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigHelp contains the short help text for the command.
	ConfigHelp = "(Re)creates the container configuration YAML file for using Docker Compose or Docker Swarm"

	// ConfigHelpExtra contains the long help text for the command without the headline.
	ConfigHelpExtra = `This command (re)creates the container configuration YAML file in the given directory.`

	// ConfigCreateDefaultHelp contains the short help text for the command.
	ConfigCreateDefaultHelp = "(Re)creates the default setup configuration YAML file"

	// ConfigCreateDefaultHelpExtra contains the long help text for the command without the headline.
	ConfigCreateDefaultHelpExtra = `This command (re)creates the default setup configuration YAML file in the given directory.`
)

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the subcommand.

func CmdCreateDefault

func CmdCreateDefault() *cobra.Command

CmdCreateDefault returns the config-create-default subcommand.

func Config

func Config(dir string, tplFile []byte, configFiles [][]byte) error

Config rebuilds the YAML file for using Docker Compose or Docker Swarm.

A custom template for the YAML file and YAML configs can be provided.

func CreateYmlFile

func CreateYmlFile(dir string, force bool, tplFile []byte, cfg *YmlConfig) error

CreateYmlFile builds the YAML file at the given directory. Use a truthy value for force to override an existing file.

func FlagConfig

func FlagConfig(cmd *cobra.Command) *[]string

FlagConfig setups the config flag to the given cobra command.

func FlagTpl

func FlagTpl(cmd *cobra.Command) *string

FlagTpl setups the template flag to the given cobra command.

Types

type YmlConfig

type YmlConfig struct {
	Filename string `yaml:"filename"`

	Host string `yaml:"host"`
	Port string `yaml:"port"`

	DisablePostgres  *bool `yaml:"disablePostgres"`
	DisableDependsOn *bool `yaml:"disableDependsOn"`
	EnableLocalHTTPS *bool `yaml:"enableLocalHTTPS"`
	EnableAutoHTTPS  *bool `yaml:"enableAutoHTTPS"`

	Defaults struct {
		ContainerRegistry string `yaml:"containerRegistry"`
		Tag               string `yaml:"tag"`
	} `yaml:"defaults"`

	DefaultEnvironment map[string]string `yaml:"defaultEnvironment"`

	Services map[string]service `yaml:"services"`
}

YmlConfig contains the (merged) configuration for the creation of the Docker Compose YAML file.

func NewYmlConfig

func NewYmlConfig(configFiles [][]byte) (*YmlConfig, error)

NewYmlConfig creates a ymlConfig object from all given files. The files were merged together with the default config.

Jump to

Keyboard shortcuts

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