Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Docker describes the docker dependency Docker = &Dependency{ Bin: "docker", } // Yamllint describes the yamllint dependency Yamllint = &Dependency{ Bin: "yamllint", } // Golint describes the golint dependency Golint = &Dependency{ Bin: "golint", GoInstall: []string{"golang.org/x/lint/golint@latest"}, } // Htmltest describes the htmltest dependency Htmltest = &Dependency{ Bin: "htmltest", GoInstall: []string{"github.com/wjdp/htmltest@latest"}, } // Hugo describes the hugo dependency Hugo = &Dependency{ Bin: "hugo", Env: map[string]string{"CGO_ENABLED": "1"}, GoInstall: []string{"-tags", "extended", "github.com/gohugoio/hugo@latest"}, } )
View Source
var ( // ExternalDependencies define the external app dependencies needed // to fullfill all automation tasks ExternalDependencies = []*Dependency{ Golint, } )
Functions ¶
func CheckDependencies ¶
func CheckDependencies(ctx context.Context, dependencies ...*Dependency) error
CheckDependencies determines if provided dependencies are available. If binary is not available os.ErrNotExist is returned
func InstallDependencies ¶
func InstallDependencies(ctx context.Context, dependencies ...*Dependency) (bool, error)
InstallDependencies makes sure to install provided dependencies and return if all installing all dependencies were successful
Types ¶
type Dependency ¶
type Dependency struct {
Bin string
// GoInstall holds the arguments passed to `go install` (build flags + package path).
// Example: []string{"-tags", "extended", "github.com/gohugoio/hugo@latest"}
GoInstall []string
// Env holds optional environment variables set when running go install.
// Example: map[string]string{"CGO_ENABLED": "1"}
Env map[string]string
}
Dependency encapsulates attributes of a depending application
type Installable ¶
type Installable interface {
Install() error
}
Installable describes something that can be installed
Click to show internal directories.
Click to hide internal directories.