Understanding Buddy's Architecture
Key Components
- Projects: Represent Git repositories connected via integrations (GitHub, GitLab, Bitbucket, etc.)
- Pipelines: Sequences of defined actions (build, test, deploy) triggered manually or by Git events
- Actions: Atomic units like shell scripts, Docker builds, or deployments
Execution Model
Each pipeline runs in isolated containers with preconfigured environments. Buddy supports both cloud and on-prem deployments with different implications for caching, environment management, and infrastructure tuning.
Common Issues and Their Root Causes
Issue: Pipelines Stuck in "Waiting for Start"
This often occurs when parallel pipelines are queued and no runners are available to execute them.
Fix:
- Check the runner allocation under
Workspace > Runners
- Scale your runners in high-load scenarios
- Stagger cron jobs or Git triggers to reduce concurrent load
// Sample pipeline trigger control trigger_mode: ON_PUSH max_concurrent_runs: 2
Issue: Docker Caching Not Working
Frequent rebuilds of Docker layers drastically increase build times.
Causes:
- Modifications in early Dockerfile layers (invalidating cache)
- Disabled layer caching in pipeline settings
- Incorrect working directory for cache context
Resolution:
- Reorder Dockerfile layers to minimize changes to early steps
- Enable "Docker layer caching" in the build action settings
- Use external Docker registries for shared caching across pipelines
Pipeline Execution Failures
Problem: Environment Variables Not Loading
Missing or incorrect environment variables often result in failures during deployment or testing stages.
Diagnosis Steps:
- Use
echo $VARIABLE_NAME
within actions to confirm scope - Check if variables are defined at project, pipeline, or action level
- Ensure no overrides or typos in secret variable naming
// Example of setting variable visibility env_vars: - name: NODE_ENV value: production scope: pipeline
Problem: Git References Out of Sync
Deployments fail due to detached HEAD, missing branches, or out-of-date refs.
- Ensure webhook integration is active and authenticated
- Manually refresh the repository index in project settings
- Use
git fetch --all
in a custom action to force ref updates
Advanced Integration Challenges
Issue: Third-Party Integration Fails (AWS, Firebase, etc.)
Many integrations rely on token-based auth or scoped permissions. Errors often appear as generic 403/401 HTTP responses.
Fix:
- Validate that tokens/keys are up to date and scoped properly
- Use test credentials to isolate authentication problems
- Enable verbose logging in Buddy to see API responses
// Firebase deploy action (example) firebase deploy --only hosting --token $FIREBASE_TOKEN
Issue: Conditional Execution Logic Failing
Conditions based on branch name, environment, or trigger type often misbehave due to improper regex or syntax errors.
Solutions:
- Test regex expressions in sandbox pipelines
- Use the Buddy expression syntax validator
- Wrap conditionals inside
if
/else
blocks for complex logic
// Example: Branch-based conditional step if: trigger.branch == 'main'
Performance Optimization
- Enable pipeline caching for dependencies (npm, Maven, etc.)
- Use separate pipelines for build, test, and deploy stages
- Leverage SSH debugging for stuck or flaky pipelines
- Monitor runner health and logs under Workspace > Diagnostics
- Split monorepos using path-based triggers
Conclusion
Buddy CI/CD offers a powerful platform for automating deployment workflows, but issues around environment consistency, Docker caching, runner capacity, and external integrations can limit its scalability if not addressed. With proactive debugging techniques, modular pipelines, and observability tooling, teams can achieve stable, performant DevOps pipelines with Buddy—both in cloud and on-prem environments.
FAQs
1. Why is my Buddy pipeline stuck in pending?
It's usually due to no available runners. Check your workspace runner capacity and reschedule overlapping triggers.
2. How can I debug Docker layer cache misses?
Inspect which Dockerfile layers change frequently. Move those steps to the end and ensure caching is enabled in action settings.
3. Can I reuse environment variables across projects?
Only within the same workspace. Use workspace-level variables or create secure variables for each project manually.
4. How do I trigger pipelines for subdirectory changes in monorepos?
Use path filters in trigger conditions to only activate pipelines when specific folders are modified.
5. Is it possible to run Buddy pipelines locally?
No native local execution exists. Use Docker or SSH scripts for partial testing, but full pipeline execution requires Buddy's infrastructure.