October 30, 2024

So what exactly is Harness Open Source and why should you care?

Table of Contents

Harness Open Source is an all-in-one, open-source platform that streamlines the software development lifecycle, bringing together everything you need to host code, automate CI/CD, manage artifacts, and set up development environments. It accelerates development cycles and enhances productivity, providing teams with a cohesive environment to collaborate effectively.

Why Harness Open Source?

1. Secure Code Repository

Harness Open Source offers a Git-based source code repository with integrated tools for code reviews and secret scanning on commits. The built-in Gitleaks integration prevents hard-coded secrets (e.g., passwords, API keys) from entering your repository. Simply activate secret scanning per repository, and any push containing secrets will be blocked, keeping your history clean and secure.

Webhooks also enable integration with external tools by sending data on events like pull requests and new branches, keeping workflows in sync across your toolchain.

2. Preconfigured Development Environments (Gitspaces)

Gitspaces™️ are remote, ready-to-use development environments that eliminate complex local setups. You can access Gitspaces via VS Code in the browser or desktop, allowing instant coding and debugging with no local dependencies. Each Gitspace is a Docker container linked to a repository and branch, automatically cloned during setup.

Configuration is simple: developers can define custom environments in a devcontainer.json file with dependencies and commands that run on startup. If no configuration is provided, Gitspaces default to an Ubuntu-based Docker image. Gitspaces can be paused, resumed, or deleted on demand, making them versatile for parallel feature development or bug fixes.

Screenshot of a Harness Open Source Gitspace

3. Robust CI/CD Pipelines

Automate your entire delivery pipeline with Harness Open Source. Each repository supports multiple pipelines, allowing you to set triggers (e.g., push, pull request) that minimize conditional logic.

Key pipeline features:

  • Conditional Logic: Use operators (comparison, logical, regex) for custom triggers.
  • Matrix Strategy: Test multiple versions in a single pipeline step for comprehensive coverage.
  • Parallel Execution: Run steps in parallel or sequentially to optimize processing time.
  • Volume Mounting: Mount various volumes into containers, enhancing test flexibility.

With these capabilities, teams can automate code testing, image builds, deployments, and more, ensuring workflows are both efficient and adaptable. 

This YAML example shows a CI pipeline in Harness Open Source that builds, tests, and pushes a container image of a Golang application. 

kind: pipeline
spec:
 stages:
   - name: build-test-push
     spec:
       platform:
         arch: amd64
         os: linux
       steps:
         - name: go_install
           spec:
             container:
               image: golang:1.23
           script:
             - go install ./...
           type: run
         - name: go_test
           spec:
             container:
               image: golang:1.23
           script:
             - go test -v ./...
           type: run
         - name: go_build_push
           type: plugin
           spec:
             name: docker
             inputs:
               insecure: true
               repo: host.docker.internal:3000/PROJECT_NAME/REGISTRY_NAME/REPO_NAME
               registry: host.docker.internal:3000
               username: ${{ secrets.get("REGISTRY_USERNAME") }}
               password: ${{ secrets.get("REGISTRY_PASSWORD") }}
               tags: ${{ build.number }}
     type: ci
version: 1

Here’s a quick breakdown:

  1. Pipeline and Stages: The pipeline has one stage, build-test-push, which runs on a Linux platform with amd64 architecture.
  2. Steps: Each step in the stage performs a specific action:some text
    • go_install: Uses a Go container to install dependencies.
    • go_test: Runs application tests in the same container.
    • go_build_push: Builds and pushes a Docker image using a plugin, with registry details specified.
  3. Secrets: Harness Open Source includes a built-in secret manager, enabling secure access to sensitive information. In this pipeline, secrets (like REGISTRY_USERNAME and REGISTRY_PASSWORD) are referenced using ${{ secrets.get(...) }}, allowing secure authentication with the Docker registry.

4. Centralized Artifact Registry

Harness Open Source includes an Artifact Registry, a central storage for critical software artifacts like container images and Helm charts. The registry simplifies release management by offering a unified, accessible location for artifacts. Currently, Docker and Helm registries are supported, we plan to add Generic and Maven support.

Artifact management is integrated into pipelines, making it easy to build, test, scan, and deploy to Kubernetes—all while keeping artifacts organized and easily traceable.

Get Started with Harness Open Source

Harness Open Source is designed to be lightweight and easy to deploy. With just a simple Docker command, you can have the platform up and running in under 30 seconds. Whether you’re managing Git repositories, running CI/CD pipelines, or managing development environments, Harness Open Source provides the tools you need—all in one platform.

If you prefer a video to get started, check out this video:

With all these powerful features in one platform, Harness Open Source empowers you to handle end-to-end software development and delivery seamlessly. Get started today, and feel free to reach out with any feedback or questions—we’d love to hear from you!

Open Source