Documentation
¶
Overview ¶
Package dockercompose provides Docker Compose CLI operations for XenForo.
Index ¶
- Variables
- func CheckDockerComposeAvailable(ctx context.Context) error
- func CheckDockerRunning(ctx context.Context) error
- type Runner
- func (r *Runner) Build(ctx context.Context, pull bool, services ...string) error
- func (r *Runner) Compose(ctx context.Context, args ...string) error
- func (r *Runner) Composer(ctx context.Context, args ...string) error
- func (r *Runner) Contexts() []string
- func (r *Runner) Down(ctx context.Context) error
- func (r *Runner) Exec(ctx context.Context, service string, cmd ...string) error
- func (r *Runner) ExecOrRun(ctx context.Context, service string, rm bool, cmd ...string) error
- func (r *Runner) ExecOrRunWithEnv(ctx context.Context, service string, rm bool, env map[string]string, ...) error
- func (r *Runner) ExecOrRunWithEnvAndOutput(ctx context.Context, service string, rm bool, env map[string]string, ...) error
- func (r *Runner) ExecOrRunWithOutput(ctx context.Context, service string, rm bool, stdout, stderr io.Writer, ...) error
- func (r *Runner) ExecWithEnv(ctx context.Context, service string, env map[string]string, cmd ...string) error
- func (r *Runner) GetURL(ctx context.Context) (string, error)
- func (r *Runner) Instance() string
- func (r *Runner) IsEnvironmentInitialized() bool
- func (r *Runner) Logs(ctx context.Context, follow bool, services ...string) error
- func (r *Runner) PHP(ctx context.Context, args ...string) error
- func (r *Runner) PHPDebug(ctx context.Context, args ...string) error
- func (r *Runner) PS(ctx context.Context) error
- func (r *Runner) Pull(ctx context.Context, services ...string) error
- func (r *Runner) Restart(ctx context.Context, services ...string) error
- func (r *Runner) Run(ctx context.Context, service string, rm bool, cmd ...string) error
- func (r *Runner) RunCapture(ctx context.Context, args ...string) (string, string, error)
- func (r *Runner) RunWithEnv(ctx context.Context, service string, rm bool, env map[string]string, ...) error
- func (r *Runner) RunWithEnvAndOutput(ctx context.Context, service string, rm bool, env map[string]string, ...) error
- func (r *Runner) RunWithOutput(ctx context.Context, service string, rm bool, stdout, stderr io.Writer, ...) error
- func (r *Runner) Up(ctx context.Context, detach bool) error
- func (r *Runner) UpWithOutput(ctx context.Context, detach bool, stdout, stderr io.Writer) error
- func (r *Runner) WaitForDatabase(ctx context.Context, checkInterval time.Duration) error
- func (r *Runner) WaitForReady(ctx context.Context, checkInterval time.Duration) error
- func (r *Runner) XFCommand(ctx context.Context, args ...string) error
- func (r *Runner) XFCommandDebug(ctx context.Context, args ...string) error
- func (r *Runner) XFCommandWithOutput(ctx context.Context, stdout, stderr io.Writer, args ...string) error
- func (r *Runner) XFDir() string
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnexpectedOutput indicates that an operation produced unexpected output. ErrUnexpectedOutput = errors.New("unexpected output") // ErrTimeout indicates an operation timed out. ErrTimeout = errors.New("operation timed out") // ErrEnvNotInitialized indicates the Docker environment is not initialized. ErrEnvNotInitialized = errors.New("environment not initialized") )
Functions ¶
func CheckDockerComposeAvailable ¶
CheckDockerComposeAvailable checks if Docker Compose is available.
func CheckDockerRunning ¶
CheckDockerRunning checks if Docker is running.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner handles Docker Compose operations for a XenForo installation.
func (*Runner) ExecOrRun ¶
ExecOrRun uses exec for running services and falls back to run for stopped services.
func (*Runner) ExecOrRunWithEnv ¶
func (r *Runner) ExecOrRunWithEnv(ctx context.Context, service string, rm bool, env map[string]string, cmd ...string) error
ExecOrRunWithEnv uses exec for running services and falls back to run for stopped services.
func (*Runner) ExecOrRunWithEnvAndOutput ¶
func (r *Runner) ExecOrRunWithEnvAndOutput(ctx context.Context, service string, rm bool, env map[string]string, stdout, stderr io.Writer, cmd ...string) error
ExecOrRunWithEnvAndOutput runs a docker-compose exec or run command with output.
func (*Runner) ExecOrRunWithOutput ¶
func (r *Runner) ExecOrRunWithOutput(ctx context.Context, service string, rm bool, stdout, stderr io.Writer, cmd ...string) error
ExecOrRunWithOutput uses exec for running services and falls back to run for stopped services.
func (*Runner) ExecWithEnv ¶
func (r *Runner) ExecWithEnv(ctx context.Context, service string, env map[string]string, cmd ...string) error
ExecWithEnv runs a command in a running container with additional environment variables.
func (*Runner) GetURL ¶
GetURL returns the URL for accessing the XenForo site. It detects OrbStack vs standard Docker.
func (*Runner) IsEnvironmentInitialized ¶
IsEnvironmentInitialized checks if the Docker environment is set up.
func (*Runner) RunCapture ¶
RunCapture runs a docker compose command and captures output.
func (*Runner) RunWithEnv ¶
func (r *Runner) RunWithEnv(ctx context.Context, service string, rm bool, env map[string]string, cmd ...string) error
RunWithEnv runs a command with additional environment variables.
func (*Runner) RunWithEnvAndOutput ¶
func (r *Runner) RunWithEnvAndOutput(ctx context.Context, service string, rm bool, env map[string]string, stdout, stderr io.Writer, cmd ...string) error
RunWithEnvAndOutput runs a docker-compose run command with custom output.
func (*Runner) RunWithOutput ¶
func (r *Runner) RunWithOutput(ctx context.Context, service string, rm bool, stdout, stderr io.Writer, cmd ...string) error
RunWithOutput runs a one-off command in a new container with custom output writers.
func (*Runner) UpWithOutput ¶
UpWithOutput starts the Docker containers with custom output writers.
func (*Runner) WaitForDatabase ¶
WaitForDatabase waits for the database to be ready.
func (*Runner) WaitForReady ¶
WaitForReady waits for the xf container to be ready to accept commands.
func (*Runner) XFCommandDebug ¶
XFCommandDebug runs a XenForo CLI command with XDebug.