Skip to main content

Harness Git Integration Overview

Harness enables a developer-centric experience for managing applications by implementing the Git-based methodology across its components. For example, you can trigger deployments in Harness using Git Pull and Push events. As a result, Harness Git integration allows you to use Git as the single source of truth when maintaining the state of the deployment process in Harness.

In addition, Harness lets you sync any Harness Application with a Git repo, using either a one-way or two-way sync. Almost anything you can do in the Harness UI, you can do in YAML in Git. For more information, see Configuration as Code.The following table describes the many Git-enabled components of Harness.

Harness FeatureGit FunctionalityLinks to Topics
Triggers with Git WebhooksUse a Harness Trigger Git Webhook URL to execute a Harness deployment in response to a Github, BitBucket, or GitLab event.Trigger Deployments using Git Events
File-based Repo TriggersInitiate the Harness Trigger only when specific files in the repo are changed. For example, initiate the Trigger only when a Helm values.yaml file in Git is changed.Trigger a Deployment when a File Changes
Using Git Push and Pull Request Variables in Harness ApplicationsGit push and pull request variables are available in a Trigger, and can be passed to the Workflows (and Pipelines) executed by the Trigger. An example variable is ${pullrequest.id} for Pull request ID.
Examples:
Map the Git payload to create uniquely-named Harness Environments and Infrastructure Definitions.
Use the Git payload with Git events, and Harness can respond to a Git event to build the artifact and deploy it to a unique infrastructure.

Push and Pull Request Variables

Passing Variables into Workflows and Pipelines from Triggers
Helm and Kubernetes Deployments

Pull a Helm chart from a Git repo.

Specify values or a full values.yaml file in Git repo and Harness will fetch the values during runtime.

Override Workflow variables using values added via a Git connector.

Map a Git payload, such as a PR number, to a Kubernetes namespace via variables. For example, you could use the PR number to create a unique Kubernetes namespace and deploy to that namespace to evaluate the PR build.


Helm Native Deployment Guide Overview

Kubernetes How-tos
note

Webhooks do not work with older versions of Bitbucket and will cause issues with push events sent to Harness. You need to install the Post Webhooks for Bitbucket plugin in Bitbucket to enable Harness to allow two-way sync with Bitbucket. For more information, see Bitbucket Post Webhooks Plugin.