configure

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigFileName is the main config json file name.
	DefaultConfigFileName = "config.json"
	// DefaultPath this is the default path to store gocd configurations
	DefaultPath = "/.contxt/"
	// DefaultWorkspace this is the main configuration workspace
	DefaultWorkspace = "default"
	// MirrorPath path for local mirror
	MirrorPath = "mirror/"
)

Variables

This section is empty.

Functions

func AddPath

func AddPath(path string)

AddPath adding a path if they not already exists

func ChangeWorkspace

func ChangeWorkspace(workspace string)

ChangeWorkspace changing workspace

func ClearPaths

func ClearPaths()

ClearPaths removes all paths from current Workspace

func DisplayWorkSpaces

func DisplayWorkSpaces()

DisplayWorkSpaces prints out all workspaces

func GetBuild

func GetBuild() string

GetBuild returns Build time as build NO

func GetVersion

func GetVersion() string

GetVersion deleivers the current build version

func InitConfig

func InitConfig() error

InitConfig initilize the configuration files

func ListWorkSpaces

func ListWorkSpaces() []string

ListWorkSpaces : list all existing workspaces

func PathWorker

func PathWorker(callback func(int, string))

PathWorker executes a callback function in a path

func RemoveWorkspace

func RemoveWorkspace(name string)

RemoveWorkspace removes a workspace

func SaveConfiguration

func SaveConfiguration(config Configuration, path string)

SaveConfiguration : stores configuration in given path

func SaveDefaultConfiguration

func SaveDefaultConfiguration(workSpaceConfigUpdate bool)

SaveDefaultConfiguration stores the current configuration as default

func ShowPaths

func ShowPaths(current string) int

ShowPaths : display all stored paths in the workspace

func WorkSpaces

func WorkSpaces(callback func(string))

WorkSpaces handler to iterate all workspaces

Types

type Action

type Action struct {
	Target  string   `yaml:"target"`
	Stopall bool     `yaml:"stopall"`
	Script  []string `yaml:"script"`
}

Action defines a action that can be executed

type CommandLine

type CommandLine struct {
	Require            RequireCheck
	Command            string
	Params             string
	Comment            string
	StopOnError        bool
	StopOnOutCountLess int
	StopOnOutCountMore int
	StopOnOutContains  string
	TraceOutput        bool
}

CommandLine defines a line of commands that can be executed

type Configuration

type Configuration struct {
	CurrentSet string
	Paths      []string
}

Configuration includes all paths for the current workspace

var Config Configuration

Config is the the current used configuration

type ExecuteDefinition

type ExecuteDefinition struct {
	TestScript  []CommandLine
	InitScript  []CommandLine
	CleanScript []CommandLine
	Script      []CommandLine
}

ExecuteDefinition Defines the structure of a .execute file that defines commands they have to executed

type IncludePaths

type IncludePaths struct {
	Include struct {
		Basedir bool     `yaml:"basedir"`
		Folders []string `yaml:"folders"`
	} `yaml:"include"`
}

IncludePaths are files the defines how variables should be parsed. they indludes folders they have to be parsed first so they contents can be sued to proceeed with test/template. otherwise the yaml file is not readable

type RequireCheck

type RequireCheck struct {
	FileExists    []string
	FileNotExists []string
}

RequireCheck defines some variables they have to be valid before script runs

type RunConfig

type RunConfig struct {
	Config struct {
		Sequencially bool              `yaml:"sequencially"`
		Coloroff     bool              `yaml:"coloroff"`
		Variables    map[string]string `yaml:"variables,omitempty"`
		Imports      []string          `yAML:"imports"`
	} `yaml:"config"`
	Task []struct {
		ID          string            `yaml:"id"`
		Variables   map[string]string `yaml:"variables,omitempty"`
		Stopreasons struct {
			Onerror        bool     `yaml:"onerror"`
			OnoutcountLess int      `yaml:"onoutcountLess"`
			OnoutcountMore int      `yaml:"onoutcountMore"`
			OnoutContains  []string `yaml:"onoutContains"`
		} `yaml:"stopreasons"`
		Options struct {
			Format      string   `yaml:"format"`
			Stickcursor bool     `yaml:"stickcursor"`
			Colorcode   string   `yaml:"colorcode"`
			Bgcolorcode string   `yaml:"bgcolorcode"`
			Panelsize   int      `yaml:"panelsize"`
			Displaycmd  bool     `yaml:"displaycmd"`
			Hideout     bool     `yaml:"hideout"`
			Maincmd     string   `yaml:"maincmd"`
			Mainparams  []string `yaml:"mainparams"`
		} `yaml:"options"`
		Script   []string `yaml:"script"`
		Listener []struct {
			Trigger struct {
				Onerror        bool     `yaml:"onerror"`
				OnoutcountLess int      `yaml:"onoutcountLess"`
				OnoutcountMore int      `yaml:"onoutcountMore"`
				OnoutContains  []string `yaml:"onoutContains"`
			} `yaml:"trigger"`
			Action struct {
				Target  string   `yaml:"target"`
				Stopall bool     `yaml:"stopall"`
				Script  []string `yaml:"script"`
			} `yaml:"action"`
		} `yaml:"listener"`
	} `yaml:"task"`
}

RunConfig defines the structure of the local stored execution files

type StopReasons

type StopReasons struct {
	Onerror        bool
	OnoutcountLess int
	OnoutcountMore int
	OnoutContains  []string
}

StopReasons mapping for RunConfig.Task[].Stopreasons

Jump to

Keyboard shortcuts

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