Welcome to the GitHub repository of our Harness NextGen Pipeline YAML Schema! This repository contains the schema definition for our pipeline configuration files, enabling users to define and customize their pipelines effortlessly.
Our pipeline YAML schema allows users to define their pipelines, making it easier to specify the steps, dependencies, and configurations required for their projects. With this schema, users can seamlessly create and modify pipeline configurations, resulting in more efficient and error-free deployments.
To start using the pipeline YAML schema, you need to follow these simple steps:
- Clone the Repository: Begin by cloning this GitHub repository to your local machine using the following command:
git clone https://github.com/harness/harness-schema.git
- Integration with Your Text Editor: To enable auto-intellisense for the pipeline YAML schema in your preferred text editors, follow the instructions below.
-
Install the YAML Extension: Make sure you have the "YAML" extension installed in your Visual Studio Code editor.
-
Open Your User Settings: In Visual Studio Code, go to File > Preferences > Settings.
-
Configure User Settings: In the right-hand pane, click on the
{}
icon to edit the settings.json file. -
Add Schema Association: To enable auto-intellisense for our pipeline YAML schema, add the following lines to your settings.json file:
"yaml.schemas": {
"https://raw.githubusercontent.com/harness/harness-schema/main/v0/pipeline.json": "pipeline.yaml"
}
- Restart Visual Studio Code: After adding the schema association, restart Visual Studio Code for the changes to take effect.
Now, when you work on a pipeline YAML file, Visual Studio Code will provide auto-intellisense based on the defined schema, helping you write correct and valid pipeline configurations effortlessly.
-
Install Package Control: If you haven't already, install Package Control for Sublime Text. You can find installation instructions here.
-
Install YAML Extension: In Sublime Text, open the command palette by pressing
Ctrl + Shift + P
(Windows/Linux) orCmd + Shift + P
(macOS). Type "Package Control: Install Package" and hitEnter
. Search for the "YAML" package and install it. -
Add Schema Association: Once you have the YAML package installed, go to Preferences > Package Settings > YAML > Settings.
-
Configure User Settings: In the right-hand pane, add the following configuration to enable auto-intellisense for our pipeline YAML schema:
{
"schema": "https://raw.githubusercontent.com/harness/harness-schema/main/v0/pipeline.json"
}
- Restart Sublime Text: After adding the schema association, restart Sublime Text for the changes to take effect.
Now, Sublime Text will provide auto-intellisense for the pipeline YAML schema, making it easier for you to write correct pipeline configurations.
We welcome contributions to enhance the pipeline YAML schema and make it even more robust. If you find any issues or have suggestions for improvement, please feel free to create an issue or submit a pull request. For major changes, please discuss your ideas with the maintainers first.
when we do branch cut for pipeline service, then we merge latest pipeline.json ( from schema repo ) into develop and release branch, you can verify your changes in release branch and develop once branch cut is done Similarly we when we do branch cut for template service, then we merge latest template.json ( from schema repo ) into develop and release branch, we can verify our intended changes in release branch and develop once branch cut is done
Also currently in Devspace the schema changes reflect instantaneously, as in devspaces we fetch schema directly from the harness-schema repo ( without the need to deploy / bounce devspace ) We have a flag USE_SCHEMA_FROM_HARNESS_SCHEMA_REPO whenever this flag is true we always fetch the schema from schema repo ( we do not take local pipeline.json into consideration here ) similarly whenever this flag is set to false we always use schema from local ( pipeline.json in pipeline src , template.json in template src )
USE_SCHEMA_FROM_HARNESS_SCHEMA_REPO this flag is true for devspace by default ( if you wish to test out your changes in devspace you will need to set this config to false ) For all other env this flag is false by default therefore local ( pipeline.json in pipeline src , template.json in template src ) are picked on PROD, QA and local env
For testing schema changes in local we can paste the generated schema from schema repo in local ( v0/pipeline.json and v0/template.json ) and we will need to restart pipeline/template src for this schema changes to be reflected, then go to YAML editor in pipeline/template studio the changes should be reflected there!