Skip to main content

Continuous Integration (CI)

The Harness Continuous Integration (CI) module helps development teams automate code building, testing, and pushing processes to achieve efficient application delivery.

Core Features

Intelligent Builds

  • Test Intelligence: Smart test selection, only running tests affected by code changes, significantly reducing test time
  • Cache Intelligence: Automatically cache dependencies and build artifacts to speed up subsequent builds
  • Docker Layer Caching: Optimize container image layer caching to reduce build time

Build Infrastructure

  • Managed Builds: Use Harness Cloud without managing build servers
  • Self-Hosted Builds: Run builds on your Kubernetes cluster or VMs
  • Dynamic Resource Allocation: Automatically adjust resource quotas based on build requirements

Pipeline Integration

  • Multi-Repository Support: Handle multiple Git repositories in the same pipeline
  • Visual Editor: Quickly build pipelines through a graphical interface
  • YAML Editor: Support code-based pipeline configuration
  • GitOps Integration: Deep integration with Git workflows

Use Cases

ScenarioDescription
Fast FeedbackGet build and test feedback immediately after code commits
Quality GatesEnsure code changes pass all quality checks before moving to the next stage
Image PushingAutomatically build and push Docker images to various container registries
Continuous TestingRun complete test suites for every change

Getting Started

1. Create a Pipeline

Create a new CI pipeline in Harness and select the Build stage type.

2. Configure Codebase

Connect your Git repository. Harness supports:
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps

3. Add Build Steps

Common build steps include:
  • Run Tests: Execute test suites
  • Build and Push: Build and push images
  • Plugin: Integrate third-party tools
  • Upload Artifacts: Upload build artifacts

4. Configure Triggers

Set up triggers based on Git events (Push, PR) or scheduled tasks.

Integration with Other Modules

The CI module integrates seamlessly with other Harness modules:
  • CD: Automatically trigger deployment after CI build completes
  • STO: Integrate security scanning in the build stage
  • CCM: Monitor cloud resource costs during builds
  • FF: Combine with feature flags for progressive releases

Best Practices

  1. Keep Builds Fast: Optimize dependency caching and only run necessary tests
  2. Use Test Isolation: Ensure tests can run in parallel
  3. Fail Fast: Configure reasonable quality gates
  4. Log Builds: Keep complete build process logs for debugging