Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTmpDir() error
- func DisplayDockerLog(in io.Reader) (string, error)
- func ParseCommandLine(line string) ([]string, error)
- func ReadEnvVariableIfHas(str string) string
- func RemoveAfterDone(cli *client.Client, id string)
- func SetCurrentStep(stepId string) error
- func SetOutput(key, value string) error
- func StreamDockerLog(in io.Reader, f StreamHandler)
- func SumContentMD5(file string) (string, error)
- func UpdateEnvFromFile(envFile string) ([]string, error)
- func VerifyDockerHostConnection(ctx context.Context, dockerHosts []string) (string, error)
- type ArgsConfig
- type DockerClient
- func (c *DockerClient) BuildImageWithOpts(ctx context.Context, tarFile string, opt types.ImageBuildOptions) (types.ImageBuildResponse, error)
- func (c *DockerClient) Close()
- func (c *DockerClient) DeployImage(ctx context.Context, username, password, image string) (io.ReadCloser, error)
- func (c *DockerClient) ImageExist(ctx context.Context, imageRef string) (bool, []string, error)
- func (c *DockerClient) PullImage(ctx context.Context, registry RegistryConfig, reference string) (io.ReadCloser, error)
- func (c *DockerClient) RemoveImage(ctx context.Context, imageId string) ([]types.ImageDeleteResponseItem, error)
- func (c *DockerClient) TagImage(ctx context.Context, src, dest string) error
- type DockerConfig
- type JobConfig
- type OnConfig
- type OutputVal
- type ProjectConfig
- type RegistryConfig
- type ScheduleConfig
- type StepConfig
- type StreamHandler
- type StringList
Constants ¶
View Source
const ( PARSER_CMD_BEGIN cmdParserState = iota PARSER_SPACE PARSER_FLAG_KEY PARSER_FLAG_VALUE PARSER_ARGS PARSER_ERROR )
View Source
const ( RepeatedEveryDay = "every-day" RepeatedEveryHour = "every-hour" )
Variables ¶
View Source
var ( DefaultDockerUnixSock = "unix:///var/run/docker.sock" DefaultDockerTCPSock = "tcp://127.0.0.1:2375" DefaultDockerHubRegistry = RegistryConfig{} DockerCleanImage = "alpine:3.12.2" )
View Source
var PluginInsideContainer = filepath.Join("/etc", "vulcan", "plugins")
View Source
var ToolChainInsideContainer = filepath.Join("/etc", "vulcan", "toolchains")
Functions ¶
func CreateTmpDir ¶
func CreateTmpDir() error
func ParseCommandLine ¶
func ReadEnvVariableIfHas ¶
func RemoveAfterDone ¶
func SetCurrentStep ¶
func StreamDockerLog ¶
func StreamDockerLog(in io.Reader, f StreamHandler)
func SumContentMD5 ¶
func UpdateEnvFromFile ¶
Types ¶
type ArgsConfig ¶
func (ArgsConfig) ReplaceEnv ¶
func (a ArgsConfig) ReplaceEnv() error
type DockerClient ¶
type DockerClient struct { Client *client.Client DockerConfig }
func ConnectDockerHost ¶
func ConnectDockerHost(ctx context.Context, hosts []string) (dockerCli DockerClient, err error)
func (*DockerClient) BuildImageWithOpts ¶
func (c *DockerClient) BuildImageWithOpts(ctx context.Context, tarFile string, opt types.ImageBuildOptions) (types.ImageBuildResponse, error)
func (*DockerClient) Close ¶
func (c *DockerClient) Close()
func (*DockerClient) DeployImage ¶
func (c *DockerClient) DeployImage(ctx context.Context, username, password, image string) (io.ReadCloser, error)
func (*DockerClient) ImageExist ¶
func (*DockerClient) PullImage ¶
func (c *DockerClient) PullImage(ctx context.Context, registry RegistryConfig, reference string) (io.ReadCloser, error)
func (*DockerClient) RemoveImage ¶
func (c *DockerClient) RemoveImage(ctx context.Context, imageId string) ([]types.ImageDeleteResponseItem, error)
type DockerConfig ¶
type DockerConfig struct { Hosts []string `yaml:"hosts,omitempty"` Registries []RegistryConfig `yaml:"registries,omitempty"` }
Docker config
type JobConfig ¶
type JobConfig struct { Id string `yaml:"-"` Name string `yaml:"name,omitempty"` RunOn string `yaml:"run-on,omitempty"` BaseDir string `yaml:"base-dir,omitempty"` OS string `yaml:"os,omitempty"` Arch string `yaml:"arch,omitempty"` Artifacts []string `yaml:"artifacts,omitempty"` Hosts []string `yaml:"hosts,omitempty"` Args *ArgsConfig `yaml:"args,omitempty"` Steps []StepConfig `yaml:"steps,omitempty"` }
type OnConfig ¶
type OnConfig struct { Branch []string `yaml:"branch,omitempty"` Event []string `yaml:"event,omitempty"` *ScheduleConfig `yaml:"schedule,omitempty"` }
type OutputVal ¶
func GetAllOutputs ¶
type ProjectConfig ¶
type ProjectConfig struct { Name string `yaml:"name,omitempty"` *OnConfig `yaml:"on,omitempty"` Jobs map[string]*JobConfig `yaml:"jobs,omitempty"` }
func ReadProjectConfig ¶
func ReadProjectConfig(configFile string) (c ProjectConfig, err error)
type RegistryConfig ¶
type ScheduleConfig ¶
type StepConfig ¶
type StepConfig struct { Id string `yaml:"id,omitempty"` Name string `yaml:"name,omitempty"` Run string `yaml:"run,omitempty"` Use string `yaml:"use,omitempty"` Args *ArgsConfig `yaml:"args,omitempty"` With *ArgsConfig `yaml:"with,omitempty"` }
type StreamHandler ¶
type StreamHandler func(s string)
type StringList ¶
type StringList []string
func (*StringList) Set ¶
func (s *StringList) Set(value string) error
Click to show internal directories.
Click to hide internal directories.