Set default codebase
You can configure your Harness pipelines to build, test, and deploy code from your Harness Code repositories.
Set a pipeline's default codebase to a Harness Code repo
When creating or editing a pipeline, you can set the default codebase to a Harness Code repository.
- Visual editor
- YAML editor
- Edit the pipeline's Codebase settings.
- For Select Git Provider, select Harness.
- Enter your Repository Name.
In the YAML editor, use codebase.repoName
to specify a Harness Code repo, for example:
pipeline:
name: default
identifier: default
projectIdentifier: default
orgIdentifier: default
tags: {}
properties:
ci:
codebase:
repoName: YOUR_HARNESS_CODE_REPO_NAME
build: <+input>
If you are editing an existing pipeline, replace codebase.connectorRef
with codebase.repoName
, for example:
pipeline:
name: default
identifier: default
projectIdentifier: default
orgIdentifier: default
tags: {}
properties:
ci:
codebase:
connectorRef: YOUR_CODEBASE_CONNECTOR_ID ## Replace this setting with 'repoName: YOUR_HARNESS_CODE_REPO_NAME'
build: <+input>
Build and test code from a Harness Code repo
Build (CI
) stages usually use the pipeline's default codebase. For more information about codebase configuration for the Harness CI module, go to the CI documentation on configuring a codebase.
Deploy services from a Harness Code repo
For details about codebase configuration for services and the Harness CD module, go to the CD documentation, such as the documentation for deploying services.
Automate builds and deployments
You can set up triggers to automatically run builds or deployments in response to push events in your Harness Code repositories.