Integrating with your CI Platform
Learn how to integrate Ocuroot with your existing CI/CD pipeline
Ocuroot is designed to work seamlessly with your existing CI/CD infrastructure. Rather than replacing your current CI setup, Ocuroot enhances it by providing build tracking, deployment management, and dependency resolution capabilities.
Philosophy
The core philosophy of Ocuroot’s CI integration is to augment rather than replace. You can continue using your preferred CI platform (GitHub Actions, Jenkins, CircleCI, etc.) to schedule and execute work, while taking advantage of Ocuroot’s configuration model along with its build and deployment management features.
Key Commands
Ocuroot integrates with your CI platform through three main commands: ocuroot review
, ocuroot deliver
, and ocuroot sync
.
1. ocuroot review
Run this command when a pull request is submitted. It acts as a helper for your code review process by:
- Running linting checks
- Executing unit tests
- Providing early feedback to developers
2. ocuroot deliver
Execute this command when code is merged into your main branch. This step:
- Runs the build process
- Registers commits and builds in the Ocuroot system
- Ensures builds are tracked for deployment in the correct order
3. ocuroot sync
Trigger this command via a custom webhook to manage deployments. This command:
- Processes any pending deployments
- Maintains deployment order based on dependencies
- Ensures consistent state across environments
Triggering a Sync
You can configure subsequent sync operations using the trigger_sync
function in your repo.ocu.star
file.
This allows you to create deployment chains where one deployment automatically triggers another when appropriate conditions are met.
For example:
For more details on trigger_sync
configuration, see the trigger_sync documentation.
Authentication
To authenticate Ocuroot commands in your CI environment, you’ll need to set up the OCUROOT_API_KEY
environment variable.
This API key is not required for ocuroot review
but is necessary for the other two commands (ocuroot deliver
and ocuroot sync
).
You can obtain your API key from the Ocuroot web UI. Once you have it:
- Add the
OCUROOT_API_KEY
as a secure environment variable in your CI platform - Ensure the environment variable is available to your CI jobs
- The Ocuroot CLI will automatically use this key for authentication
For detailed instructions on obtaining and managing API keys, refer to our authentication documentation.
CI Platform Examples
While we provide a specific example for GitHub Actions, the principles outlined here can be applied to any CI platform. The key is to:
- Integrate the appropriate Ocuroot commands into your existing CI workflows
- Configure webhooks for sync operations
- Set up proper authentication for Ocuroot in your CI environment
Next Steps
- Review the GitHub Actions integration guide for a concrete implementation example
- Learn more about authentication in CI environments
- Explore advanced deployment configurations