Documentation
¶
Index ¶
- Variables
- func CheckMountPointWriteable(mountPoint container.MountPoint) error
- func ConnectToSocket() (net.Conn, error)
- func CreateDockerCli(quiet, verifyTLS bool) (command.Cli, error)
- func DeployCompose(ctx context.Context, dockerCli command.Cli, project *types.Project, ...) error
- func DeployStack(jobLog *slog.Logger, internalRepoPath, externalRepoPath string, ...) error
- func DestroyStack(jobLog *slog.Logger, ctx *context.Context, dockerCli *command.Cli, ...) error
- func Exec(client client.APIClient, containerID string, cmd ...string) (out string, err error)
- func GetContainerID(client client.APIClient, name string) (id string, err error)
- func GetLabeledContainers(ctx context.Context, cli *client.Client, key, value string) (containers []container.Summary, err error)
- func GetMountPointByDestination(cli *client.Client, containerID, Destination string) (container.MountPoint, error)
- func LoadCompose(ctx context.Context, workingDir, projectName string, composeFiles []string) (*types.Project, error)
- func NewHttpClient() *http.Client
- func OnCrash(client client.APIClient, containerID string, do func(), onErr func(err error))
- func VerifySocketConnection() error
- func VerifySocketRead(httpClient *http.Client) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrDockerSocketConnectionFailed = errors.New("failed to connect to docker socket") ErrNoContainerToStart = errors.New("no container to start") ComposeVersion string )
var ( ErrMountPointNotFound = errors.New("mount point not found") ErrMountPointNotWriteable = errors.New("mount point is not writeable") )
var DocoCDLabels = docoCdLabelNames{
Metadata: docoCDLabelNamesMetadata{
Manager: "cd.doco.metadata.manager",
Version: "cd.doco.metadata.version",
},
Deployment: docoCdLabelNamesDeployment{
Timestamp: "cd.doco.deployment.timestamp",
WorkingDir: "cd.doco.deployment.working_dir",
CommitSHA: "cd.doco.deployment.commit.sha",
CommitRef: "cd.doco.deployment.commit.ref",
},
Repository: docoCdLabelNamesRepository{
Name: "cd.doco.repository.name",
URL: "cd.doco.repository.url",
},
}
DocoCDLabels contains the label key names used by DocoCD to identify deployed containers and their metadata
Functions ¶
func CheckMountPointWriteable ¶ added in v0.13.0
func CheckMountPointWriteable(mountPoint container.MountPoint) error
CheckMountPointWriteable checks if a mount point is writable by attempting to create a file in it
func ConnectToSocket ¶
ConnectToSocket connects to the docker socket
func DeployCompose ¶
func DeployCompose(ctx context.Context, dockerCli command.Cli, project *types.Project, deployConfig *config.DeployConfig, payload webhook.ParsedPayload, repoDir, appVersion string) error
DeployCompose deploys a project as specified by the Docker Compose specification (LoadCompose)
func DeployStack ¶ added in v0.14.0
func DeployStack( jobLog *slog.Logger, internalRepoPath, externalRepoPath string, ctx *context.Context, dockerCli *command.Cli, p *webhook.ParsedPayload, deployConfig *config.DeployConfig, appVersion string, ) error
DeployStack deploys the stack using the provided deployment configuration
func DestroyStack ¶ added in v0.14.0
func DestroyStack( jobLog *slog.Logger, ctx *context.Context, dockerCli *command.Cli, deployConfig *config.DeployConfig, ) error
DestroyStack destroys the stack using the provided deployment configuration
func GetContainerID ¶ added in v0.13.0
GetContainerID retrieves the container ID for a given service name
func GetLabeledContainers ¶ added in v0.13.0
func GetLabeledContainers(ctx context.Context, cli *client.Client, key, value string) (containers []container.Summary, err error)
GetLabeledContainers retrieves all containers with a specific label key and value
func GetMountPointByDestination ¶ added in v0.13.0
func GetMountPointByDestination(cli *client.Client, containerID, Destination string) (container.MountPoint, error)
GetMountPointByDestination retrieves the mount point of a container volume/bind mount by its destination (mount point inside the container)
func LoadCompose ¶
func LoadCompose(ctx context.Context, workingDir, projectName string, composeFiles []string) (*types.Project, error)
LoadCompose parses and loads Compose files as specified by the Docker Compose specification
func NewHttpClient ¶
func OnCrash ¶ added in v0.13.0
OnCrash listens for container events and executes a callback function when the specified container crashes or stops.
func VerifySocketConnection ¶
func VerifySocketConnection() error
VerifySocketConnection verifies whether the application can connect to the docker socket
func VerifySocketRead ¶
VerifySocketRead verifies whether the application can read from the docker socket
Types ¶
This section is empty.