YAML Configuration Introduction
The Cloudbear Automation Platform (CAP) is a powerful tool designed to simplify the deployment and management of your applications. CAP transforms a simple YAML configuration file into the complex underlying infrastructure required to run your services efficiently and reliably.
Our goal is to provide a seamless and opinionated way to deploy applications, handle environment variables, manage services like databases and queues, and integrate with CI/CD pipelines, all through a single, declarative configuration.
The config.cap.yaml File
The config.cap.yaml file is the central piece of your application's deployment. It's typically placed in the root of your application's Git repository. While highly customizable, a typical config.cap.yaml will define key aspects of your application's deployment:
- HTTP (
http): Configures how your application is exposed to the internet or internal networks, including port, replicas, resources, and health checks.http: port: 80 replicas: 2 - Environment Variables (
env): Defines environment-specific configuration, including direct values, build-time variables, file-mounted variables, and integration with GitLab CI/CD secrets.env: APP_ENV: production API_KEY: gitlab: "MY_API_KEY" - Services (
services): Declares backing services your application needs, such as databases (MariaDB, PostgreSQL), message queues (RabbitMQ), or caching layers (Dragonfly).services: database: type: mariadb version: "10.6" cache: type: dragonfly - Workers (
workers): Defines background processes that run alongside your main application, often consuming from message queues.workers: email-sender: command: "php artisan send:emails" replicas: 1 - Cronjobs (
cronjobs): Schedules tasks to run at specific intervals using cron expressions.cronjobs: daily-report: schedule: "0 0 * * *" command: "php artisan reports:daily" - Connections (
connections): Specifies how your application connects to declared services or external resources.connections: - service: database - service: cache - Pipeline (
pipeline): Configures aspects of the CI/CD pipeline, such as merge request behavior, unified image usage, and release management.pipeline: enable: true onBranch: main
Declarative Approach
The declarative nature of config.cap.yaml means you focus on what your application needs, not how to provision each component. CAP translates your high-level descriptions into the necessary infrastructure configurations and orchestrates their deployment. This abstraction allows you to define your application's requirements, and CAP handles all the underlying complexities of bringing that infrastructure to life, reducing boilerplate and operational overhead.
For a detailed breakdown of every configurable property, refer to the YAML Schema Reference.