Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
LogLevel string `env:"LOG_LEVEL,required" envDefault:"info"` // LogLevel is the log level for the application
HttpPort uint16 `env:"HTTP_PORT,required" envDefault:"80" validate:"min=1,max=65535"` // HttpPort is the port the HTTP server will listen on
WebhookSecret string `env:"WEBHOOK_SECRET,required"` // WebhookSecret is the secret used to authenticate the webhook
GitAccessToken string `env:"GIT_ACCESS_TOKEN"` // GitAccessToken is the access token used to authenticate with the Git server (e.g. GitHub) for private repositories
AuthType string `env:"AUTH_TYPE" envDefault:"oauth2"` // AuthType is the type of authentication to use when cloning repositories
SkipTLSVerification bool `env:"SKIP_TLS_VERIFICATION" envDefault:"false"` // SkipTLSVerification skips the TLS verification when cloning repositories.
DockerAPIVersion string `env:"DOCKER_API_VERSION" envDefault:"v1.40" validate:"regexp=^v[0-9]+\\.[0-9]+$"` // DockerAPIVersion is the version of the Docker API to use
}
AppConfig is used to configure this application
type DeployConfig ¶
type DeployConfig struct {
Name string `yaml:"name"` // Name is the name of the docker-compose deployment / stack
Reference string `yaml:"reference" default:"refs/heads/main"` // Reference is the Git reference to the deployment, e.g. refs/heads/main or refs/tags/v1.0.0
WorkingDirectory string `yaml:"working_dir" default:"."` // WorkingDirectory is the working directory for the deployment
ComposeFiles []string `yaml:"compose_files" default:"[\"compose.yaml\", \"compose.yml\", \"docker-compose.yml\", \"docker-compose.yaml\"]"` // ComposeFiles is the list of docker-compose files to use
RemoveOrphans bool `yaml:"remove_orphans" default:"true"` // RemoveOrphans removes containers for services not defined in the Compose file
ForceRecreate bool `yaml:"force_recreate" default:"false"` // ForceRecreate forces the recreation/redeployment of containers even if the configuration has not changed
ForceImagePull bool `yaml:"force_image_pull" default:"false"` // ForceImagePull always pulls the latest version of the image tags you've specified if a newer version is available
Timeout int `yaml:"timeout" default:"300"` // Timeout is the time in seconds to wait for the deployment to finish in seconds before timing out
BuildOpts struct {
ForceImagePull bool `yaml:"force_image_pull" default:"false"` // ForceImagePull always attempt to pull a newer version of the image
Quiet bool `yaml:"quiet" default:"false"` // Quiet suppresses the build output
Args map[string]string `yaml:"args"` // BuildArgs is a map of build-time arguments to pass to the build process
NoCache bool `yaml:"no_cache" default:"false"` // NoCache disables the use of the cache when building images
} `yaml:"build_opts"` // BuildOpts is the build options for the deployment
}
DeployConfig is the structure of the deployment configuration file
func DefaultDeployConfig ¶
func DefaultDeployConfig(name string) *DeployConfig
DefaultDeployConfig creates a DeployConfig with default values
func FromYAML ¶
func FromYAML(f string) (*DeployConfig, error)
func GetDeployConfig ¶
func GetDeployConfig(repoDir, name string) (*DeployConfig, error)
GetDeployConfig returns either the deployment configuration from the repository or the default configuration
func (*DeployConfig) UnmarshalYAML ¶
func (c *DeployConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.