Spinnaker Pipeline Template: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 27: Line 27:
{
{
   "schema": "v2",
   "schema": "v2",
  "id": "<templateName>",          # The pipeline instance references the template using this
  "protect": <true | false>,
  "metadata": {
    "name": "displayName",          # The display name shown in Deck
    "description": "<description>",
    "owner": "example@example.com",
    "scopes": ["global"]            # Not used
  },
   "variables": [
   "variables": [
     {
     {
Line 35: Line 43:
     }
     }
   ],
   ],
  "id": "<templateName>",          # The pipeline instance references the template using this
  "protect": <true | false>,
  "metadata": {
    "name": "displayName",          # The display name shown in Deck
    "description": "<description>",
    "owner": "example@example.com",
    "scopes": ["global"]            # Not used
  },
   "pipeline": {                    # Contains the templatized pipeline itself
   "pipeline": {                    # Contains the templatized pipeline itself
     "lastModifiedBy": "anonymous",  # Not used
     "lastModifiedBy": "anonymous",  # Not used

Revision as of 21:30, 22 May 2023

External

Internal

Overview

Multiple pipeline instances can be created from a pipeline template. A pipeline template has two components: the template and the configuration.

Template

A template defines a parameterized pipeline, with the set of variables for which the users instantiating the template will provide values. The template does not have the pipeline configuration found on a pipeline instance. The template is useful in defining a pipeline pattern that can be instantiated as multiple concrete pipeline instances.

Elements

id

The identifier of this template. The pipeline instances generated from this template will references the template using the value of id.

protect

'true' or 'false'

Configuration

A pipeline template configuration is a concrete implementation of a template. Configurations can inject new stages into the final pipeline graph and inherit or override, or both, triggers, notifications, and parameters. The pipeline template configuration is the same as the configuration for a pipeline not created from a template, but it additionally have variable bindings and a reference to the template.

Variable

A template variable is a variable defined in a pipeline template, whose value is determined when a pipeline is instantiated based on the template. A template variable is different from a pipeline variable, which vary per execution of the pipeline.

Pipeline

Whether it’s created from a template or not, an executable pipeline that can be visualized in the UI.

Example

https://spinnaker.io/docs/reference/pipeline/templates/

Pipeline template JSON example:

{
  "schema": "v2",
  "id": "<templateName>",           # The pipeline instance references the template using this
  "protect": <true | false>,
  "metadata": {
    "name": "displayName",          # The display name shown in Deck
    "description": "<description>",
    "owner": "example@example.com",
    "scopes": ["global"]            # Not used
  },
  "variables": [
    {
      "type": "<type>",
      "defaultValue": <value>,
      "description": "<description>",
      "name": "<varName>"
    }
  ],
  "pipeline": {                     # Contains the templatized pipeline itself
    "lastModifiedBy": "anonymous",  # Not used
    "updateTs": "0",                # Not used
    "parameterConfig": [],          # Same as in a regular pipeline
    "limitConcurrent": true,        # Same as in a regular pipeline
    "keepWaitingPipelines": false,  # Same as in a regular pipeline
    "description": "",              # Same as in a regular pipeline
    "triggers": [],                 # Same as in a regular pipeline
    "notifications": [],            # Same as in a regular pipeline
    "stages": [                     # Contains the templated stages
      {
        # This one is an example stage:
        "waitTime": "${ templateVariables.waitTime }",  # Templated field.
        "name": "My Wait Stage",
        "type": "wait",
        "refId": "wait1",
        "requisiteStageRefIds": []
      }
    ]
  }
}