Documentation
¶
Overview ¶
Package workdir provides functions to manage docker compose working directories inside the $HOME/.sourced/workdirs directory
Index ¶
- Variables
- func Active() (string, error)
- func ActivePath() (string, error)
- func InitWithOrgs(orgs []string, token string) (string, error)
- func InitWithPath(reposdir string) (string, error)
- func List() ([]string, error)
- func ListPaths() ([]string, error)
- func RemovePath(path string) error
- func SetActive(workdir string) error
- func SetActivePath(path string) error
- func UnsetActive() error
- func ValidatePath(dir string) error
Constants ¶
This section is empty.
Variables ¶
var ( // RequiredFiles list of required files in a directory to treat it as a working directory RequiredFiles = []string{".env", "docker-compose.yml"} // ErrMalformed is the returned error when the workdir is wrong ErrMalformed = goerrors.NewKind("workdir %s is not valid: %s") )
Functions ¶
func ActivePath ¶
ActivePath returns absolute path to active working directory
func InitWithOrgs ¶
InitWithOrgs initialize workdir with remote list of organizations
func InitWithPath ¶
Init creates a working directory in ~/.sourced for the given repositories directory. The working directory will contain a docker-compose.yml and a .env file. If the directory is already initialized the function returns with no error. The returned value is the absolute path to $HOME/.sourced/workdirs/reposdir
func RemovePath ¶
RemovePath removes working directory by removing required files and recursively removes directories up to the workdirs root as long as they are empty
func SetActive ¶
SetActive creates a symlink from the fixed active workdir path to the workdir for the given repos dir.
func SetActivePath ¶
SetActivePath similar to SetActive but accepts absolute path to a directory instead of a relative one
func ValidatePath ¶
ValidatePath validates that the passed dir is valid Must be a directory (or a symlink) containing docker-compose.yml and .env files
Types ¶
This section is empty.